Skip to content

feat(chat): offer a split-down control from the single-session view - #20040

Closed
javenciu wants to merge 1 commit into
mainfrom
feat/18880-split-down-from-single
Closed

javenciu wants to merge 1 commit into
mainfrom
feat/18880-split-down-from-single

Conversation

@javenciu

@javenciu javenciu commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: From the single-session view, a user can start split view with the new pane below the session, not only to its right.

Today the header's split view button and Cmd/Ctrl+D always open split view with the new pane to the right of the session. The split-down control exists only on the panes of a view that is already split, so the single-session view has no way to ask for a stacked first split. Reported in #18880.

Why it matters

A stacked layout suits a wide, short window, sessions with long lines, and a tall narrow screen such as a phone. Reaching it today takes three steps: split right, split down on one pane, then close the right pane.

Not a goal

  • A keyboard shortcut for split down. Cmd/Ctrl+Shift+D is reserved by Chrome in a browser tab (see the comment at website/src/components/SessionGridView.tsx:102), so the control is a menu row.
  • Changing what opens when the session already has a saved split. A saved layout is still restored as saved; the direction applies only to a fresh first split.
  • Changing the in-pane split controls, Cmd/Ctrl+D, the "In split" badge, or the auto-enter for a persisted split.
  • A setting that remembers a preferred direction.

What changed (motivation → approach → change)

Symptom and cause. useSessionGrid.seedFromSession builds the first split along the column axis only, and enterSplit(anchor) in usePaneLayoutState takes no direction, so nothing on the entry path can ask for a row. Every later split can: splitLeaf(leafId, dir) takes a SplitDir and maps right to a column split and down to a row split.

Approach. Reuse that SplitDir type and mapping on the entry path, keep the default the entry path already had, and offer the new entry where the header has room for it.

Change.

  • website/src/hooks/useSessionGrid.ts: seedFromSession(slot, dir = 'right') maps dir to the split axis the way splitLeaf does.
  • website/src/components/SessionGridView.tsx: a seedDir prop, passed to seedFromSession when no layout was restored.
  • website/src/pages/chat/page/paneLayout.tsx: enterSplit(anchor, dir = 'right') keeps the direction in state (splitSeedDir), and usePaneLayoutState returns it. Every call sets it, so a down entry never carries into the next default one, including the Cmd/Ctrl+D and auto-enter calls inside the hook.
  • website/src/pages/ChatPage.tsx: passes splitSeedDir to SessionGridView as seedDir.
  • website/src/pages/chat/page/ChatTitleOverlay.tsx: gives the desktop session menu onSplitDown, which calls enterSplit(activeSlot, 'down'), under the same visibility condition as the split view button: split view on, not embedded, and the session not already part of a saved split.
  • website/src/pages/chat/ChatHeaderMenu.tsx: ChatHeaderMenu takes an optional onSplitDown and hands one Split down row to the shared session menu. It adds no Split right row: the split view button beside the title already starts the side-by-side split, and so does Cmd/Ctrl+D.
  • website/src/components/SessionActionsMenu.tsx: a new optional layoutSlot prop, one extra row, rendered in the navigation group directly after the pop-out rows. Its one consumer is the header menu (the Split down row), so the sidebar's row menus and context menu are unchanged.
  • website/src/pages/chat/page/MobileTopBar.tsx: the phone menu gets a Split down row, and the default-entry row beside it is labelled Split right instead of Enter split view, so the two rows name two directions. The phone header has no split view button, so this menu holds the phone's only split view control.
  • The desktop Split down row and the phone rows reuse the pane controls' components.chatPane.split_down and components.chatPane.split_right strings, so no catalog key is added. pages.chatPage.enter_split_view stays: the desktop split view button still uses it.
  • website/scripts/capture-18880-split-down.mjs: the capture harness behind the screenshots below.

Why a menu row and not a header button. The desktop header group beside the title already holds three buttons (pop out, side panel, split view), and the repo's max-two-buttons-per-row rule says a row that already carries three must not grow. The title chevron's menu is the existing overflow for session actions. The Split down row sits directly after Pop out to window, the other window-layout action; a row at the top would move Rename and Pin down on every open. There is no Split right row beside it: the split view button and Cmd/Ctrl+D already start that split, so a second desktop control for it would be the same action under two names.

