Skip to content

feat(workspace): organise the shell around Library → Reading/Chat → Notes - #127

Merged
mrsibe merged 2 commits into
mainfrom
feat/65-workspace-shell-ia
Sep 25, 2026
Merged

mrsibe merged 2 commits into
mainfrom
feat/65-workspace-shell-ia

Conversation

@mrsibe

@mrsibe mrsibe commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

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.md records 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.md gains 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

Item Where
Library → Reader 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)
Focus-return handoff 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 via FOCUS_CHAT_EVENT
CitationChip selected / current source derives from uiStore.focusedSource via sourceAnchorsEqual — no second selection store, and aria-current on the chip the reader is showing
Zone labels / i18n Library / Notes in en-US and zh-CN (ui.json, notebook.json, shortcuts.json)
Zone keyboard navigation 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 on FOCUS_CHAT_EVENT
Tests test/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 situation panelGeometry.ts was created to fix for the resize arithmetic.

planZoneEntry(collapsed, rememberedWidth, fallbackWidth) now holds the decision, tested beside that arithmetic:

  • entering an open zone leaves its width alone — 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 to enter.

No behaviour change — ResizableLayout calls 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

  • A3 (demote mind map / quiz / Anki out of the Notes header) — deferred.
  • A4 / conversation history — a feature, not IA, and deliberately not folded in.
  • Three-column geometry — unchanged; no Reading centre panel was added.
  • No promotion of mind map / quiz / Anki, no rebrand, no new palette (check:design guards it).

Verification

  • npm run typecheck (all three projects)
  • npm test — 270 pass / 0 fail
  • npm run check:design, npm run lint (0 errors on changed files), npx prettier --check
  • npm 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.

…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.
@github-actions github-actions Bot added the enhancement New feature or request label Sep 25, 2026
…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.
@mrsibe mrsibe changed the title feat(workspace): organise the shell around Library → Reading/Chat → Notes (#65) feat(workspace): organise the shell around Library → Reading/Chat → Notes Sep 25, 2026
@mrsibe
mrsibe merged commit 2824758 into main Sep 25, 2026
4 checks passed
@mrsibe
mrsibe deleted the feat/65-workspace-shell-ia branch September 25, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Workspace shell & IA: Library → Reading/Chat → Notes as one workflow

1 participant