Skip to content

feat(chat): offer split down from the single-session view - #29558

Merged
buluoray merged 1 commit into
mainfrom
fix/split-down-entry-18880
Nov 4, 2026
Merged

buluoray merged 1 commit into
mainfrom
fix/split-down-entry-18880

Conversation

@buluoray

@buluoray buluoray commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a user open split view with the new pane below the current session, straight from the single-session view.

Today the split view button and Cmd/Ctrl+D always put the first new pane to the right. The Split down control exists only on the panes of a view that is already split, so a stacked layout takes three steps: split right, split down, then close the right pane.

Why it matters

A stacked layout suits a wide, short window and sessions with long lines. Users who want it pay three clicks and a throwaway pane every time.

Not a goal

  • Changing the split view button, its tooltip, its label or Cmd/Ctrl+D. They still open side by side.
  • A new keyboard shortcut for split down (Cmd/Ctrl+Shift+D is reserved by Chrome in a browser tab).
  • Changing what a saved split restores, or the split controls on panes that are already split.

What changed (motivation → approach → change)

Root cause: useSessionGrid.seedFromSession hard-codes the first split to dir: 'col', and enterSplit(anchor) in paneLayout.tsx has no direction argument, so the entry path can only seed side by side. The grid itself already supports stacked splits (splitLeaf(id, 'down') builds a row split).

Change:

  • seedFromSession(slot, dir = 'right') maps dir to the split axis the way splitLeaf does. The no-slot path is unchanged.
  • enterSplit(anchor, dir = 'right') stores the direction and ChatPage passes it to SessionGridView as seedDir. Every entry sets it, so a Split down entry never carries into the next default entry (Cmd/Ctrl+D, the button, the auto re-enter).
  • Desktop: a Split down row in the session menu behind the title chevron, right after Pop out to window (the other window-layout row). SessionActionsMenu takes it as an optional layoutSlot, so no row above it moves. It is a menu row, not a header button, because that header group already holds three buttons (pop out, activity panel, split view) and max-two-buttons-per-row forbids a fourth.
  • Phone: a Split down row directly under the existing Enter split view row in the More menu. The existing row keeps its label.
  • Both rows reuse the pane controls' existing components.chatPane.split_down string, so there are no new locale keys.
  • Both rows hide when split view is off or the session already belongs to a saved split (that case shows "Return to split view", which restores the saved layout). The phone row also hides while a split view is already open: the grid has already been seeded, so the row would do nothing there, and the panes carry their own Split down.
  • website/scripts/capture-18880-split-down.mjs drives the built SPA on desktop and phone, asserts the menu order and the resulting layout, and writes the four frames below.

This builds on the closed #20040 by @javenciu (credited with a Co-authored-by trailer). Unlike that PR, the phone's default row keeps its current "Enter split view" label.

Backwards compatibility

Compatible: the new dir/seedDir parameters are optional and default to 'right', so every existing caller seeds exactly as before.

Removes nothing: the change only adds two menu rows and an optional parameter.

Tests

  • UseSessionGridCoverage.test.tsx › "stacks the fresh placeholder below the current session when seeded down": seedFromSession(slot, 'down') gives a row split of [session, placeholder] with the placeholder focused. "seeds side by side when the direction is right or omitted" pins the default.
  • ChatPageMoreCoverage.test.tsx › "ChatPage split view entry direction": the menu row seeds down with no Split right row beside it, and the next header-button entry seeds right again; no Split down row when split is off.
  • SessionActionsMenu.popout.test.tsx › "ChatHeaderMenu split down row": Split down sits right after Pop out to window, there is no Split right row, and every row above it keeps its place.
  • ChatPage.mobileTopBarActions.test.tsx › "enters split view with the new pane below"; "offers no Split down row while split view is already open"; no row in a saved split or with split off; the existing Enter split view row still calls enterSplit('slot-a').
  • SessionGridViewCoverage.test.tsx: seedDir reaches seedFromSession.

Mutation checks (each run alone, file restored after): forcing seedFromSession to always 'col' fails "stacks the fresh placeholder below the current session when seeded down"; making enterSplit ignore dir fails "seeds the first split below from the session menu, and the next button entry beside"; dropping the !splitMode gate on the phone row fails "offers no Split down row while split view is already open".

Proof: not provable -- frontend test (prove.py runs Python only)

npx tsc -b is clean. The five test files above pass: 219 tests.

Manual verification

Ran node scripts/capture-18880-split-down.mjs against a fresh vite build. On each device a control run through the default entry (the header button on desktop, Enter split view on the phone) lands side by side, and the Split down run lands stacked. All assertions passed.

Screenshots / video

Desktop, session menu open: Split down right after Pop out to window.

Desktop session menu with Split down

Phone, More menu open: Split down under Enter split view.

Phone More menu with Split down

After choosing Split down

Desktop stacked split

Phone stacked split

Related Issues

