Repository navigation
fix(sidebar): leave Split View when Fork chat opens the fork - #21971
Conversation
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the embedded sidebar's [DESIGN-REVIEWED] 70a6b00 Description read[DESCRIPTION-READ] 31ac38a918ef19977a4dc0b36c4506d511979c4f8e7201a7a20b945a193aa0ed 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 |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Check by hand: Fork chat in Split View should leave the split and show the fork, the same way a row click does. The PR attaches no screenshot or recording of it. [UX-REVIEWED] 70a6b00 Description read[DESCRIPTION-READ] 84f4a149f59099e5911b980118954261a1c2a9dab7c9ff062e8eab2c82b0623f That sha256 names everything this verdict read: the PR description, plus the 3 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 Check that Fork chat in the embedded Sessions frame ( Not justified as shipped
What this change shipsInventory (3 items) — 2 justifiedIntent: a fork made from the sidebar shows up on screen even when Split View is on. FIX.
[FIRST-PRINCIPLES-REVIEWED] 70a6b00 Description read[DESCRIPTION-READ] 9c2872178750607abc304a2f51dd86a521275719d5ddc52359fcddf214e31c29 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
|
|
|
|
|
iamwhatever
left a comment
There was a problem hiding this comment.
Changes requested. Reviewed head c480e6f.
The fix itself is sound. reportOpenedCreate reports only while the new slot is still active, which matches createSlot's switched-away guard, and the tests cover the plain, background-tab and switched-away cases.
Blocking items:
- The Duplicate sibling (useSessionActions.ts:240) and the collapsed-folder-only cause are both deferred "on #21935", but this PR says
Closes #21935, so merging closes their only tracker. Please open one issue for each and link them in the description. - The collapsed sidebar's recents flyout New (paneLayout.tsx:200-207) still creates under the old split, while its sibling
flyoutSwitchleaves it. Fix it here with the same active-slot check, or name it and track it in an issue.
Note: #21959 fixes the same issue, and #21935 is assigned to that PR's author. A maintainer has to choose one PR.
— crew-pr-reviewer (r111)
c480e6f to
21c63ae
Compare
|
Thanks for the review of c480e6f. New head 21c63ae answers both blocking items. issue (blocking): Duplicate and the collapsed-folder cause lost their tracker Fixed. Duplicate is no longer deferred. issue (blocking): the collapsed sidebar's flyout New creates under the split Rebutted. The recents flyout cannot open while Split View is showing: note: #21959 Agreed, both PRs fix the same split-view symptom in Separately, the head was rebased on main to clear the conflict with #18545 in |
21c63ae to
f73e1a8
Compare
|
note: the fix for the foreground-tab finding is now on the PR at f73e1a8, rebased on main (which touched ChatSidebar.tsx in #21978, no conflict). The folder create reports after the tab switch for every mode except a background tab, the same as header New, and the regression test that fails on 21c63ae passes here. 88 tests across the 9 create and fork files pass. |
f73e1a8 to
38a6673
Compare
|
note: rebased on main, no behaviour change. Harness Parity Gate failed on f73e1a8 because its base predated #22178, which deleted the claude ACP_BACKENDS_MEMBER_CAPABILITIES allowlist entry the gate flagged; main passes the same gate. New head 38a6673 carries the same single commit, and the 88 create and fork tests pass. |
kirodotdev#21959 made every plain sidebar create report the new session through the host's onSelectSlot, so ChatPage leaves Split View. Duplicate (Fork chat) still switched to the fork with switchSlot and never told the host, so in Split View the fork became the active session behind the two old panes. useSessionActions now takes an optional onOpened callback and calls it after the fork's switchSlot. ChatSidebar passes its onSelectSlot. Callers that pass nothing (SessionActionsMenu, the command palette) do not use Duplicate and are unchanged. A refused fork reports nothing. Part of kirodotdev#21935
38a6673 to
70a6b00
Compare
|
note: rescoped after #21959 merged. #21959 now ships the New chat fix for #21935, so this PR no longer carries its own copy. Head 70a6b00 is one commit on current main with only the Fork chat sibling that review r111 asked for: The diff is 3 files, +38/-4. The new fork test fails on main and passes here; 37 tests pass across the fork test and #21959's The Cmd/Ctrl+Shift foreground-tab report and the collapsed-folder tests from earlier heads are dropped: #21959 already reports the folder foreground tab, and the collapsed-folder report stays unreproduced. |
|
|
|
iamwhatever
left a comment
There was a problem hiding this comment.
Approved at 70a6b006c1487b55e1631bffa8e7e8ace2672ba9.
The r112 blocker no longer applies. After #21959 merged, this PR only carries the Fork chat sibling, and main's folder create already reports a foreground-tab create. The fork is reported only after a successful fork and after switchSlot makes it active (useSessionActions.ts#L250). It goes through the sidebar's onSelectSlot (ChatSidebar.tsx#L657), the callback a row click already uses in both hosts. The new opened-fork test fails without the call. Every lane punchline on this head has a disposition, and CI is green.
Non-blocking: the refused-fork case asserts right after forkChatSlot is called, possibly before onSuccess runs, so it would likely pass even without the ok guard.
I read the code and CI but did not run the tests.
— crew-pr-reviewer (r114)
Problem / Motivation
Goal: Fork chat from the sessions sidebar shows the fork on screen, also when Split View is showing.
#21959 made a plain New chat leave Split View. Fork chat (Duplicate) was not covered: in Split View it makes the fork the active session, and the URL and title name it, but the grid keeps drawing the two old panes, so the fork stays hidden behind them.
Why it matters
A user who forks a chat from the sidebar while Split View is up sees the old conversations instead of the fork, the same symptom #21935 reported for New chat.
Not a goal
70cc5ee6c4.What changed (motivation → approach → change)
A session row click reports through the sidebar's
onSelectSlot, and ChatPage leaves Split View from it (clearSplitOnSelect). #21959 made every plain create report the same way. Duplicate goes throughuseSessionActions, which switched to the fork withswitchSlotand never called that callback.useSessionActions(website/src/hooks/useSessionActions.ts) now takes an optionalonOpenedcallback and calls it after the fork'sswitchSlot.ChatSidebar(website/src/pages/ChatSidebar.tsx) passes itsonSelectSlot, so a fork leaves Split View the same way a row click does. The other callers,SessionActionsMenuand the command palette, pass nothing and do not use Duplicate. A refused fork reports nothing.In the embedded Sessions frame, whose
onSelectSlotisnavigateToEmbeddedSlot(SessionsSidebarChrome.tsx), a fork now opens the fork's chat there, the same as clicking its row. #21959 already does the same for a plain create in that frame.Backwards compatibility
Compatible:
useSessionActionstakes one new optional argument, and a caller that passes none behaves exactly as before.Removes nothing: the change only adds a callback call after a successful fork.
Tests
website/src/test/ChatSidebar.forkChatAction.test.tsxgains two cases:onSelectSlotwith the fork's key. This case fails on main.ok: false) reports nothing.The file passed 3 shuffled runs (seeds 1 to 3, 3 of 3 each). With
ChatSidebar.newChatLeavesSplit,ChatSidebar.folderCreateInTabandChatSidebar.newChatInTab, 37 tests pass. Fork reviews of the earlier, wider version of this PR on38a6673530(Opus 5.5 and GPT 6.1) found nothing in this change.Manual verification
N/A for a new pod run. The Split View exit is the same
clearSplitOnSelectpath #21959 verified on screen; this PR only adds the call from Duplicate, and the unit test drives the real sidebar row's Fork chat button.Screenshots / video
Why no screenshot: the fork lands on the same single-chat view a row click on that session already shows, and no control, layout or copy changes.
Related Issues
Part of #21935. That issue was closed by #21959. This PR covers the Fork chat sibling the review on this PR asked for, and the collapsed-folder report stays unreproduced.
Pattern harvest
Rule candidate: review-prompt
Pattern: a sidebar action that changes the active session without going through the host's
onSelectSlot, so host-owned view state (Split View, crew window, embedded navigation) is never told.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)