Files
FabledScribe/frontend/src/components/MilestoneSelector.vue
T
bvandeusen 012eb1d46b Add Projects, Milestones, RAG auto-inject, push notifications, PWA, tag normalisation
## 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>
2026-03-02 20:52:21 -05:00

87 lines
1.8 KiB
Vue

<script setup lang="ts">
import { ref, watch } from "vue";
import { apiGet } from "@/api/client";
interface Milestone {
id: number;
title: string;
status: string;
}
const props = defineProps<{
projectId: number | null;
modelValue: number | null;
}>();
const emit = defineEmits<{
(e: "update:modelValue", val: number | null): void;
}>();
const milestones = ref<Milestone[]>([]);
const loading = ref(false);
watch(
() => props.projectId,
async (pid) => {
milestones.value = [];
if (!pid) {
emit("update:modelValue", null);
return;
}
loading.value = true;
try {
const data = await apiGet<{ milestones: Milestone[] }>(
`/api/projects/${pid}/milestones`
);
milestones.value = data.milestones.filter((m) => m.status === "active");
} catch {
milestones.value = [];
} finally {
loading.value = false;
}
},
{ immediate: true }
);
function onChange(e: Event) {
const val = (e.target as HTMLSelectElement).value;
emit("update:modelValue", val ? Number(val) : null);
}
</script>
<template>
<select
class="milestone-select"
:value="modelValue ?? ''"
:disabled="!projectId || loading"
@change="onChange"
>
<option value="">{{ projectId ? "No milestone" : "(Select project first)" }}</option>
<option v-for="m in milestones" :key="m.id" :value="m.id">
{{ m.title }}
</option>
</select>
</template>
<style scoped>
.milestone-select {
padding: 0.4rem 0.6rem;
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
background: var(--color-bg);
color: var(--color-text);
font-size: 0.875rem;
font-family: inherit;
box-sizing: border-box;
width: 100%;
}
.milestone-select:focus {
outline: none;
border-color: var(--color-primary);
}
.milestone-select:disabled {
opacity: 0.5;
cursor: default;
}
</style>