The owner asked for “state for these and more, e.g. scroll depth, on all lenses” to be normal on relaunch. Zoom, quote grouping and panel sizes already are (R89). What is left is how fine a place each lens comes back to, and whether anything beyond the place — filters, search, the selected quote, open disclosures — comes back with it. The Mac norm is the place you were, not the filters (Finder restores a folder’s view and scroll; Mail clears search). This page lays out three widths of answer and what each costs when the content changed, when two windows show one study, in the HTML export, and in where the state has to live.
| Restores today | Mechanism | Where it lives |
|---|---|---|
| The window set, and each window’s study and lens | WindowGroup(id:"main", for: WindowSeed.self); macOS restores the seeds. A window with a place arrives there once, then forgets it. | macOS window restoration |
| The lens a study was left on | LensMemory.restore from Project.lastLens; written on every route-change. | projects.json → last_lens (machine-local, outside the study folder) |
| A coarse place in the lens | LensAnchor: Quotes → group heading id (theme-…/section-…), Codebook → framework section id, Sessions → session id (navigate, from SessionsRouteMemory). Signals, Project, Discussion, Screens → top, decided 16 Aug. | projects.json → last_anchor |
| Zoom, panels open/width, display layout/density/breaks, focus mode, quote grouping, subtitle prefs | R89 report-pref mirror: 16 keys + 1 prefix, seeded into each new web view before the SPA reads. App-wide, last write wins. | UserDefaults reportPrefs |
| Projects sidebar column width | AppKit NSSplitView autosave (measured 25 Sep). | UserDefaults (AppKit’s own key) |
| Deliberately not restored | Search and filter — “a query restored days later shows 6 of 312 quotes and reads as data loss” (LensMemory.swift; Mail precedent). Carve-out standing, ruling 12. | |
| Not restored, undecided | The offset inside a long group; the place in a transcript (session is kept, the moment is not); the Signals row you were on; a Codebook code rather than its framework; the Discussion question; the selected quote; moderator-question pins (bristlenose-mod-questions); transcript timeline on/lanes (bn-transcript-timeline); inspector source (bn-inspector-source); signal working panel (bn-signal-working-open) — the last four are written to localStorage, which the Mac discards, and are not in the R89 list. | |
Tuesday 17:40. One window on Quotes: tags sidebar open at 260 px, zoom 110 %, search tutorial, tag filter onboarding, reading the second quote under Onboarding gaps. A second window on Sessions, in s1’s transcript at 1:06. Quit. Wednesday 09:10, launch. Every option below keeps what R89 keeps (panels, zoom, grouping); they differ in where each window lands and what else is on screen.
last_lens: "quotes", last_anchor: "theme-onboarding-gaps" (the heading above the card, reported on scroll-settle), and in UserDefaults bn-tags-open: "true", bn-tags-width: "260", bristlenose-zoom: "1.1". The search, the filter, the focused card and the scroll offset are in the web view’s .nonPersistent() storage and in React state; both are gone at Quit. The Sessions window writes last_anchor: "s1" — the same field, last writer wins, which is the first consequence to keep in view.Ship as is. Each window comes back on its lens; Quotes and Codebook scroll to the group heading you were under; Sessions reopens the transcript at the top; Signals, Project, Discussion and Screens open at the top. Search and filter cleared.
S · 0 nothing to build. Layers touched: none. Sibling: this is the shipped sibling.
SessionsRouteMemory is cleared on run completion so a stale s3 cannot open the wrong participant.last_anchor is per study, not per window. Two Quotes windows on one study both land at the same heading. Tolerable at heading granularity.Two small moves on shipped seams. B1: LensAnchor’s table and useAnchorReporter’s selectors get one finer entry per lens, still an element id and never a pixel offset. B2: the view toggles that are preferences rather than filters join the R89 list. Search and filter stay cleared; the selected quote is not restored.
S B2: six lines across two lists and the contract JSON, both sides already asserted. M B1: one selector per lens in ANCHOR_SELECTORS, one arm per lens in LensAnchor.action, and a new .session(id, moment) apply path (navigate, then scroll — WindowPlace already carries path + anchor, so the shape exists). Layers: frontend/src/hooks/useAnchorReporter.ts, LensAnchor.swift, ContentView.restoreAnchor, their tests. No new message, no new store, no new key in projects.json.
LensAnchor/useAnchorReporter (16 Aug), which already say “an id either resolves or falls back honestly”; the report’s Open … in New Window, which already lands a window on a transcript at a moment through WindowPlace. B1 reuses that arrival for a restore. B2’s sibling is R89 itself. Everything here follows; nothing invents.q-p1-66 survives edits, stars, tags and renames. A hidden quote is out of the DOM → scrollToAnchor retries, gives up at the top. A re-analysis can renumber participants, so q-p1-66 could resolve to a different quote that looks right — the exact objection SessionsRouteMemory answers by clearing on run completion. Rule to carry over: clear last_anchor when a run completes, for every lens, as the route memory already does for Sessions. One line, and it is the thing that makes finer anchors safe.embedded; a browser keeps its own localStorage, so B2’s three toggles already persist there.Everything in B, and the window comes back with its search, tag filter, focused quote and pinned moderator questions as they were — per window, not per study, so two windows on one study each return to their own view.
L A new bridge message both ways, a per-window store, and the SPA accepting initial search/filter/selection state at mount in QuotesContext, Toolbar and QuoteGroup (today they start empty by construction). Per-window selection is not even per-window in the SPA yet. Layers: Swift (@SceneStorage, BridgeHandler, ContentView), TypeScript (four stores and a seed), both test suites, and the LensMemory doc comment, which has to be rewritten because it argues the opposite.
WindowSeed is the per-window value macOS restores, but it is identity, not state; @SceneStorage is the right primitive and is unused. Departs from LensMemory’s stated rule; the departure clause would have to be “a filter restored is a filter the researcher set yesterday, so it is theirs” — which the right-hand frame answers.| A · lens + heading (today) | B · finer place + the four toggles | C · whole view, per window | |
|---|---|---|---|
| Where the Quotes window lands | top of the group you were in | the quote you were reading | the quote, with your search and filter back |
| Where the transcript lands | 00:00 of the right session | the moment you were at | the moment; plus timeline state (B2 gives that too) |
| Signals · Codebook · Discussion | top · framework header · top | the row · the code · the question | as B, plus the inspector’s selection |
| Study re-analysed overnight | falls to the top honestly | falls to the top honestly if last_anchor is cleared on run completion (carry the Sessions rule) | “0 of 312”, a dead tag chip, an empty page |
| A quote hidden or deleted | unaffected | retry, then the top | selection points at nothing; filter may now match nothing |
| Two windows on one study | same heading (per study) | same quote (per study; a tie) | each its own view |
| HTML export | unchanged under every option: no bridge, so no restore; the browser’s own storage keeps the R89 keys as it always did | ||
| Where the state lives | projects.json + UserDefaults | the same two files, finer values and three more keys | a new per-window @SceneStorage blob, plus a new bridge message |
| Keys | last_lens, last_anchor, reportPrefs[16+1] | as A; reportPrefs[19+1] | as B; viewState per scene |
| Build cost | S · 0 | S B2 · M B1 | L |
| Reverses a written decision | no | “Signals/Discussion restore to the top” (16 Aug) — a table entry each | the search/filter carve-out (LensMemory, ruling 12) |
| Is it Bristlenosey | it is the sibling | follows (anchor table, R89 list, WindowPlace arrival) | departs, unjustified on the filter half; new store on the other |
anchor-change {lens:"quotes", anchor:"q-p1-66"} · Swift writes last_anchor only on changeprojects.json and UserDefaults already currentready → LensMemory.restore → activateLens → restoreAnchor: scroll to q-p1-66; retry, then toplast_anchor cleared at run completion (new, mirrors SessionsRouteMemory) → lands at the lens top, never on a lookalikeOption B, in two commits: B2 first (three keys into the R89 contract — an afternoon), then B1 (finer anchors through the shipped LensAnchor table), with one rule carried over from Sessions: clear last_anchor when a run completes. Keep the search/filter carve-out exactly as written.
Why. The owner’s phrase is “scroll depth”, and the honest unit of scroll depth in this product is an element, not a pixel: the quote, the turn, the row. B gives the place at that unit on every lens that has one, through seams that already exist and are already tested on both sides, and it never restores anything that could make yesterday’s content look lost. C’s only unique gain is per-window views; the right-hand frame of C shows what its filter half costs, and the only researcher who meets the two-windows case gets a tie, not an error. A is what ships today and the owner has already said it is not enough.
Sequence. B2 → B1 (Quotes quote id, Sessions moment, Codebook code) → the Signals and Discussion entries once their row ids are confirmed stable across elaboration. Per-window state waits for a case that needs it; if one comes, the anchor moves into @SceneStorage without changing anything the SPA reports.
projects.json). Two windows on one study land together. Accept the tie for now, or move the anchor into @SceneStorage as part of B1 (adds a day; no SPA change)?| Part | Proposal (B) | Sibling | Verdict |
|---|---|---|---|
| Surface | no new UI; the window lands somewhere | LensMemory / LensAnchor | follows |
| Data path | anchor-change inbound, scrollToAnchor / navigate outbound | the same messages, 16 Aug; WindowPlace arrival for path + anchor | follows |
| Store | projects.json last_anchor; UserDefaults reportPrefs | the same fields and dictionary | follows |
| Vocabulary | element ids per lens, listed in one table on each side | ANCHOR_SELECTORS ↔ LensAnchor.action | follows |
| Content safety | clear on run completion | SessionsRouteMemory.clear() at run completion | follows |
| Precedence | a seed’s place still wins over the remembered one | placeArrival ordering in ContentView | follows |
| Strings | none | — | — |
| Signals / Discussion anchors | a place where the table said top | decision 16 Aug | departs: “a row is a stable structural position once ids are stable” — verify, else keep top |
Sources read: LensMemory.swift · LensAnchor.swift · useAnchorReporter.ts · nativePrefs.ts · BridgeHandler.swift (report-pref, anchor-change) · ContentView.swift (restoreAnchor, placeArrival) · WindowSeed.swift · ContextPlace.swift · SessionsRouteMemory.swift · tests/fixtures/report-prefs-contract.json · docs/design-workspace.md §P3a/P3b · 100days rows “Scene-level state restoration” and “A per-study, per-lens scroll position survives a relaunch”