diff --git a/frontend/src/views/TaskEditorView.vue b/frontend/src/views/TaskEditorView.vue index d60f618..db70b29 100644 --- a/frontend/src/views/TaskEditorView.vue +++ b/frontend/src/views/TaskEditorView.vue @@ -109,6 +109,29 @@ async function toggleSubTask(sub: SubTask) { } const showPreview = ref(false); const sidebarOpen = ref(true); +const reconsolidating = ref(false); + +// Body is machine-maintained once a consolidation pass has run. The editor +// is gated to read-only in that state; the user can re-consolidate or rely +// on log_work entries flowing into the next auto pass. +const isBodyAutoMaintained = computed(() => consolidatedAt.value !== null); + +async function reconsolidate() { + if (!taskId.value || reconsolidating.value) return; + reconsolidating.value = true; + try { + const { consolidateTask } = await import("@/api/client"); + const updated = await consolidateTask(taskId.value); + body.value = updated.body; + consolidatedAt.value = updated.consolidated_at ?? null; + savedBody = body.value; + toast.show("Task summary refreshed"); + } catch { + toast.show("Failed to re-consolidate", "error"); + } finally { + reconsolidating.value = false; + } +} const editorRef = ref | null>(null); const titleRef = ref(null); const tiptapEditor = computed(() => { @@ -462,13 +485,33 @@ useEditorGuards(dirty, save);
- + +
+ + Auto-summarized from work logs. + +
+ +
- - + +
- +
@@ -482,9 +525,14 @@ useEditorGuards(dirty, save); - +
{{ assist.error.value }}
@@ -1028,4 +1080,43 @@ useEditorGuards(dirty, save); outline: none; border-color: var(--color-primary, #6366f1); } + +/* ── Auto-summary banner + re-consolidate button ─────────────────────────── */ +.auto-summary-banner-editor { + display: flex; + align-items: center; + gap: 0.6rem; + padding: 0.45rem 0.7rem; + margin-bottom: 0.5rem; + font-size: 0.82rem; + font-style: italic; + color: var(--color-text-muted, rgba(255, 255, 255, 0.6)); + background: rgba(99, 102, 241, 0.06); + border-left: 2px solid var(--color-primary, #6366f1); + border-radius: var(--radius-sm, 4px); +} +.auto-summary-banner-editor .auto-summary-icon { + color: var(--color-primary, #6366f1); + font-style: normal; +} +.btn-reconsolidate { + margin-left: auto; + padding: 0.25rem 0.7rem; + font-size: 0.78rem; + font-style: normal; + color: inherit; + background: transparent; + border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12)); + border-radius: 999px; + cursor: pointer; + transition: background 120ms ease; +} +.btn-reconsolidate:hover:not(:disabled) { + background: rgba(99, 102, 241, 0.12); + border-color: var(--color-primary, #6366f1); +} +.btn-reconsolidate:disabled { + opacity: 0.5; + cursor: progress; +} \ No newline at end of file