Repository navigation
fix(chat): keep an Ultra Mode chat's Board in front unless the person picks a tab - #26933
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the opt-in Notes
[DESIGN-REVIEWED] fe201d7 Description read[DESCRIPTION-READ] baad433f492b90a172b09c56a57573aaec02cfd1828763c55a6a78e7a21cc362 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The accepted Notes
What this change shipsInventory (7 items) — 5 justifiedIntent: in an Ultra Mode chat, keep the Board in front until the person clicks another tab. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] fe201d7 Description read[DESCRIPTION-READ] 293645b572c1e5830ace9ff43db122477721a4a59921fee7d802f1d8087a6bc6 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: no control is added, and the supplied screenshots show the before state, the after state and the unchanged plain chat. Notes
[UX-REVIEWED] fe201d7 Description read[DESCRIPTION-READ] 2360bc65624eafd5d8824c511d8cdd8699471d794bae90c51d2a8534b1c17b75 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
… picks a tab In an Ultra Mode chat (a crew root or one of its workers) the side panel could leave the Board on its own: a PR or issue link found in history or arriving live opened Changes or Issues in front, Pin Summary's landing moved to Summary, an MCP app render opened its tab in front, and the Git tab could take the focus. usePanelTabs takes a boardFirst option. With it, an automatic open adds or updates its tab and keeps the focus where it is: the Board, or the tab the person last clicked. The chat page sets it from the same Ultra Mode test the side panel uses to pin the Board first. The MCP app auto-open and the Git auto-open now go through the automatic path in such a chat. Normal chats are unchanged. Co-authored-by: Joe Guo <zejiangg@amazon.com>
422cc86 to
fe201d7
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Lanes pass on fe201d7, no conflict, no open change request.
Problem / Motivation
Goal: In an Ultra Mode chat, the side panel shows the Board and keeps it in front. Only a tab the person clicks moves it, and that tab then stays in front until the next click.
Today an Ultra Mode chat leaves the Board on its own. A PR link in the conductor's history (or a new one arriving live) opens Changes in front, so the person lands on Changes instead of the Board. #26833 fixed this for one path only: opening a worker from the Board.
Why it matters
The Board is the conductor's home: its status, its workers, and the way back from a worker. Every Ultra Mode chat that mentions a PR or issue (most of them) lands off it today.
Not a goal
crewModeSwitch.ts), which moves focus TO the Board.What changed (motivation → approach → change)
Archaeology (origin/main 5a03953):
openPanelView(..., { hold: true })and uses it only fromopenCrewSession.offerPanelViewput the Board in front of an Ultra Mode strip while nobody had picked a tab. Discovery opens still moved the focus right after.Paths that moved an Ultra Mode chat off the Board without a click (all on main):
useChatPageResourcesController.tsxopenView('changes', { automatic: true })openView('issues', { automatic: true })usePinnedViews.tsopenView('summary', { automatic: true })ChatPage.tsxopenApp(...)paneLayout.tsxopenView('git', ...)Change:
usePanelTabs(slot, descriptors, { boardFirst }): withboardFirst, anautomaticopenViewadds or updates its tab and keepsactiveIdas it was.openApptakes{ automatic }and does the same (and then it is not counted as a tab choice).ChatPageworks outboardFirstwith the same Ultra Mode test the side panel uses to pin the Board first (crewModeRoot(row) || crewRootOf(row), with the Crew Mode preview on) and passes it touseChatPageResourcesController, which hands it tousePanelTabs. The controller takes it as an optional option, so it still needs no store of its own.ChatPage's app auto-open passes{ automatic: true }.paneLayout's Git open is automatic whentabsCtl.boardFirst.Shared file note:
usePanelTabs.tsis used by every panel host. The new option is opt-in; only the chat page passes it, so the Members page and normal chats keep their behaviour.Backwards compatibility
Compatible: the new
boardFirstoption andopenApp's newoptsare optional; every existing caller keeps its behaviour.Removes nothing: no tab, record, key or function is removed. A stored focus is never rewritten.
Known limit: an existing Ultra Mode chat whose stored focus was already moved to Changes by the old behaviour keeps Changes (the store cannot tell that apart from a click). One click on Board fixes it for good.
Tests
New file
website/src/test/usePanelTabs.ultraBoardFirst.test.ts:a fresh Ultra Mode chat opens on the Board and a PR link found stays behind itPR and issue links in loaded history add their tabs without taking the focusPin Summary landing, an app render and the Git tab do not take the focus eithera tab the person clicks stays in front when a new PR link arrivesclicking back to the Board keeps it there against later discoverythe Board survives leaving the chat and coming back (session switch, remount)a person still opens any tab directlya found PR or issue link and an app render still come to the frontswitching from an Ultra Mode chat to a normal one keeps each chat on its own ruleRed without the fix: with
usePanelTabs.tsreverted to main, 7 of the 9 fail; the two normal/explicit cases pass both ways.Proof: not provable -- frontend test (prove.py runs Python only)
Local run:
vitest run src/test/usePanelTabs.ultraBoardFirst.test.ts src/test/usePanelTabs.test.ts src/test/sidePanelCrewDefaultTab.test.tsx src/test/sidePanelPinSummary.test.tsx src/test/ChatPage.panelTabFocus.test.tsx src/test/mcpAppPanelTab.test.ts src/pages/chat/command-center/CrewWorkerList.test.tsx→ 171 passed. After moving the lookup toChatPage: those files plususeChatPageResourcesController.capture.test.tsx,chatPageResources.errorNotices.test.tsxandhandleOpenCrewTab.test.tsx(which mount the controller without a store) all pass.tsc -p tsconfig.app.json --noEmitandeslinton the touched files clean.Manual verification
Real built SPA (
vite build) with stubbed/api/**(Playwright route interception, as inscripts/capture-crew-mode-7.mjs). An Ultra Mode conductor chat and a plain chat, each with a GitHub PR link in history. Open the panel, wait, read the selected tab.Sibling sweep
Sibling: website/src/pages/chat/useChatPageResourcesController.tsx:450 -- changed here
Sibling: website/src/pages/chat/usePinnedViews.ts:61 -- not affected -- its Summary landing already calls the automatic openView this PR changes, so it needs no edit
Sibling: website/src/pages/ChatPage.tsx:161 -- changed here
Sibling: website/src/pages/chat/page/paneLayout.tsx:120 -- changed here
Sibling: website/src/pages/chat/page/panelTabs.ts:109 -- not affected -- a click on a chat bubble's panel control, a person's choice
Sibling: website/src/pages/chat/page/sessionsDrawer.ts:605 -- not affected -- a click on a session row chip
Sibling: website/src/pages/chat/page/transcriptPins.ts:313 -- not affected -- follows the person pinning a message
Sibling: website/src/pages/members/MembersPageSidePanel.tsx:138 -- not affected -- not a chat strip; passes no boardFirst
Pattern harvest
Not generalizable: the rule is one product decision (Ultra Mode's Board is sticky) held in one place, the strip model's automatic-open path.
Screenshots / video
Before (main): the Ultra Mode chat opens on Changes.
After (this branch): the Ultra Mode chat stays on Board; Changes is still in the strip.
After (this branch), plain chat: unchanged, Changes in front.