feat(storage): PDF editor persists to per-file sidecar
Some checks failed
CI / Windows build (push) Has been cancelled

Phase 2 (core swap). The PDF editor and split-view scratchpad stop
writing SQLite and persist to a per-file sidecar
`<pdfPath>.badnote.json` (debounced, atomic temp+rename+.bak) — so
annotations travel with the file. The source path is the identity
(no more djb2 doc-id).

- SidecarRepository wraps the Phase-1 store with debounced autosave.
- pen_editor: per-page ink, scratch-links AND highlights now persist
  to the sidecar and restore on reopen (closes persist-highlights).
- New "un-highlight" tool: tap a stored highlight to remove it — the
  highlight could not be removed before.
- split_view: each anchor's scratchpad lives in the sidecar's
  scratchLinks[id].scratchpad, keyed by anchor id.

Note: pre-existing SQLite annotations are migrated later (Phase 5);
note/slide editors swap in Phase 4. analyze clean, tests green.
This commit is contained in:
2026-06-24 21:03:28 +08:00
parent 953c7b700f
commit 978111eeff
9 changed files with 647 additions and 112 deletions

View File

@@ -200,6 +200,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get actionHighlightSelection => 'Highlight selection';
@override
String get toolRemoveHighlight => 'Remove highlight (tap a highlight)';
@override
String get toolPlaceScratchLink => 'Place scratch link';