From f0c265be88f1bd54367b05f64ad41dd986f09295 Mon Sep 17 00:00:00 2001 From: Eric Bell Date: Sat, 21 Nov 2026 19:11:07 -0500 Subject: [PATCH] Update OVERVIEW.md for collapsible and movable records Co-Authored-By: Claude Sonnet 5.5 --- OVERVIEW.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OVERVIEW.md b/OVERVIEW.md index 6a7ed50..4124e90 100644 --- a/OVERVIEW.md +++ b/OVERVIEW.md @@ -59,8 +59,9 @@ Git-ignored on purpose: `*.pdf`, `data/` (plaintext working copies with real sec A **visual sequence** (`kind: 'sequence'`, numbered `frames` of image + text with a layout of right / under / none) is an entry in the same ordered list as a section's records or items, or in a text section's `sequences` array. It is not a record or an item: no step number and no tick box. Ids are unique across the whole document. `secret` flags exist on fields and frames. Validation is `validate()` / `assertValid()`; the save path refuses an invalid document. -**UI** (`src/app.js`, a single IIFE): state lives in one `state` object. Edits mutate `state.doc` in place and then call `markDirty()` or `changed(record)` (which also stamps `updated` and `meta.lastUpdated`). `render()` rebuilds the page. `changed` clears `state.status`, so set the status afterwards. +**UI** (`src/app.js`, a single IIFE): state lives in one `state` object (including `collapsed`, the folded record ids). Edits mutate `state.doc` in place and then call `markDirty()` or `changed(record)` (which also stamps `updated` and `meta.lastUpdated`). `render()` rebuilds the page. `changed` clears `state.status`, so set the status afterwards. - **Editing and Cancel:** edit mode is global. **Cancel** reverts the section (or the print header) on screen to a deep-copy baseline taken at open and at each save, then leaves edit mode. +- **Collapsing records:** in view mode each record card has a Collapse/Expand button, and records sections have "Collapse all" / "Expand all". Folded ids live in `state.collapsed` (a `Set`, view-only, never saved, cleared on reload). A collapsed card shows only its title and gets ↑/↓ buttons that reorder it via `move()` and `changed()`, so moving stamps `updated` and marks the document dirty. - **Images:** drag and drop, clipboard paste and file picker all feed `importFiles()`. Files are sniffed by their first bytes, downscaled to at most 1600 px and re-encoded, which strips metadata, and stored as data URLs with a limit of about 3 MB each. **Save.** Uses the File System Access API (`showSaveFilePicker`, handle reused) where available, otherwise a Blob download. `assemble()` rebuilds the full HTML from the page's own CSS and JS plus a fresh encrypted payload. "Backup copy" downloads `final-wishes-YYYYMMDD.html`.