Skip to content

fix(chat): keep an Ultra Mode chat's Board in front unless the person picks a tab - #26933

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/ultra-board-always-front
Nov 1, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/ultra-board-always-front

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

  • No change to normal (non-Ultra) chats: a found PR or issue link still brings its tab to the front there.
  • No change to which tab a person can open, or to the Board itself.
  • No change to the existing "entering an Ultra Mode root opens the panel on the Board" behaviour (crewModeSwitch.ts), which moves focus TO the Board.

What changed (motivation → approach → change)

Archaeology (origin/main 5a03953):

Paths that moved an Ultra Mode chat off the Board without a click (all on main):

Path Where
PR link found (history load or live) useChatPageResourcesController.tsx openView('changes', { automatic: true })
Issue link found same effect, openView('issues', { automatic: true })
Pin Summary landing usePinnedViews.ts openView('summary', { automatic: true })
MCP app render auto-open ChatPage.tsx openApp(...)
Git tab auto-open paneLayout.tsx openView('git', ...)

Change:

  • usePanelTabs(slot, descriptors, { boardFirst }): with boardFirst, an automatic openView adds or updates its tab and keeps activeId as it was. openApp takes { automatic } and does the same (and then it is not counted as a tab choice).
  • ChatPage works out boardFirst with 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 to useChatPageResourcesController, which hands it to usePanelTabs. 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 when tabsCtl.boardFirst.
  • The fix(chat): keep the Board tab in front after opening a worker from it #26833 hold path is untouched and still works for normal chats opened from the Board.

Shared file note: usePanelTabs.ts is 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 boardFirst option and openApp's new opts are 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:

Case Test
Fresh Ultra Mode chat + PR link a fresh Ultra Mode chat opens on the Board and a PR link found stays behind it
Existing chat, PR + issue links in history PR and issue links in loaded history add their tabs without taking the focus
Pin Summary, app render, Git Pin Summary landing, an app render and the Git tab do not take the focus either
Click Changes / Files, then new PR a tab the person clicks stays in front when a new PR link arrives
Click back to Board clicking back to the Board keeps it there against later discovery
Session switch / remount the Board survives leaving the chat and coming back (session switch, remount)
Explicit opens still work a person still opens any tab directly
Normal chat unchanged a found PR or issue link and an app render still come to the front
Ultra ↔ normal switching switching from an Ultra Mode chat to a normal one keeps each chat on its own rule

Red without the fix: with usePanelTabs.ts reverted 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 to ChatPage: those files plus useChatPageResourcesController.capture.test.tsx, chatPageResources.errorNotices.test.tsx and handleOpenCrewTab.test.tsx (which mount the controller without a store) all pass. tsc -p tsconfig.app.json --noEmit and eslint on the touched files clean.

Manual verification

Real built SPA (vite build) with stubbed /api/** (Playwright route interception, as in scripts/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.

Chat main this branch
Ultra Mode Changes Board
Plain Changes Changes

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.

Before: Ultra Mode chat lands on Changes

After (this branch): the Ultra Mode chat stays on Board; Changes is still in the strip.

After: Ultra Mode chat stays on Board

After (this branch), plain chat: unchanged, Changes in front.

After: plain chat still opens Changes

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 1, 2026 05:42
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of fe201d7b725a2d9e8b4338c2e919922a78855ab7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns: the opt-in boardFirst flag goes on the strip's single automatic-open path, so every discovery source is covered in one place.

Notes

  • boardFirst comes from the slot row in st.dashboard.slots. If a PR link is found in history before that row loads, the selector returns false and Changes still takes the focus. A test that mounts history ahead of the slot row would cover this race.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of fe201d7b725a2d9e8b4338c2e919922a78855ab7 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The accepted rfc-crew-panel-default-tab ("No tab picked → Crew") covers the shape this enforces against automatic opens. The only gap is a second copy of the side panel's Ultra Mode check.

Notes

  • Item 6 — duplicate of website/src/pages/chat/SidePanel.tsx:321: ChatPage.tsx:405 re-spells return crewModeRoot(row) || !!crewRootOf(row) gated by useCrewMode(). That makes 2 sites of one Ultra Mode test (grepped crewModeRoot(row) || !!crewRootOf(row)). Subtraction: keep one selector and import it at both sites, deleting the inline copy in ChatPage.
  • Item 4 — inherited: an MCP app render no longer comes to the front in Ultra Mode. The RFC decides the default tab ("Crew while nobody has picked a tab"), not whether a live app render may take focus, and no report says an app render was stealing focus. Subtraction: drop { automatic: true } from ChatPage's openApp call and the keepFocus branch in openApp, and keep the fix to PR/issue/Summary/Git discovery.

What this change ships

Inventory (7 items) — 5 justified

Intent: in an Ultra Mode chat, keep the Board in front until the person clicks another tab. This is a FIX.

  1. A PR link found in history or arriving live no longer moves an Ultra Mode chat off the Board — justified
  2. An issue link found no longer takes the focus in Ultra Mode — justified
  3. Pin Summary's landing no longer takes the focus in Ultra Mode — justified
  4. An MCP app render no longer comes to the front in Ultra Mode — inherited
  5. Auto-opening the Git tab no longer takes the focus in Ultra Mode, even with Auto-Open Git on — justified
  6. ChatPage works out whether the chat is Ultra Mode — duplicate of SidePanel.tsx:321
  7. boardFirst option on the tab hook, openApp's automatic option, and tabsCtl.boardFirst exposed; each has one consumer — justified

[FIRST-PRINCIPLES-REVIEWED] fe201d7

Description read

[DESCRIPTION-READ] 293645b572c1e5830ace9ff43db122477721a4a59921fee7d802f1d8087a6bc6

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of fe201d7b725a2d9e8b4338c2e919922a78855ab7 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • In an Ultra Mode chat, a Changes or Issues tab that a PR or issue link opens now lands behind the Board without any signal. Consider a brief unread dot on the new tab in usePanelTabs openView when automatic && boardFirst, so the person knows something arrived.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed fe201d7b725a2d9e8b4338c2e919922a78855ab7 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] fe201d7

Verdict parsed from the review's SHA-scoped output markers for commit fe201d7b725a2d9e8b4338c2e919922a78855ab7.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fe201d7b725a2d9e8b4338c2e919922a78855ab7 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of fe201d7b725a2d9e8b4338c2e919922a78855ab7 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] fe201d7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fe201d7b725a2d9e8b4338c2e919922a78855ab7 false-positive: <reason, 20 to 500 characters>

… 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>
@iamwhatever
iamwhatever force-pushed the fix/ultra-board-always-front branch from 422cc86 to fe201d7 Compare November 1, 2026 06:18
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 1, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved on behalf of the watch holder (bolichen). Lanes pass on fe201d7, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 24a454f into main Nov 1, 2026
97 of 105 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/ultra-board-always-front branch November 1, 2026 07:28
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 1, 2026
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.

2 participants