Skip to content

Perch Hub: reachable from the dashboard, and back from the board - #351

Merged
kh0pper merged 1 commit into
mainfrom
feat/perch-nav
Sep 10, 2026
Merged

kh0pper merged 1 commit into
mainfrom
feat/perch-nav

Conversation

@kh0pper

@kh0pper kh0pper commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Perch Hub shipped in #350 as a page you could only reach by typing a URL. Operator feedback, verbatim:

"I do not see how a user would navigate to perch from the dashboard. I don't see a panel or a dashboard launcher icon. The panel should be in the agents section."
"On perch there is a link to the board, but on the bot board there is no link to perch."
"On the bot board, the Open/Talk buttons open a side panel to chat rather than directing you to the perch chat."

All three fixed here.

The phasing mistake this corrects

The original plan bundled the nav entry with the drawer deletion in "PR 2". Those are different risk classes: adding ways to reach the hub is additive and reversible; deleting the working drawer is neither. Shipping an unreachable page and then asking for it to be evaluated was not a usable increment.

So navigation lands now. The drawer is untouched — it simply stops being the destination — and its deletion stays gated on real use.

A registered panel, not a hard-coded link

The plan had ruled against a panel registration, on the grounds that nav-registry only routes to registered panels and that existing installs never receive new defaults. Both halves were wrong on closer reading:

  • dashboard/index.js's panel loader comments // Handler may have already sent response and only sends result when !res.headersSent. A panel handler can render its own document — so Perch keeps its standalone full-page layout (never layout()), which is the whole reason it works on a phone.
  • nav-registry auto-assigns panels missing from stored assignments via CATEGORY_TO_GROUP, and category: "ai" → the agents group. The migration objection applies to changing defaults, not to adding a new panel.

So routes/perch-hub.js is gone and panels/perch-hub.js replaces it (id: "perch", category: "ai", navOrder: 15.5). The /perch short link still redirects.

Verified against real code rather than assumed: built the actual dashboardRouter and ran real resolveNavGroups() against a real init-db.js database — Agents group resolves to [bot-builder, bot-board, perch, model-catalog, skills]. CDP-live confirms /dashboard/perch renders with no .sidebar (still a standalone document) while the board's sidebar shows the Perch entry.

Board → Perch, both directions

  • An i18n'd "Open Perch chat" link beside the bot switcher (botboard.perchLink, en/es).
  • All six openBirdDrawer(...) call sites now navigate through one goToPerch(sid) helper: the bird-glyph click, the #bird=<sid> deep link, open, answer, sessions, and talk's spawn-success branch. Dispatch navigates to the new session instead of reloading, and botboard.roostDispatchSent is retranslated since there is no longer a reload.
  • drawer.js is deliberately not deleted or modified.

Tests

98/98 across perch-hub-page, perch-hub-client, perch-hub-render, roost-strip-ui, roost-strip-data, board-i18n-literals, i18n-global-parity, a11y-baseline. A collateral sweep of 46 files touching bot-board / dashboard index / nav-registry / panel-registry / i18n: 642/642.

16 mutations, each independently verified to turn its guarding assertion red and then restored — the wiring lines, every manifest field, the board link, i18n parity, and all six navigation call sites. Following this branch's standing rule: an assertion that cannot fail is not a test.

Known, non-blocking

icon: "messages" reuses the Messages glyph. NAV_ICONS has no dedicated chat icon, and several existing panels already reference keys absent from it and silently fall back (bot-board's "project", fediverse's "globe", memory's "memory"). Pre-existing; worth its own sweep.

Three navigation gaps reported after Perch Hub shipped:

- Perch had no nav entry or launcher icon. Converted it from a bare route
  mounted onto /dashboard (routes/perch-hub.js) into a registered panel
  (panels/perch-hub.js, category "ai") so nav-registry auto-assigns it into
  the Agents group on every install, no migration needed. The panel handler
  still renders perchHubDocument directly and never calls layout() — the
  standalone document is what keeps the chat surface usable on a phone.
  routes/perch-hub.js is deleted; the /perch short link stays, now pointing
  at the one remaining handler.

- The bot board had no link back to Perch (Perch already links to the
  board). Added one next to the bot switcher, i18n'd in en/es.

- The board's session actions (card-face bird glyph, #bird=<sid> deep link,
  Open/Answer/Sessions/Talk, and a successful roost dispatch) all opened the
  in-page bird drawer instead of the chat surface. They now navigate to
  /dashboard/perch#<sid> (bare /dashboard/perch for action=sessions, which
  has no specific session) via one goToPerch() helper. drawer.js and its
  markup are untouched — removed in a later, separately-gated change.
  Retranslated botboard.roostDispatchSent ("Sent — reloading…" is stale;
  there's no more reload).

Tests: rewrote the two perch-hub-page.test.js assertions that pinned the old
router mount to pin the new panel registration instead (mutation-tested:
each wiring line independently turns the guard red). Added a manifest-shape
test and a request-level handler test. Added tests/bot-board-perch-link.test.js
for the new board link. Rewrote roost-strip-ui.test.js's dispatch-success
test for the new navigate-not-reload behavior and added three tests covering
the other four converted call sites — every new assertion mutation-tested
red/green.
@kh0pper
kh0pper merged commit cecee00 into main Sep 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant