Repository navigation
Viewer: pin the projections list as a pane - #77
agorischek wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved keyboard and focus issues leave the switcher targeting a removed option after resizing, focus an off-screen projection when pinning, and cause the fallback dropdown to reopen unexpectedly on later resizes.
3 open issues
What changed in this PR
Adds a pinnable projections list to the CLI viewer and Copilot canvas, building on the toolbar layout work. The dropdown remains the default, with a persistent pane available when space allows.
Changes:
- Adds a 240px pane with projection status, selection, and keyboard focus handling.
- Persists pinning across reloads and falls back to the dropdown on narrow screens.
- Exports reusable host-core components and hooks, with documentation and browser coverage.
| File | Description |
|---|---|
packages/host/inspector/src/viewer/title.tsx |
Adds pin action and focus restoration support. |
packages/host/inspector/src/viewer/pane.tsx |
Implements viewer pane, persistence, and visibility. |
packages/host/inspector/src/viewer/mount.tsx |
Mounts the pane beside the viewer. |
packages/host/inspector/src/viewer/chrome.tsx |
Connects pinned state to title menu behavior. |
packages/host/inspector/src/shell/switcher.tsx |
Adds the keyboard-accessible pin option. |
packages/host/inspector/src/mount.tsx |
Passes the aside option into the Inspector. |
packages/host/inspector/src/app/workbench.tsx |
Places the aside beside the viewer body. |
packages/host/inspector/src/app/props.ts |
Defines the viewer aside property. |
packages/host/inspector/src/app/inspector-app.tsx |
Forwards the aside to the page frame. |
packages/host/core/src/ui/projections-pane.tsx |
Adds reusable pane UI, sizing, and persistence hooks. |
packages/host/core/src/ui/index.ts |
Exports the pane API. |
packages/cli/browser/viewer.spec.ts |
Covers pinning, selection, persistence, fallback, and closing. |
docs/guides/host-core.md |
Documents the pane API and clarifies loading-status behavior. |
Review effort: Balanced
e778615 to
2ce5cc9
Compare
21c12e1 to
992d59a
Compare
2ce5cc9 to
ea70465
Compare
ea70465 to
cd7afb1
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
3 resolved since last review
Review effort: Lite
0835415 to
64ff64c
Compare
cd7afb1 to
b4fd44b
Compare
b4fd44b to
f421474
Compare
64ff64c to
022db34
Compare
f421474 to
8299d6a
Compare
022db34 to
f83565a
Compare
8299d6a to
a328ed3
Compare
a02f29c to
1bc3742
Compare
a328ed3 to
d68dafe
Compare
b1d2c11 to
ab04f5c
Compare
1453b2e to
0592b85
Compare
ab04f5c to
9002427
Compare
0592b85 to
65f514a
Compare
9002427 to
254aef7
Compare
65f514a to
92da228
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Focus handoff transitions remain scattered across writable state and component effects, leaving ordering implicit and requiring a centralized machine with an explore test covering pin, close, resize, and disconnect sequences.
1 open issue
2 resolved since last review
Review effort: Balanced
254aef7 to
8584252
Compare
92da228 to
eb11ff4
Compare
The title's projection menu ends with "Pin projections pane", after a separator and reached by the arrow keys. Pinned, the list is a 240px pane at the page's start, beside the toolbar and stage: a "Projections" navigation landmark whose header (the toolbar's row) has a close button back to the menu, and each projection with its ID and status, the shown one `aria-current="page"` and scrolled into view. Focus moves to it when the person pins it and back to the menu when they close it. The title is the title alone while it's pinned. It is remembered across reloads (`projections:pane-pinned:viewer`) and offered only with more than one projection and 900px of room; narrower, the page falls back to the menu. The host core exports it for other surfaces: `ProjectionsPane`, `usePinnedPane`, `usePaneRoom`, `paneWidth`, `paneHeaderHeight` and `paneMinWidth`. The Inspector takes an `aside` beside a viewer page's body. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The title closes its menu in an effect when the menu goes away; the header measures the pane's room once; the spec's widths tolerate fractional layout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…the menu Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…pane The title's menu says when it goes away holding focus, and the pane that replaces it takes focus; ProjectionsPane focuses whenever autoFocus turns on. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
usePinnedPane, usePaneRoom and paneMinWidth move to the package root so a custom UI can reuse them; ProjectionsPane and its sizes stay in /ui. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…s store Replaces the boolean refs, which the lifecycle check flags, with the store's focusWithin. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…us only to a menu that's there Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
paneFocusMachine owns where focus is and where it goes next (pinning, closing, the page narrowing or widening, the server stopping); the pane and the title's menu report focus and take it when the state asks. Explored in its test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
8584252 to
05a5719
Compare
eb11ff4 to
a998650
Compare



Stacked on #65 (
toolbar-sides). The user asked to turn the projections list into a pinnable pane: the dropdown stays the default, and "Pin projections pane" at the end of the menu turns the list into a durable left pane, with an X that returns to the dropdown.Viewer (CLI viewer and Copilot canvas)
PanelLeft), after a separator. It's the last option the arrow keys reach.navlandmark named "Projections"; the shown projection hasaria-current="page". Focus moves to it when pinned, and back to the title's menu when closed.localStorageprojections:pane-pinned:viewer. After a reload it's still pinned and doesn't take focus.Host core API (for other surfaces; the shadcn hosted rebuild and host-primer use the same names):
ProjectionsPane({items, current, onChoose?, onClose, label?, autoFocus?, footer?}), with items{id, title, detail?, status?}usePinnedPane(key)usePaneRoom(element?)paneWidth(240),paneHeaderHeight(41),paneMinWidth(900)The Inspector takes an
asidebeside a viewer page's body. The guide (docs/guides/host-core.md) documents it.Not here:
NavList.Tests:
packages/cli/browser/viewer.spec.tshas a new test, run by CI. It covers:The title test now expects the pin option after the two projections. I checked the same flow by hand against a running viewer, in light and dark.
The screenshots predate #65's floating foot (the legend and summary show as bands here).