Rejected. A fourth header button, for the reason above. Turning the split view button into a menu: it would add a click to the default entry that works today. A remembered-direction setting: new state and copy for a choice that is made per split. Reorienting the tree after seeding right: it needs a new tree operation, where the seed already builds the tree and a parameter is smaller. A Split down row at the top of the menu: it moved Rename and Pin. A Split right row in the desktop menu beside Split down: it runs the same enterSplit(activeSlot) as the split view button and Cmd/Ctrl+D.

Overlap. Open PR #5819 (cross-session send) also edits website/src/components/SessionGridView.tsx and already conflicts with main. PR #20801 (the adaptive controller's concurrency cut in the chat header) is merged and edited website/src/pages/chat/page/MobileTopBar.tsx and website/src/pages/chat/page/ChatTitleOverlay.tsx; this branch is cut from a main that contains it. This change adds one prop and one argument in SessionGridView.tsx, one prop and the optional direction in the enterSplit type in ChatTitleOverlay.tsx, and the split rows in MobileTopBar.tsx.

Backwards compatibility

Compatible: the new parameter, props and menu props (seedDir, onSplitDown, layoutSlot) are optional and default to 'right' or to absent, which is what every caller got before, and a saved layout is restored as saved. The phone menu's default-entry row keeps its action and its place; only its visible label changes, from Enter split view to Split right.

Removes nothing: no control, shortcut, prop or catalog key is removed; enterSplit gains a second optional parameter. The desktop split view button keeps its label.

Reader: the phone row is found by its label in three places in website/src/test/ChatPage.mobileTopBarActions.test.tsx, all updated here. git grep -n -E "Enter split view|enter_split_view" -- . ':(exclude)website/src/i18n/locales' finds no other reader of that row. What it still lists is the desktop button: its aria-label in website/src/pages/chat/page/ChatTitleOverlay.tsx, and the tests and capture harnesses that find that button by role.

Tests

In short: the tests for the entry direction, the Split down rows and the phone row's label fail on the base commit's source (one run) and pass with this change (3 of 3 runs). Tests that pin the unchanged default pass on both sides.

Added, by file:

  • website/src/test/UseSessionGridCoverage.test.tsx: seedFromSession stacks the placeholder below the session when seeded 'down' (row axis, equal sizes, focus on the placeholder), and seeds side by side for 'right' and for an omitted direction.
  • website/src/test/SessionGridViewCoverage.test.tsx: with the real layout and hook, seedDir="down" renders a horizontal divider with the picker below the session, and no seedDir renders a vertical one.
  • website/src/test/SessionActionsMenu.popout.test.tsx (ChatHeaderMenu split down row): Split down is the row right after Pop out to window, with Copy link next and no Split right row; every row above it, Pin included, keeps its index with and without it; choosing it calls onSplitDown.
  • website/src/test/ChatPageMoreCoverage.test.tsx (ChatPage split view entry direction): the existing header button seeds 'right'; the session menu has no Split right row and its Split down row seeds 'down' for the active session; a down entry does not carry into the next default entry; the menu offers no split row while split view is off or for a session that belongs to a saved split.
  • website/src/test/ChatPage.mobileTopBarActions.test.tsx: the phone menu's Split down row calls enterSplit(slot, 'down'); the default-entry row is found by its Split right label; the Return to split view case and the split-off menu offer none.

Red, with the base commit's version of the eight changed source files swapped in under these five test files (one run; the base is the origin/main this branch is cut from):

 FAIL  src/test/ChatPage.mobileTopBarActions.test.tsx > trailing ⋯ menu > pops the session out, opens the activity panel and enters split view
TestingLibraryElementError: Unable to find role="menuitem" and name "Split right"
 FAIL  src/test/ChatPage.mobileTopBarActions.test.tsx > trailing ⋯ menu > enters split view with the new pane below
TestingLibraryElementError: Unable to find role="menuitem" and name "Split down"
 FAIL  src/test/ChatPage.mobileTopBarActions.test.tsx > trailing ⋯ menu > offers no split row when the split feature is off, and enters split for the anchor itself
TestingLibraryElementError: Unable to find role="menuitem" and name "Split right"
 FAIL  src/test/ChatPageMoreCoverage.test.tsx > ChatPage split view entry direction > seeds the first split beside the session from the existing header button
