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:
@@ -1,3 +1,25 @@
|
||||
from flask import Blueprint
|
||||
from flask import Blueprint, current_app, jsonify, request
|
||||
from app.state import load_state, save_state
|
||||
|
||||
bp = Blueprint("notes", __name__)
|
||||
|
||||
PHASE_ORDER = ["triage", "curate", "group", "write", "export"]
|
||||
|
||||
|
||||
@bp.post("/notes/save")
|
||||
def save_notes():
|
||||
body = request.get_json()
|
||||
state = load_state(body["album_id"], current_app)
|
||||
if state is None:
|
||||
return jsonify({"error": "no state"}), 404
|
||||
state.notes = body["notes"]
|
||||
save_state(state, current_app)
|
||||
return jsonify({"ok": True})
|
||||
|
||||
|
||||
@bp.get("/notes/<album_id>")
|
||||
def get_notes(album_id):
|
||||
state = load_state(album_id, current_app)
|
||||
if state is None:
|
||||
return jsonify({"error": "no state"}), 404
|
||||
return jsonify({"notes": state.notes})
|
||||
|
||||
Reference in New Issue
Block a user