Add keep/do-not-delete flag for snapshots #144
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The web UI should allow marking snapshots or events as "keep" / "do not delete". This requires:
keepboolean column in the snapshots table (or a separate protected_snapshots table)This was intentionally deferred during the process split (#143) to keep scope tight.
Findings from exploration
src/cang/web/templates/_keep_btn.htmlis orphaned scaffolding from the original app commit (8b032bf) — it references a defunctclipsconcept (/clips/{id}/keep); no route renders it. It will be replaced with the real button.group_events_*grouping is total over motion snapshots), so keep semantics are deterministic: motion frame → keep its whole journey; background frame → keep just that frame. No mixed states.delete_expired_snapshots()(db.py); the daemon just unlinks returned paths, so oneAND keep = 0in both branches is sufficient.keepboolean column onsnapshots(issue option 1) — a separate protected table would force aNOT EXISTSjoin into cleanup for no benefit.Plan of attack (design approved in chat with Marvin8):
ALTER TABLE snapshots ADD COLUMN keep INTEGER NOT NULL DEFAULT 0+set_keep()db helper.delete_expired_snapshots()skipskeep = 1rows (motion + background).POST /snapshots/{snapshot_id}/keep— toggle; recomputes the day's journeys with configuredjourney_gap_seconds, keeps the containing journey or the single background frame; returns JSON{kept: [ids], keep: bool}.keeparray insnapshots_json, Keep/Unkeep button beside Prev/Play/Next (fetch-driven), kept-variant motion markers on the density track.docs/web-ui.md; Release-Notes bullet.