feat: add base shell, notes panel, back-navigation with stale propagation
Implements Task 4: base.html DaisyUI/Alpine shell, notes autosave panel, nav.py phase switching with downstream stale marking, notes.py save/get endpoints, state debug endpoint, and stub /triage route for test support. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
function notesApp(initialNotes, albumId) {
|
||||
return {
|
||||
open: false,
|
||||
notes: initialNotes,
|
||||
status: '',
|
||||
saveTimer: null,
|
||||
|
||||
scheduleAutosave() {
|
||||
clearTimeout(this.saveTimer);
|
||||
this.status = 'Saving…';
|
||||
this.saveTimer = setTimeout(() => this.doSave(), 500);
|
||||
},
|
||||
|
||||
async doSave() {
|
||||
const res = await fetch('/notes/save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ album_id: albumId, notes: this.notes }),
|
||||
});
|
||||
this.status = res.ok ? 'Saved ✓' : 'Error';
|
||||
},
|
||||
|
||||
async convertToEntry(text) {
|
||||
const res = await fetch('/group/from-note', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ album_id: albumId, text }),
|
||||
});
|
||||
if (res.ok) {
|
||||
this.status = 'Added as entry ✓';
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user