Repository navigation
feat(chat): add option to open sidebar sessions in a session tab - #17544
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS The setting is opt-in, stored only in the browser and off by default, so it is easy to revert. Rendered evidence is attached, and the change takes nothing away. Notes
[DESIGN-REVIEWED] 5a32057 Description read[DESCRIPTION-READ] 28a800d6d94e82a2212c089714146bad99d540dbe052dc5e318bd366cf4cdd59 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, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (6 items) — 6 justifiedIntent: let someone who works in session tabs open a sidebar session in its own tab with one plain click, instead of losing the tab they are on. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 5a32057 Description read[DESCRIPTION-READ] e687868a6096fee4e846b41dfe857639c39830ed7b32052c830fcdc65c18cfeb That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The screenshots show the toggle off and on, its hint, and the three-tab result, and a recording is attached. Because this is a fork, no first-time reader has seen them; pushing the branch to this repository runs that blind read. [UX-REVIEWED] 5a32057 Description read[DESCRIPTION-READ] 6704a194b8caa57522ffef45ccaba09bbfd642b9186be4c4273af1478141f8c1 That sha256 names everything this verdict read: the PR description, plus the 10 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed Review detailsI checked both candidates against the code, and neither holds up, so this review passes.
No findings. [OPUS-REVIEWED] 5a32057 |
179c4d7 to
e001ad6
Compare
|
|
|
|
Re the First Principles note on
|
e001ad6 to
f8f3fb5
Compare
|
Rebased onto The three red checks on CI on the new head needs workflow approval again. |
|
self-added: no
|
|
self-added: no
|
4963427 to
320f990
Compare
320f990 to
911e797
Compare
A plain click on a sidebar session replaces the session in the active tab, so a user who keeps several sessions open as tabs loses one on every click. Add an opt-in Settings > Chat > Sessions toggle that opens the session in its own session tab instead, or switches to its tab when it has one. A tab opened right after a session switch now lands next to the active tab instead of at the end of the strip.
911e797 to
5a32057
Compare
|
HOLD at 5a32057. The change looks sound, and two review items are still open. This head is a rebase of the head our r114 read, and only regenerated docs rows changed. First Principles now has nothing to check, which clears that item. Every lane passes and CI is green. To clear the hold:
— crew-pr-reviewer (r119) |
buluoray
left a comment
There was a problem hiding this comment.
Approve at 5a32057.
The setting is opt-in and browser-local, and the click path does what the description says. selectFromSidebar and the flyout pick both gate ensureSlotTab on sidebarClickOpensTab (website/src/pages/ChatPage.tsx:917-926), a session that already has a tab is only selected (useChatPageSessionController.ts:222-223), and openInNewTab now captures besideKey at call time (useSessionTabs.ts:155), so the tab lands beside the one the user was on.
On the Design note about ownsSessionTabs: it does not hold. useSessionTabs receives enabled = !embedded (useChatPageSessionController.ts:177,182) and openInNewTab returns early when not enabled (useSessionTabs.ts:146), so embedded and popout hosts write nothing.
Checked locally: ChatPage.sessionTabs, ChatSettings, SettingsChatPanelCoverage (147 passed) and tsc -p tsconfig.app.json. Each guard was mutated one at a time and turned a named test red: the setting gate (both directions), the flyout call, the has-tab check, the besideKey capture, and the boolean repair in loadChatConfig. CI on this head: 88 success, 11 skipped.
Non-blocking follow-up: onSelectSlot also fires after Duplicate (useSessionActions.ts:257-258) and after a sidebar New chat (pages/chat-sidebar/create.ts:150,329,392). With the setting on, a duplicated session gets its own tab, and whether a new chat does depends on render timing. The description says New chat keeps today's behaviour, so a test pinning those paths (or a note that Duplicate now opens a tab) would make that explicit.
Problem / Motivation
Goal: Let a user choose that a plain click on a sidebar session opens it in its own tab, instead of replacing the session in the active tab.
A plain click on a sidebar session replaces the session in the active tab, as #4477 specified. A user who keeps several sessions open as tabs loses one of them on every click, and must find it in the sidebar again. Cmd/Ctrl-click, middle-click and the row menu's Open in a session tab keep the tab, but each costs an extra click or a modifier every time.
Why it matters
A user who works in tabs switches sessions all day, and the only one-click way to open a session consumes a tab they kept on purpose. The setting gives them the one-click open that tabbed editors offer (VS Code
workbench.editor.enablePreview: false). Nothing changes for anyone who leaves it off.Not a goal
What changed (motivation → approach → change)
website/src/pages/chat/ChatSettings.tsxChatConfig.sidebarClickOpensTab, default falsewebsite/src/pages/settings/ChatPanel.tsxwebsite/src/pages/ChatPage.tsx,website/src/pages/chat/useChatPageSessionController.tsensureSlotTabwebsite/src/hooks/useSessionTabs.tsopenInNewTabplaces the tab beside the active onewebsite/src/i18nlocalessrc/kiro_crew/docs/settings-registry.generated.json,website/src/components/commandPalette/settingsRegistry.gen.tsdocs/feature-map/README.mdThe setting is Settings > Chat > Sessions > Open Sidebar Sessions in a Session Tab. It is browser-local, like the toggles around it (
ChatConfig.sidebarClickOpensTab, default false). The label says "session tab", the row menu's own term, so it does not read as a browser tab. It uses Title Case, like the other rows in the card.The sidebar calls
onSelectSlotafter each plain activation of a row: a click, Enter/Space and a source chip. ChatPage's handler gives the session a tab when the setting is on (ensureSlotTabin the session controller), and so does a pick from the collapsed sidebar's recents flyout. The tab goes beside the active tab, where the row menu puts it. A session that already has a tab is only selected, with no outline cue: the switch is the response.ChatSidebar.tsxdoes not change.useSessionTabs.openInNewTabreads the active session when it is called, not inside its state updater. This caller dispatches the switch first, and an updater that runs after the next render sees the new session as active and puts the tab at the end of the strip.Backwards compatibility
Compatible: the setting defaults to off, and a stored config without the key loads as off, so every client keeps today's click behaviour.
Removes nothing: the change adds a setting and one branch behind it.
Tests
ChatPage.sessionTabs.test.tsx: setting off, a sidebar click still replaces the active tab's session. Setting on, in the sidebar's own order (switch, thenonSelectSlot): the session opens beside the active tab, the first click brings up the strip, a session that has a tab is only selected and gets no cue, and a pick from the collapsed sidebar's flyout opens a tab.ChatSettings.test.tsx: the setting defaults to off, keeps a storedtrueand repairs a non-boolean to off.SettingsChatPanelCoverage.test.tsx: the toggle stores the setting.The setting-on tests fail without the change. The no-cue test fails when
ensureSlotTabdrops its tab check.Manual verification
On an isolated gateway (
dev-backend.sh --seed rich, standalone profile, loopback), I clicked sidebar sessions with the setting off and on. Off: the strip stays hidden and the click replaces the session. On: the strip grows to two and then three tabs, and a click on a session that has a tab selects it. On the same gateway, I turned the toggle on in Settings and opened its hint.Screenshots / video
Settings > Chat > Sessions, off and on:
The hint behind the ⓘ icon:
Setting on: three sidebar clicks give three tabs, and a click on a session that has a tab selects it.
sidebar-click-opens-tab.webm
Frames
Related Issues
Fixes #17543
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement