Capture walkthroughs online in a separate tool, merge them in offline (Fixes #28)
build.js now also writes capture.html: no document, no payload, no storage. It captures walkthroughs and exports an encrypted .fwcapture bundle (magic FC, own passphrase). The main app's Import captures... opens a bundle and places each walkthrough in a chosen section or sub-tab; nothing is written until Save and the bundle is never modified. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,8 @@ bump-version.js `npm run bump`, and the pre-commit hook's engine: advan
|
||||
.githooks/pre-commit runs `bump-version.js --staged`; enable once per clone with `npm run hooks`
|
||||
package.json scripts: build, seal, test
|
||||
src/
|
||||
capture.js capture-bundle format and merge destinations (pure)
|
||||
capture-app.js the UI of the separate capture.html tool
|
||||
crypto.js encrypt / decrypt / passphrase rules (blob format below)
|
||||
model.js document schema, validate(), section/record/field/sequence kinds
|
||||
ops.js pure edit helpers: add/move/remove, header, images, sequences, sub-tabs,
|
||||
@@ -69,6 +71,7 @@ A **visual sequence** (`kind: 'sequence'`, numbered `frames` of image + text wit
|
||||
- **Credential references (issue #24):** a frame's `uses: [{record, field}]` points at record fields by id. A field gets an `id` the first time it is referenced (`ensureFieldId`, `addUse`, `findFieldRef`, `allRecordsIn` in `ops.js`). A dangling reference is shown as removed, never a validation error. `viewUses` and `copyValue` (30 s clipboard wipe) are in `app.js`; `usesView` in `print.js` does the masked/included print text.
|
||||
- **Annotation (issue #25):** a frame's `marks` are `{type:'marker',x,y}` or `{type:'box',x,y,w,h}` as fractions of the picture (`isMark`, `normRect` in `images.js`). `markedImage()` in `app.js` wraps a step's `<img>` in a `.marked` box and lays CSS overlays over it, so the same marks work in the list, player, lightbox and print. `openAnnotator()` is a canvas dialog; Blur out runs `pixelateRegion()` (pure, in `images.js`) on the pixels and `Apply` re-encodes the picture, so no unblurred copy is stored. Marks are dropped when the picture is replaced, removed or erased by `clearSecrets`.
|
||||
- **Search (issue #27):** `src/search.js` has the pure `searchRanges()` (case-insensitive, plain text) and `stepSearchIndex()`. In `app.js` a toolbar **Search** button sets `state.searchOpen`, which swaps the toolbar's buttons for the search controls (same row); Cancel swaps them back. The controls are a persistent element re-attached on every `render()` (so the typed text and focus survive). `findAllHits()` builds a hidden copy of every section with `state.searchAll` set (all sub-tabs, nothing folded) using the normal view functions, then counts matches per entry (`data-eid` on record/item/sequence elements). `stepSearch()` navigates (section, sub-tab, unfold, `state.walk = null`); `highlightSearch()` runs at the end of `render()` and wraps the matches in `<mark class="hit">`. Text under `SEARCH_SKIP` (buttons, inputs, `.secret`, `.nosearch`) is never searched, so secrets stay out. New view-mode furniture such as dates and badges needs the `nosearch` class or it will be counted.
|
||||
- **Capture online, merge offline (issue #28):** `build.js` also writes `capture.html` (modules `crypto, images, capture, version` + `src/capture-app.js`, no document, no payload, no storage). It captures walkthroughs and exports an encrypted bundle: `src/capture.js` (`sealBundle`, `openBundle`, `validateBundle`, `destinations`), the blob uses magic `"FC"` 0x01 via the `magic` argument of `encrypt`/`decrypt`, so bundles and documents can't be confused. The main app's **Import captures…** (`importCaptures()` in `app.js`) opens a bundle, lets the user choose a destination per walkthrough, and `importWalkthrough()` in `ops.js` adds each as a sequence. Nothing is written until Save; the bundle file is never modified. Annotation happens after import.
|
||||
- **Reset (`?reset=1`):** opening the file with `?reset=1` or `#reset=1` shows a banner after unlock offering to erase every secret-flagged field value and secret frame (`clearSecrets()` in `ops.js`, count from `countSecrets`). Labels, structure and flags stay. It is read live (`resetRequested()`), with a `hashchange` listener to re-offer, and `state.resetOffered` dismisses it. Nothing is written until Save, so make a Backup copy first. It's meant for working on layout on a less safe machine.
|
||||
|
||||
**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`.
|
||||
|
||||
Reference in New Issue
Block a user