## Projects & Milestones (Phases A + G) - New models: Project, Milestone (Project → Milestone → Task hierarchy) - notes table: project_id + milestone_id FKs; parent_id FK constraint activated - Migrations: 0017 (projects), 0018 (push_subscriptions), 0019 (events), 0020 (milestones) - Services: projects.py, milestones.py (CRUD + progress tracking) - Routes: /api/projects + /api/projects/<id>/milestones - LLM tools: create/list/get/update project; create/list milestone; project + milestone + parent_task params on note/task tools - Frontend: ProjectListView (stacked milestone bars), ProjectView (milestone-grouped kanban), ProjectSelector, MilestoneSelector, NoteEditorView + TaskEditorView updated ## RAG Auto-injection (Phase B) - Notes ≥0.60 cosine similarity auto-injected into system prompt (max 3, 800 chars each) - excluded_note_ids param; ChatView "Auto-included" sidebar section ## Summarisation improvements (Phase C) - Threshold 20→30, keep-recent 6→8, max_tokens 200→400 - Two-pass summarisation for histories >50 messages ## Browser push notifications (Phase E) - PushSubscription model + migration; pywebpush dependency - /api/push routes; VAPID config; fire-and-forget on generation complete - Frontend: sw.js, push store, Settings toggle ## PWA manifest (Phase F) - manifest.json, Apple meta tags, service worker registration in main.ts ## Tag normalisation - All tags lowercased + deduplicated at backend (create_note/update_note) and frontend (TagInput sanitize) - Note/Task types gain project_id + milestone_id fields; store signatures updated ## CalDAV - Radicale embedded server reverted; back to user-configured external CalDAV Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68 lines
1.6 KiB
Vue
68 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { ref, onMounted } from "vue";
|
|
import { apiGet } from "@/api/client";
|
|
|
|
interface Project {
|
|
id: number;
|
|
title: string;
|
|
status: string;
|
|
}
|
|
|
|
defineProps<{
|
|
modelValue: number | null;
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
(e: "update:modelValue", value: number | null): void;
|
|
}>();
|
|
|
|
const projects = ref<Project[]>([]);
|
|
let cacheExpiry = 0;
|
|
|
|
async function loadProjects() {
|
|
const now = Date.now();
|
|
if (projects.value.length > 0 && now < cacheExpiry) return;
|
|
try {
|
|
const data = await apiGet<{ projects: Project[] }>("/api/projects?status=active");
|
|
projects.value = data.projects;
|
|
cacheExpiry = now + 60_000; // 60 second cache
|
|
} catch {
|
|
// Silently fail — selector will just be empty
|
|
}
|
|
}
|
|
|
|
onMounted(loadProjects);
|
|
|
|
function onChange(e: Event) {
|
|
const value = (e.target as HTMLSelectElement).value;
|
|
emit("update:modelValue", value ? Number(value) : null);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<select class="project-selector" :value="modelValue ?? ''" @change="onChange">
|
|
<option value="">No project</option>
|
|
<option v-for="project in projects" :key="project.id" :value="project.id">
|
|
{{ project.title }}
|
|
</option>
|
|
</select>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.project-selector {
|
|
padding: 0.4rem 0.5rem;
|
|
border: 1px solid var(--color-input-border);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--color-bg-card);
|
|
color: var(--color-text);
|
|
font-size: 0.9rem;
|
|
font-family: inherit;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
.project-selector:focus {
|
|
outline: none;
|
|
border-color: var(--color-primary);
|
|
}
|
|
</style>
|