Closes #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

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 4, 2026 10:27
@buluoray
buluoray requested a review from dodgeblaster November 4, 2026 10:27
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the change fixes the root cause, which was the first split's direction being hard-coded in seedFromSession. It reuses the grid's existing stacked split, the new parameters default to the current behaviour, and four downloaded screenshots show this revision.

[DESIGN-REVIEWED] 0c8b78f

Description read

[DESCRIPTION-READ] fb403bbce5f5d96dac65727c6e438f4c989615f8897ccebe9ac8dd5931231fc3

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 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0c8b78ff6bff0e96c3d3dc7c74f574ada698d145 — 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 new rows are optional entry points next to the existing default. The button, Cmd/Ctrl+D and the default seed direction are unchanged, so this does not change what users get without choosing.

What this change ships

Inventory (6 items) — 6 justified

Intent: a user opens split view with the new pane stacked below the current session in one step, not three (#18880). ADDITION.

  1. The desktop session menu (title chevron) gains a "Split down" row right after "Pop out to window" — justified
  2. The phone More menu gains a "Split down" row under "Enter split view", hidden while a split is open — justified
  3. Both rows are hidden when split view is off or the session already belongs to a saved split — justified
  4. A split entered from either row seeds the new pane below; the next default entry goes side by side again — justified
  5. The shared session menu takes one optional extra layout row, which only the header menu passes — justified
  6. A new screenshot script, capture-18880-split-down.mjs, that checks the menu order and the resulting layout — justified

[FIRST-PRINCIPLES-REVIEWED] 0c8b78f

Description read

[DESCRIPTION-READ] b02c35f294010b561d6f53413be98154394647e70b669c86479874b934e4f9c5

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 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks: the screenshots show every added row and the stacked state, and the blind reader read "Split down" correctly and said they would use it.

Notes

  • On the phone's More menu, "Enter split view" and "Split down" are told apart only by their icons. The blind reader said: "The labels don't say which way each one splits." The PR keeps the old label on purpose. A label that names the direction, such as "Split right", would close this in a follow-up.

[UX-REVIEWED] 0c8b78f

Description read

[DESCRIPTION-READ] d751412ddd6ee257362c1383dda492ab5eb6faaea40aed81c6b5008b2e749926

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 Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 0c8b78f

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

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

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0c8b78f

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

Entering split view always put the new 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 lives 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 it, so a down entry never carries into the next default one.

Offer it as a Split down row in the session menu behind the title
chevron, right after Pop out to window, and as a Split down row under
Enter split view in the phone More menu. The rows reuse the pane
controls' existing "Split down" string, so no new locale keys.

The header buttons are unchanged: the split view button, its tooltip,
its label and Cmd/Ctrl+D still open side by side. That header group
already holds three buttons, so a fourth would break the
max-two-buttons-per-row rule. A restored layout still wins over the seed.

Closes #18880

Co-authored-by: Javen Cinocca <129346815+javenciu@users.noreply.github.com>
@buluoray

buluoray commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]:

  • Split down remains selectable in split view but does nothing (MobileTopBar.tsx): fixed in 0c8b78f. The phone row now renders only when !splitMode; in an open grid the panes keep their own Split down. Pinned by ChatPage.mobileTopBarActions.test.tsx › "offers no Split down row while split view is already open", which fails with the gate removed.
  • Frontend Ratchets: ChatPageMoreCoverage.test.tsx had gone over the 2,000-line cap; the new ChatPage-level block is compacted to two tests and the file is at 2,000 lines.

@buluoray
buluoray force-pushed the fix/split-down-entry-18880 branch from 8a18bdf to 0c8b78f Compare November 4, 2026 10:59
@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 4, 2026
@buluoray
buluoray enabled auto-merge (squash) November 4, 2026 12:53

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving 0c8b78f. I read every non-locale hunk: SessionActionsMenu.tsx, SessionGridView.tsx, useSessionGrid.ts, ChatPage.tsx, ChatHeaderMenu.tsx, ChatTitleOverlay.tsx, MobileTopBar.tsx, paneLayout.tsx and the screenshot harness.

  • enterSplit takes an optional dir (default 'right') and stores it in splitSeedDir. seedFromSession maps 'down' to a row split, so only a fresh seed changes; a saved layout still restores as before.
  • Every enterSplit call sets the direction, so a Split down entry never carries into the next entry.
  • Desktop: the row goes in the new layoutSlot right after the pop-out rows, so no existing row moves. It is offered only when split view is on, not embedded, and the session is not a member of another saved split.
  • Phone: the row sits under Enter split view and only in the single-session view, where the seed is not spent yet.
  • The header split button and its side-by-side default are unchanged.

No new regex outside tests. All checks pass on this head (96 ok, 0 red, 0 pending), readiness is passed, and no human has an open change request. Auto-merge was already enabled by the author, so I left it as is.

@buluoray
buluoray merged commit 973e721 into main Nov 4, 2026
149 of 153 checks passed
@buluoray
buluoray deleted the fix/split-down-entry-18880 branch November 4, 2026 18:16
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 4, 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.

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

2 participants