AssertionError: expected undefined to be 'right' // Object.is equality
 FAIL  src/test/ChatPageMoreCoverage.test.tsx > ChatPage split view entry direction > seeds the first split below the session from the session menu, which has no Split right row
TestingLibraryElementError: Unable to find role="menuitem" and name "Split down"
 FAIL  src/test/ChatPageMoreCoverage.test.tsx > ChatPage split view entry direction > does not carry a Split down entry into the next default entry
TestingLibraryElementError: Unable to find role="menuitem" and name "Split down"
 FAIL  src/test/SessionActionsMenu.popout.test.tsx > ChatHeaderMenu split down row > puts Split down right after Pop out to window, with no Split right row
TestingLibraryElementError: Unable to find an element with the text: Split down.
 FAIL  src/test/SessionActionsMenu.popout.test.tsx > ChatHeaderMenu split down row > keeps every row above Split down where it was, Rename and Pin included
TestingLibraryElementError: Unable to find an element with the text: Split down.
 FAIL  src/test/SessionActionsMenu.popout.test.tsx > ChatHeaderMenu split down row > calls onSplitDown when Split down is chosen
TestingLibraryElementError: Unable to find role="menuitem" and name "Split down"
 FAIL  src/test/SessionGridViewCoverage.test.tsx > SessionGridView — entry seeding > stacks the fresh picker below the session when seeded down
AssertionError: expected 'vertical' to be 'horizontal' // Object.is equality
 FAIL  src/test/UseSessionGridCoverage.test.tsx > useSessionGrid — seedFromSession > stacks the fresh placeholder below the current session when seeded down
AssertionError: expected 'col' to be 'row' // Object.is equality
      Tests  11 failed | 180 passed (191)

Green with this change, on the same base:

 Test Files  5 passed (5)
      Tests  191 passed (191)

Also run and passing on this base: tsc -p tsconfig.app.json --noEmit; eslint --max-warnings 0 on the thirteen touched source and test files; and the repo's frontend gates npm run lint:restyle-ratchet, lint:phantom-classes, lint:theme-colors, lint:i18n and i18n:check. No i18n catalog changed.

Manual verification

