Repository navigation
feat(workspace): organise the shell around Library → Reading/Chat → Notes - #127
Merged
Merged
Conversation
…otes (#65) Make the existing provenance capabilities reachable as one workflow instead of a set of parallel entries. No new features, no geometry change, no rebrand. - Library → Reader: a source row opens the in-app reader for every format (PDF via PdfSourceReader, everything else via the text fallback) instead of handing PDFs to the OS. "Open in system application" becomes an explicit reader-header action. Source rows are real buttons (Tab + Enter). - Keyboard return: the element that opened the reader is remembered and focus returns to it on Back/Escape; Library-opened readers return to the list; a reader with no origin falls back to the chat composer (FOCUS_CHAT_EVENT). - Zone shortcuts: Cmd/Ctrl+[ and ] now "go to" Library / Notes — revealing a collapsed zone and moving focus into it. Persisted action IDs are unchanged; collapse stays on the panel-header buttons. - Current citation: CitationChip derives its selected state from uiStore.focusedSource via sourceAnchorsEqual; no new selection store. - IA: DESIGN.md gains the normative Information architecture section (three zones, the loop, per-zone states, keyboard path), the stale `selectedDocument ?? focusedDocument` snippet is fixed, and mind map / quiz / Anki are recorded as secondary utilities outside the loop. - Naming: zone labels move to Library / Notes in en-US and zh-CN. - docs/ia-audit.md records the pre-change audit as evidence; DESIGN.md is the contract. Verified: typecheck, 266 tests (4 new for the focus handoff), check:design, eslint clean on changed files, electron-vite build.
…logic DESIGN.md now states the zone behaviour normatively — `Cmd/Ctrl+[` and `]` "go to" a zone: reveal it if collapsed, then move focus into it — but the logic existed only inline in `ResizableLayout`, where the only thing that could check it was pressing the keys. That is the same situation `panelGeometry.ts` was created to fix for the resize arithmetic. `planZoneEntry(collapsed, rememberedWidth, fallbackWidth)` is the decision, in that module and tested beside the other layout arithmetic: - entering a zone leaves its width alone when it is already open, because entering is not resizing; - a collapsed zone comes back at the size it had, falling back to the default when nothing was remembered (0 is what a collapsed panel holds); - `collapsed: false` is a literal type, so "enter is not toggle" cannot be broken by returning a computed value. The shortcut shares its persisted action ID with a panel toggle, which is exactly why that needs to be structural rather than a convention: a second press must not hide the zone the user just asked for. No behaviour change — `ResizableLayout` now calls the function it used to inline. Four tests added to the existing panelGeometry suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #65.
Makes the provenance capabilities already built in v1.4 reachable as one workflow instead of a set of parallel entries. No new features, no geometry change, no rebrand — the audit found the components were largely already there and the entry points were wrong.
The audit first
docs/ia-audit.mdrecords the pre-change state as evidence: the shell map, where each capability is entered today, a cross-check against #65's own acceptance, and findings A (component exists, entry/hierarchy wrong) / B (shell capability genuinely missing). The verdict was Option 1 — contained: keep the three cards, Reading/Chat spans the left reader plus the centre transcript, Notes stays right.Then
DESIGN.mdgains the normative IA section: the three zones, the loop, per-zone states, and the keyboard path. DESIGN.md is the contract; the audit is the record of what it was before.What landed
SourcePanel,DocumentList,reader/*— a source row opens the in-app reader for every format instead of handing PDFs to the OS; "open in system application" becomes a reader-header action, and rows are real buttons (Tab + Enter)hooks/sourceFocusReturn.ts— the element that opened the reader is remembered and refocused on Back/Escape; a reader with no origin falls back to the composer viaFOCUS_CHAT_EVENTCitationChipselected / current sourceuiStore.focusedSourceviasourceAnchorsEqual— no second selection store, andaria-currenton the chip the reader is showingen-USandzh-CN(ui.json,notebook.json,shortcuts.json)ResizableLayout—Cmd/Ctrl+[/]enter a zone: reveal if collapsed, then move focus into it. Persisted action IDs unchanged (toggle_knowledge_base/toggle_creative_space), and the centre stays onFOCUS_CHAT_EVENTtest/sourceFocusReturn.test.ts(handoff),test/panelGeometry.test.ts(zone entry)Zone entry became a tested rule
DESIGN.md states the shortcut behaviour normatively, but it previously existed only inline in
ResizableLayout, where the only thing that could check it was pressing the keys — the same situationpanelGeometry.tswas created to fix for the resize arithmetic.planZoneEntry(collapsed, rememberedWidth, fallbackWidth)now holds the decision, tested beside that arithmetic:0is what a collapsed panel holds);collapsed: falseis a literal type, so "enter is not toggle" cannot be broken by returning a computed value. The shortcut shares its persisted action ID with a panel toggle, which is exactly why that needs to be structural rather than a convention: a second press must not hide the zone the user just asked to enter.No behaviour change —
ResizableLayoutcalls the function it used to inline.One note on the audit's non-goals. They say "no change to
panelGeometry.ts". This PR adds to it. The diff is purely additive — no removed lines, no geometry constant and no formula touched — because zone entry is resize intent, which is what that module is for. Flagging it rather than letting it pass silently.Explicitly not done
Readingcentre panel was added.check:designguards it).Verification
npm run typecheck(all three projects)npm test— 270 pass / 0 failnpm run check:design,npm run lint(0 errors on changed files),npx prettier --checknpm run build(electron-vite)Not verified — and this is deliberate
The GUI has not been verified by hand. Real focus order, real themes and real rendering are not covered by these tests, and this PR does not claim otherwise.
That gate is #125, which now carries both manual passes: the PDF reader round trip, and an IA smoke in Light and Dark covering Library → Reader → citation/current-source state → reader return focus → Library/Notes zone navigation — explicitly including that pressing a zone shortcut twice leaves the zone open, and that focus rings are visible in both themes on source rows, chips, zone wrappers and drag handles. #65 ships on its tests; #125 is where a human confirms the loop.