feat(desktop): list a workspace's pages in the sidebar strip, with New page
Merged
KI
2mo ago+1141+1141+0123456789012345678901234567890123456789-86-86-01234567890123456789
Links
- Design page (live mock, Codex comparison, placement variants): https://app.superset.sh/page/workspace-pages-dropdown-hpqp66
Summary
- The strip above Files / Changes / Review now has a pages menu next to Run: pages published from this workspace, your pinned pages, and "All pages".
- "New page" in the menu takes a one-line request and hands it to an agent, using the same agent picker as design mode and diff comments.
- When a publish lands, the button turns blue with "New" and the row is marked, until the menu is closed.
Screenshots
Captured over CDP from this branch's dev app (dark theme). Page titles are demo names set in the worktree's own dev database for the capture.
| Populated: workspace pages, then pinned | Fresh publish: blue "New" button, row marked |
|---|---|
![]() | ![]() |
| New page composer with the agent picker | No pages in this workspace yet |
|---|---|
![]() | ![]() |
Why / Context
A page an agent publishes from a workspace was only reachable by leaving for the org-wide Pages view. The sidebar's top strip had been empty since the PR badge and Open-in moved out (#7167), so it had room. Gated on the existing PAGES flag.
How It Works
WorkspacePagesMenu(Popover) is rendered by the workspace page and passed intoPRActionHeaderbesiderunButton, the same way the Run button is.- Workspace pages come from the existing
page.list({ workspaceId }). Pinned pages come frompage.list({})filtered byusePageFavorites, fetched only while the menu is open. No API or schema change. selectMenuPagessorts by latest publish, drops pinned pages already listed under the workspace, and flags pages published after the last-seen time.- Last-seen is a session-only zustand store keyed by workspace. It records the newest publish the menu has displayed, not the wall clock, so a slow refetch cannot clear a badge for a page that was never shown. Nothing is persisted.
- The list refetches on open and on the workspace's
page-watch:changedevent. useAgentSessionLauncheris extracted fromusePaneRegistryunchanged, so the sidebar can start agent sessions.buildPageAgentPrompt(request?)replacesPAGE_AGENT_PROMPT; with no request it returns the same text (checked byte for byte).usePageFavoritesmoves to_dashboard/hooks/now that two routes use it.
Manual QA Checklist
Driven over CDP with real input against this worktree's dev app, console.error hooked and empty throughout. Run twice: once before committing and again on the committed build for the screenshots above.
- No pages: bare icon, menu shows New page and All pages
- With pages: count on the button, newest first, relative times
- Clicking a row opens the page in a pane in this workspace and closes the menu
- New page: composer opens with the default request focused and selected, agent picker populated, send enabled
- Escape in the composer steps back to the list; Escape again closes; outside click closes
- Fresh publish: button turns blue with "New", row marked, both clear after closing, stay clear on reopen
- Pinned section appears after pinning a page in the Pages view; private page shows the lock
- Sending the New page request to an agent (not submitted, it spawns a real agent)
-
page-watch:changedfiring on a real publish (the publish was simulated by bumping a version timestamp in the dev DB branch) - Light theme and Windows/Linux window-controls inset
Testing
bun run typecheck(desktop): 0 errorsbunx biome checkon the touched tree: cleanbun testforselectMenuPagesandbuildPageAgentPrompt: 7 passbun run check:i18n: passes; 7 new strings translated in all 16 locales
Design Decisions
- Popover, not DropdownMenu: the composer has a textarea and a select, and menu typeahead would eat keystrokes.
- Escape handled in
onEscapeKeyDown: Radix dismisses at the document level, so a Reactkeydownhandler withstopPropagationruns too late. - Reuse the agent picker rather than always starting a new session, so there is one way to hand a prompt to an agent across the app.
Known Limitations
- Placement is still under discussion on the design page (strip icon vs a fourth tab vs a labeled button vs a footer bar). The list, composer, pinned and fresh-publish pieces are placement-independent, so moving them is a change of mount point.
page.listmints a ticket per row and took about 5s against the dev API, so the count can lag a publish by that much.NewPageComposerimportsAgentPickerSelectfrom underusePaneRegistry/components/, asPullRequestCommentComposeralready does. Promoting that folder is left for a separate move-only PR.