Ran node scripts/capture-18880-split-down.mjs from website/ against the production build (vite build), served from loopback with every /api/** request answered by the repo's split-pane fixtures (website/scripts/lib/split-pane-fixture.mjs), with session_grid on and no saved layout. It drives Chromium on a 1440x900 desktop at device scale factor 1 and a 390x844 touch phone at device scale factor 2, so every frame is at most 2000 px on a side. It writes the four frames below, and exits non-zero if any of these checks mismatches:

  • desktop: the menu behind the title chevron has exactly one Split down row, directly after Pop out to window, and no Split right row; clicking Split down opens a horizontal divider with the picker below the session pane;
  • phone: the ⋯ menu has exactly one Split down row, with Split right directly above it; tapping it opens the same stacked layout;
  • control runs: the default entry opens a vertical divider with the picker beside the session, as before, through the existing header button on desktop and through Split right on the phone.

The right end of the header in the first frame still holds only the pop out, side panel and split view buttons.

Screenshots / video

Dark theme, session grid on, no saved layout. The frames are committed under temp-screenshots/18880-split-down/.

Desktop: the session menu behind the title chevron, with Split down right after Pop out to window. The split view button stays in the header and starts the side-by-side split.

Desktop: the session menu behind the title chevron open, with Split down right after Pop out to window

Phone: the ⋯ menu, with Split right directly above Split down.

Phone: the more actions menu open, listing Split right above Split down

Desktop, after choosing Split down: the session on top, the picker below a horizontal divider.

Desktop: after choosing Split down, the session above and the session picker below

Phone, after tapping Split down: the same stacked layout.

Phone: after tapping Split down, the session above and the session picker below

Related Issues

Fixes #18880

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

@javenciu
javenciu requested review from a team and KiroCrewCaptain as code owners October 14, 2026 01:09
@javenciu
javenciu requested a review from mbriones98 October 14, 2026 01:09
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening right after opening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

UX-level review of 38c05a423926d37f8e2aede1b286a3691031fa5b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

On desktop, the two split directions sit on two different surfaces. Split right is only an unlabeled header icon, and Split down is only a row in the title menu.

Watch

  • The two directions don't read as a pair on desktop. Split down sits in the title-chevron menu (shot-01). Split right is only the unlabeled Columns2 icon at top right. The PR rules out a Split right row in that menu. The blind reader said: "there is also a small icon at the top right that might be the same split action. I can't tell whether these are the same thing." Someone who finds Split down in the menu has no way to see that its partner is that icon, and every desktop user meets this. On the phone the two rows sit side by side, so the phone isn't affected. Smallest fix: give the header icon a visible tooltip or label "Split right", so the two names match across surfaces.
  • The main control was only guessed at. The blind reader read "Split down" correctly ("a second area appears below the chat") but rated it "a guess", and rated the phone's "Split right" / "Split down" rows the same way. This is advisory, not a blocker.
  • There is no recording of the change from one session to a split view. The session goes from full width to the top half (shot-01 → shot-03). The swap goes through the existing splitMode ? <SessionGridView/> : … path, which this PR doesn't change. A short recording would let a human confirm that the stacked entry reads as the same session moving up.

[UX-REVIEWED] 38c05a4

Description read

[DESCRIPTION-READ] 28a84b88ae2ddc6b4b6dd312e543618b8b7ce03678b1e804ed224a7e9ab3afc1

That sha256 names everything this verdict read: the PR description, plus the 7 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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 38c05a423926d37f8e2aede1b286a3691031fa5b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the Split down row is reachable only from the title-chevron menu on desktop, and judge whether a split view button whose label names no direction is clear next to it.

[DESIGN-REVIEWED] 38c05a4

Description read

[DESCRIPTION-READ] 1f7f5d0a39488a82e1bd510905bb17853d0fce664b9ed9b6dabbb97a53dc75b7

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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 38c05a4

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 38c05a423926d37f8e2aede1b286a3691031fa5b: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 38c05a423926d37f8e2aede1b286a3691031fa5b — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check one thing before merge: the phone row's label changes from "Enter split view" to "Split right". No entry under docs/decisions/ mentions split view, so the label was not a recorded decision.

What this change ships

Inventory (7 items) — 7 justified

Intent: from the single-session view, a person can open split view with the new pane below the session instead of beside it (#18880). ADDITION.

  1. Desktop title-chevron menu gains a "Split down" row right after "Pop out to window" — justified
  2. Phone ⋯ menu gains a "Split down" row — justified
  3. The phone's existing split row is relabelled from "Enter split view" to "Split right" — justified
  4. A fresh first split can now be stacked (the seed direction is passed through enterSplit → seedFromSession), and right stays the default — justified
  5. The shared session menu gets an optional layoutSlot prop placed after the pop-out rows — justified
  6. A screenshot script, website/scripts/capture-18880-split-down.mjs, follows the existing capture-* convention (774 such scripts) — justified
  7. Four review PNGs under temp-screenshots/18880-split-down/, the convention described in docs/ci/ci-and-reviews.md — justified

[FIRST-PRINCIPLES-REVIEWED] 38c05a4

Description read

[DESCRIPTION-READ] f786fb653ccc8cf67e3a381bcbf735c9517db6fbcef141e6da41bc2d89d58049

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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 38c05a4

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 38c05a423926d37f8e2aede1b286a3691031fa5b: <one-sentence reason>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 14, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

span=16de4fd16aef

fixed in 4ad4869: this revision commits four frames under temp-screenshots/18880-split-down/, taken from the built app by website/scripts/capture-18880-split-down.mjs: the desktop title-chevron menu open with the Split down row (01-desktop-title-menu.png), the phone ⋯ menu open with Split right above Split down (02-phone-more-menu.png), and the stacked split each one opens, the session on top and the picker below (03-desktop-stacked-split.png, 04-phone-stacked-split.png). The description links all four.
The harness asserts the stacked result on both viewports, and a control run per viewport asserts that the default entry still opens side by side, so the stacked frames cannot come from a layout that is stacked by default. On the placement question, the row leads the desktop menu above a divider the way the "New chat here" row leads the phone's title menu (website/src/pages/chat/ChatPageMessageContent.tsx:130 and :138): items that open something new come first, the session's own actions follow.

@javenciu

Copy link
Copy Markdown
Contributor Author

rebutted: the case is not a state a user rests in. When the active session is the anchor of a live saved split, ChatPage opens that split as soon as the session lands (the effect that auto-enters a persisted split), so the single-session view and its title-chevron menu are on screen for about 200 ms while the app loads, and the saved layout replaces them. A browser run on the built app with a saved split anchored at the active session ended with two panes and no title chevron.
A saved layout is restored as saved, and the direction applies only to a fresh first split: that is the second item under Not a goal in the description, and the Split down row is hidden for the other members of a saved split by the guard the ChatPage tests pin.

@javenciu

Copy link
Copy Markdown
Contributor Author
  1. The missing stills are committed under temp-screenshots/18880-split-down/ and linked in the description: the desktop title-chevron menu with the Split down row, the phone ⋯ menu with Split right above Split down, and the stacked split each one opens, with the session on top and the picker below. website/scripts/capture-18880-split-down.mjs takes them from the built app on a desktop and a phone viewport, asserts the stacked result, and runs a control per viewport that the default entry still opens side by side.
  2. The phone menu's default-entry row now reads "Split right" instead of "Enter split view", using the pane control's existing string, so the two rows name two directions. The desktop split view button keeps its label, and no catalog key is added.
  3. The desktop Split down row stays in the title chevron's menu. A button beside the split view button would be a fourth in a header group that already holds three, which the max-two-buttons-per-row rule does not allow. Each point has its own disposition comment.

The new head is 4ad486976f, two commits on main at 09efe8abbb.

@javenciu

Copy link
Copy Markdown
Contributor Author

span=3957026d546a

rebutted: the only way to put a control beside the split view button is a fourth button in a header group that already holds up to three (pop out, side panel, split view). The repo's blocking max-two-buttons-per-row rule lets a row that already has three stay as it is but not grow, and it names an overflow menu as the way to add an action to such a row. The title chevron's menu is that overflow, so the row sits there: first in the menu, with its own icon, above a divider (website/src/pages/chat/ChatPageMessageContent.tsx:138).
The other way to pair them, turning the split view button into a menu, would add a click to the default entry that works today, so that button keeps its one-click action. temp-screenshots/18880-split-down/01-desktop-title-menu.png shows both controls in one view: the Split down row at the top of the menu behind the chevron and the split view button at the right end of the header.

@javenciu

Copy link
Copy Markdown
Contributor Author

span=3f21e26fef2f

fixed in 4ad4869: the phone menu's default-entry row now reads "Split right" instead of "Enter split view", so the two rows read "Split right" and "Split down" (website/src/pages/chat/page/MobileTopBar.tsx:236 and :239). The label is the pane control's existing components.chatPane.split_right string, which every locale already translates beside split_down; the desktop split view button keeps its own label.
Two tests look the row up as "Split right" in website/src/test/ChatPage.mobileTopBarActions.test.tsx: they fail on the base commit and pass here, 3 of 3 runs each. The phone menu is in temp-screenshots/18880-split-down/02-phone-more-menu.png.

@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 14, 2026
@javenciu javenciu reopened this Oct 14, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 14, 2026
@javenciu
javenciu enabled auto-merge (squash) October 14, 2026 04:35
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 4ad4869. The current UX review proposes adjacent Split right and Split down menu entries. That proposal needs no fourth header button. The earlier rebuttal only addressed adding a fourth header button. Please answer the actual current proposal, plus phone ordering and label consistency. Also answer the Design discoverability check. Pending readiness/security review evidence must settle before approval relies on it. Older canceled runs should not be counted over their successful replacements. I have not run the UI or viewed the captured frames. — crew-pr-reviewer (r99)

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 14, 2026
@javenciu
javenciu force-pushed the feat/18880-split-down-from-single branch from 4ad4869 to 964c4ce Compare October 16, 2026 01:58
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 16, 2026
@javenciu javenciu closed this Oct 16, 2026
@javenciu javenciu reopened this Oct 16, 2026
@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 Oct 16, 2026
@javenciu
javenciu enabled auto-merge (squash) October 16, 2026 18:11
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 16, 2026
Entering split view always put the fresh pane to the right of the
session. A stacked layout took three steps: split right, split down,
then close the right pane, because the split-down control exists only
on the panes of a view that is already split.

Give the entry path a direction. useSessionGrid.seedFromSession takes
an optional SplitDir and maps it to the split axis the way splitLeaf
does. enterSplit, in usePaneLayoutState, takes the same optional
direction, keeps it in state and hands it to SessionGridView as
seedDir. Every entry sets the direction, so a down entry never carries
into the next default one, including the Cmd/Ctrl+D and auto-enter
entries that call enterSplit inside the hook.

Offer it as a Split down row in the session menu behind the title
chevron (ChatHeaderMenu), and as a Split right and Split down pair in
the phone menu. The desktop header group already holds three buttons,
so a fourth would break the two-buttons-per-row rule, and its split
view button already starts the side-by-side entry, so the desktop menu
has no Split right row. The row sits directly after Pop out to window,
the other window-layout action, so Rename and Pin keep their place:
SessionActionsMenu takes it as an optional layoutSlot prop for its
navigation group. The rows reuse the pane controls' labels. The phone
has no split view button, so its menu lists both directions, and its
default row is labelled Split right instead of Enter split view so the
pair reads as two directions. The desktop split button keeps its
label, which has its own key.

The default direction, Cmd/Ctrl+D, a restored layout and the auto-enter
for a persisted split are unchanged.

Add website/scripts/capture-18880-split-down.mjs. It drives the built
app on a desktop and a phone viewport and photographs each menu open
and the stacked layout one choice opens. A control run per device
checks that the default entry (the header button on desktop, Split
right on the phone) still opens side by side. Commit the four frames
under temp-screenshots/18880-split-down/, each at most 2000 px on a
side.
@javenciu
javenciu force-pushed the feat/18880-split-down-from-single branch from e03a8a8 to 38c05a4 Compare October 17, 2026 00:33
@javenciu

Copy link
Copy Markdown
Contributor Author

span=9c029f6c7186

  • The two directions are split across two places on desktop. kept: on the previous head (5177ca7) the desktop menu listed Split right above Split down (website/src/pages/chat/ChatHeaderMenu.tsx:157 and :160 on that head), and the First Principles review of that head flagged the Split right row: "The desktop menu's Split right row duplicates the split view button and Cmd/Ctrl+D." (span 710792a72163, answered in this comment). The row is deleted, so the menu holds only Split down (website/src/pages/chat/ChatHeaderMenu.tsx:156) and the side-by-side entry stays on the split view button (website/src/pages/chat/page/ChatTitleOverlay.tsx:209). Putting the pair back in the menu brings that duplicate back. Putting it in the header makes a fourth control in a group that already holds three (website/src/pages/chat/ChatHeaderMenu.tsx:46, the max-two-buttons-per-row rule). The tooltip route rewrites pages.chatPage.split_view_d, a string with an entry in 13 locale files (git grep -l split_view_d -- website/src/i18n/locales), and this PR changes no catalog file. The two reviews ask for opposite desktop menus, so which one holds is a call for the maintainers. The row sits directly after Pop out to window in temp-screenshots/18880-split-down/01-desktop-title-menu.png.

@javenciu

Copy link
Copy Markdown
Contributor Author

span=7e38e05a2caf

  • Both new rows were read correctly, but only as "a guess". kept: the review reads both rows correctly and says no change is needed beyond the placement fix, which span 9c029f6c7186 answers. The rows use the pane controls' own labels, so a user who meets Split down in a menu and later on a pane meets one name: the pane buttons are at website/src/components/ChatPane.tsx:611 and :616, the desktop row at website/src/pages/chat/ChatHeaderMenu.tsx:158, the phone rows at website/src/pages/chat/page/MobileTopBar.tsx:246 and :249. The title-menu row and the ⋯ menu row do the same thing: both call enterSplit(activeSlot, 'down') (website/src/pages/chat/page/ChatTitleOverlay.tsx:139, website/src/pages/chat/page/MobileTopBar.tsx:248), and the capture harness checks on each device that choosing Split down opens the stacked layout (website/scripts/capture-18880-split-down.mjs:152; frames 03-desktop-stacked-split.png and 04-phone-stacked-split.png). A different label or a tooltip on one of the rows would give the action two names.

@javenciu

Copy link
Copy Markdown
Contributor Author

span=9574abf06582

  • After the split, the unlabeled pane icons stay ambiguous. kept: the review places this "outside this diff", and website/src/components/ChatPane.tsx is not in it. The pane buttons already carry a tooltip and an accessible name each: Split right (website/src/components/ChatPane.tsx:611, title split_right_d "Split right (⌘D)", aria-label split_right), Split down (:616, title and aria-label split_down) and Close pane (:621, title and aria-label close_pane). A still frame cannot show a tooltip, which is how the reader saw two small box icons it could not tell apart. This PR changes how a split starts, not those buttons; text drawn on every pane header would change the header of every pane in split view, and that is a separate change.

@javenciu

Copy link
Copy Markdown
Contributor Author

span=d60cbd3b5844

  • One consumer, generalized: layoutSlots?: React.ReactNode[]. fixed: the prop takes a single node now. SessionActionsMenu declares layoutSlot?: React.ReactNode (website/src/components/SessionActionsMenu.tsx:84) and renders it as one entry of the navigation group, directly after the pop-out rows (website/src/components/SessionActionsMenu.tsx:403), where ...(layoutSlots ?? []) was; ChatHeaderMenu passes the Split down row itself (website/src/pages/chat/ChatHeaderMenu.tsx:156). It is still the only caller: git grep -n layoutSlot -- website lists the menu's own three lines (website/src/components/SessionActionsMenu.tsx:84, :146 and :403) and website/src/pages/chat/ChatHeaderMenu.tsx:156, nothing else, and git grep -n layoutSlots -- website lists nothing. A missing slot is undefined, which collapseGroups drops (website/src/components/SessionActionsMenu.tsx:116), so the sidebar's row menus and the context menu render as before. The row's place after Pop out to window is pinned by website/src/test/SessionActionsMenu.popout.test.tsx:118: with the layoutSlot entry removed from the group, that file and website/src/test/ChatPageMoreCoverage.test.tsx fail (5 failed, 65 passed in the two files), and with it restored the five touched test files pass (191 of 191, three runs).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision labels Oct 17, 2026
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing and reopening so CI runs on hosted runners: same-repo runs from this account queue on the fleet label without a runner (details on #19683).

@javenciu javenciu closed this Oct 17, 2026
auto-merge was automatically disabled October 17, 2026 01:26

Pull request was closed

@javenciu javenciu reopened this Oct 17, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 17, 2026
@javenciu
javenciu enabled auto-merge (squash) October 17, 2026 03:41
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 38c05a4.

The code looks right. enterSplit stores the direction on every call, so a Split down entry never carries into the next default entry, and seedFromSession keeps right as the default. GPT and Opus report no findings, and PR Readiness is green.

What blocks approval: the UX review on this head is CONCERNS, and none of its three Watch items has a target=ux head=38c05a4 disposition. Its first item now proposes a visible "Split right" tooltip or label on the header icon. Your e03a8a8 reply addressed a menu pair and a fourth button, and it said the desktop pairing is a maintainer call. Please answer the tooltip proposal on this head (the 13-locale string cost is a fair reason if that is the reason), and reply to the other two items. The Design punchline (is a direction-less split view button clear beside Split down?) and the First Principles punchline (the phone label change to "Split right" is not a recorded decision) also need replies on this head.

If the desktop placement really is a maintainer decision, a maintainer ruling on the PR settles it. I did not view the screenshots or run the tests.

— crew-pr-reviewer (r108)

@javenciu
javenciu disabled auto-merge October 18, 2026 05:31
@javenciu

Copy link
Copy Markdown
Contributor Author

Closing without merging, to keep my open PRs to the ones close to landing.

The Oct 17 hold on this head (38c05a4) needs replies to the UX review's three items, including the proposed "Split right" tooltip on the header button, and a ruling on where Split down sits on desktop.

The split-down control from the single-session view isn't on main as of 2e50054, and #18880 stays open. I've deleted the branch; it can be restored from this page at 38c05a4.

@javenciu javenciu closed this Oct 18, 2026
@javenciu
javenciu deleted the feat/18880-split-down-from-single branch October 18, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split view: offer a split-down control from the single-session view

2 participants