Skip to content

fix(chat): keep the session menu chevron left of the title on the phone - #22656

Closed
Pearcekieser wants to merge 2 commits into
kirodotdev:mainfrom
Pearcekieser:fix/session-chevron-side
Closed

Pearcekieser wants to merge 2 commits into
kirodotdev:mainfrom
Pearcekieser:fix/session-chevron-side

Conversation

@Pearcekieser

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The session menu chevron sits on the same side of the session title on desktop and on the phone.

On desktop the chat header reads ⌄ Session title. On the phone it reads Session title ⌄. Switching between the two moves the control a user reaches for.

Why it matters

Anyone who uses the dashboard on both a laptop and a phone sees the session menu control jump sides. It is cosmetic, but it is the first control in the header.

Not a goal

  • Changing the desktop header layout, the split-pane headers or SessionTitleControl.
  • Changing what the session menu contains.

What changed (motivation → approach → change)

The two viewports render different triggers of ChatHeaderMenu. Desktop uses the icon-only trigger, placed before SessionTitleControl in ChatTitleOverlay.tsx, and the two halves share a split-pill hover shape (rounded-l-md on the chevron, rounded-l-[2px] rounded-r-md on the title). The phone uses the titled trigger, whose button put the chevron after the title span.

In website/src/pages/chat/ChatHeaderMenu.tsx I moved the chevron ahead of the title inside the titled trigger, so the phone matches desktop. The other direction, moving the desktop chevron to the right, would mean reversing the pill rounding in SessionTitleControl, which the split-view pane headers also use. The button's accessible name does not change: the chevron icon has no text, so the name is still the title followed by the screen-reader-only "session options" suffix.

Backwards compatibility

Compatible: only the order of two children inside one button changes. The test id, accessible name and menu contents stay the same.

Removes nothing: no element, test id or behaviour is taken away.

Tests

website/src/test/ChatHeaderMenu.chevronSide.test.tsx renders the titled trigger and asserts that the chevron comes before the title in document order. It fails on origin/main and passes with the fix. The existing ChatHeaderMenu.*, ChatPage.mobileSingleTopbar and ChatPage.mobileTopBarActions suites pass (43 tests), and tsc -p tsconfig.app.json is clean.

Manual verification

I built a throwaway static page that mounts the real ChatHeaderMenu triggers and SessionTitleControl with dummy data, using the classes from the desktop title row in ChatTitleOverlay.tsx. I captured it with Playwright for the phone trigger before and after the fix, and for the desktop row. The page is not part of this diff.

Screenshots / video

Phone, before. The chevron trails the title.

Phone header before the fix

Phone, after. The chevron leads the title.

Phone header after the fix

Desktop, unchanged. The chevron leads the title.

Desktop header

Related Issues

Pattern harvest

Not generalizable: one button ordered its children differently from the sibling trigger of the same menu. No lint rule can tell which order is intended.

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

Fixes #22655

@Pearcekieser
Pearcekieser requested review from a team and KiroCrewCaptain as code owners October 21, 2026 03:16
@Pearcekieser
Pearcekieser requested a review from buluoray October 21, 2026 03:16
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note (non-blocking): This is a bug fix for #22655. The fork account cannot add labels, so could a maintainer add bug to this PR and the issue? Thanks.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 54e842366c121c71a2574e04d03dd773110f5424 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

This is a small, reversible change to the order of two children inside one button, and the committed screenshots show it.

Notes

  • The code comments being rewritten say the trailing chevron was "as on the approved mock". The description never says that it reverses that mock. Say so in the PR, and get a maintainer to confirm, so the next contributor does not flip it back to match the mock.

[DESIGN-REVIEWED] 54e8423

Description read

[DESCRIPTION-READ] e49e94479b450873be31bbda0cca04477373e20e3d0b5779c34ca1176a327ea1

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🔴 BLOCK

Premise-level review of 54e842366c121c71a2574e04d03dd773110f5424 via the fork AI-review pipeline — 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: BLOCK

The phone chevron move undoes a layout the code records as the approved mock, and the description never says so. Its only stated reason is matching desktop.

What this change ships

Inventory (5 items) — 3 justified

Intent: the session-menu chevron sits on the same side of the title on phone and desktop. This is a FIX.

  1. On the phone, the session-menu chevron moves from after the title to before it — unjustified move: symmetry only, overturns the "approved mock" comment
  2. Comments in MobileTopBar.tsx that cited "the approved mock" are rewritten to cite desktop order — undeclared
  3. The narrow-viewport.md centre-cell row now describes chevron-then-title — justified
  4. A new test pins the chevron ahead of the title — justified
  5. Three before/after screenshots are committed under temp-screenshots/ — justified

Blockers

Reverses the approved-mock layout without saying so — unjustified move
Trigger: the diff deletes the comment "The title is first and the menu chevron trails it, as on the approved mock" and the comment line "(the approved mock)" in MobileTopBar.tsx. The description never mentions that mock. Its only reason is symmetry: "Switching between the two moves the control a user reaches for." It names no user who failed to find the control.
Outcome: a recorded design decision is overturned on consistency alone. Every phone user has to relearn where the first control in the header is.
Subtraction: restore the chevron after the title in the ChatHeaderMenu titled trigger, and drop ChatHeaderMenu.chevronSide.test.tsx.
Clears when: the PR shows the approved mock was superseded (a maintainer comment, or #22655 written by a maintainer and choosing chevron-first on the phone), or the chevron goes back after the title.

[FIRST-PRINCIPLES-REVIEWED] 54e8423

Description read

[DESCRIPTION-READ] 8bd5ef0cebd5eb1553b29debba822212caaae5168262e4c53fa628f8078bff5e

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 54e842366c121c71a2574e04d03dd773110f5424 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

The committed before/after phone shots and the desktop shot show the moved chevron. No blind reader has seen them, which is a limit of this fork lane and not a gap in the author's evidence.

Notes

  • The screenshots come from a throwaway page that has no sessions toggle. In the real phone bar, the chevron now sits right after that toggle icon, so two icons appear side by side. Adding one real #mobile-topbar-slot capture would show whether they read as one cluster.

[UX-REVIEWED] 54e8423

Description read

[DESCRIPTION-READ] 028cd5c4187cbd8ee342345274d18443305fbc73e3a7736964eb8a92229c1793

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 54e842366c121c71a2574e04d03dd773110f5424 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 54e8423

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 54e842366c121c71a2574e04d03dd773110f5424 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 54e8423

@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 21, 2026

@iamwhatever iamwhatever 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.

REQUEST_CHANGES. The code change is small and its test pins the new order, but the PR leaves the phone-layout record contradicting what now renders, and no review concern has a reply.

Reviewed head: 78285dc.

The defect: website/docs/narrow-viewport.md#L283 still says the phone header is 'the session title with the menu chevron flush after it' (

| centre (`minmax(0,1fr)`) | `pages/chat/page/SessionsSidebarChrome.tsx` through `pages/chat/page/MobileTopBar.tsx`, by `createPortal` into `#mobile-topbar-slot` | sessions toggle, then ONE control that is the session title with the menu chevron flush after it (`ChatHeaderMenu` `triggerLabel`); Rename and Regenerate title are items of that menu (`SessionActionsMenu` `onRename` / `onAutoTitle`), and it leads with "New chat in {folder}" (`ChatHeaderMenu` `newSessionHere`), which opens a sibling session in the on-screen session's folder with that folder's agent and project, and Rename swaps in the shared title editor. That menu leaves out its pop-out / focus-popped-out rows here (`omitPopout`): the trailing ⋯ menu is the phone's window menu and carries them, and the same row in two adjacent menus read as two different actions. Nothing else: the inline row's `InboundLinkChip` would be a third control, so a two-way link's actions are read from the session menu's Linked surfaces section |
). MobileTopBar.tsx#L96-L108 still says the chevron trails the title 'as on the approved mock' (
the menu chevron trails it, as on the approved mock — one control the
eye reads as "the session, and its menu". Rendered whenever the slot
exists, so the sessions toggle is in the bar even with no session open
(ChatPaneChrome's fixed corner button stands down); the title half needs a
session and is not drawn in split view, whose grid names each pane. */}
{topbarSlot && createPortal(
<>
{embedMode !== 'chat' && topbarSessionsToggle}
{activeSlot && !(splitMode && splitFeatureEnabled) && (
<div className="group/header flex min-w-0 flex-1 items-center gap-0.5" data-testid="mobile-topbar-title">
{/* ONE control for title + menu: the session menu's trigger carries
the title text with the chevron flush after its last character
(the approved mock), so the bar's centre holds two controls --
). The Opus lane flagged the doc. A later change that follows either record would undo this fix. Smallest fix: update both in this commit.

The same records raise a product question. Answer it on the PR before or with that fix:

  • UX: the trailing chevron was an approved mock. Confirm with its owner that the phone should change, and attach a capture of the real MobileTopBar at phone width that shows the sessions toggle next to the chevron.
  • First Principles: the move rests on symmetry with desktop. A maintainer ruling on #22655 that the sides should match would settle it.

CI is green.

— crew-pr-reviewer (r116)

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 21, 2026
@iamwhatever
iamwhatever force-pushed the fix/session-chevron-side branch from 78285dc to f2cb2b4 Compare October 26, 2026 09:58
@iamwhatever

Copy link
Copy Markdown
Contributor

Replies to the open review concerns, at head f2cb2b4 (rebased on latest main, plus one docs commit):

  1. Opus finding / crew-pr-reviewer (doc contradicts what renders) — fixed. website/docs/narrow-viewport.md now says the phone control is the menu chevron with the session title flush after it, in the same chevron-then-title order as the desktop header. The two MobileTopBar.tsx comments and the ChatHeaderMenu triggerLabel doc now say the same, so no record left in the tree describes the old trailing chevron.

  2. UX concern (the trailing chevron was an "approved mock") — needs a maintainer. The only record of that approval is the code comment; I could not find who approved the mock. A maintainer, or whoever owns the phone top-bar mock, should confirm that the phone may move to chevron-first. If they say no, this PR should be closed rather than changed.

  3. UX concern (screenshots crop out the sessions toggle) — still open. The phone bar is [sessions toggle][⌄ title] after this change, so the chevron now sits next to the toggle. A capture of the real MobileTopBar at phone width is still needed. That needs a running dashboard on a phone-sized viewport, which this worker cannot produce.

  4. First Principles concern (symmetry is the only reason) — needs a maintainer. The case for the change is consistency between desktop and phone, which Session menu chevron switches sides between desktop and phone #22655 states. A maintainer ruling on Session menu chevron switches sides between desktop and phone #22655 that both sides should match would settle this concern.

CI is re-running on the new head.

@iamwhatever

Copy link
Copy Markdown
Contributor

@kirodotdev maintainers: First Principles now BLOCKs at f2cb2b4. It says this PR reverses the "approved mock" (title first, chevron trailing) on the phone, and the only reason is matching the desktop order. Neither I nor the PR can show the mock was wrong. Only a maintainer can decide this.

If the phone should match desktop (chevron first), please post this override (draft, not posted by me):

/ai-review override first-principles f2cb2b4c34e1cf9499b6f7c580b3c6f5cf4adf86 move: maintainer decision — the phone session menu chevron leads the title to match the desktop header; this supersedes the earlier phone mock.

If the trailing chevron from the mock should stay, this PR should be closed instead.

Still open for UX (advisory): a capture of the full phone #mobile-topbar-slot row (sessions toggle + chevron + title), which needs a real dashboard at phone width.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 30, 2026
Pearcekieser and others added 2 commits October 30, 2026 02:37
narrow-viewport.md, MobileTopBar.tsx and the ChatHeaderMenu triggerLabel
doc still described the chevron trailing the title. Update them to the
chevron-then-title order the trigger now renders, so a later change
that follows the records does not undo the fix.
@Pearcekieser
Pearcekieser force-pushed the fix/session-chevron-side branch from f2cb2b4 to 54e8423 Compare October 30, 2026 06:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 30, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

[operator: bolichen97] Continuing this in #31406; thanks for the start.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Closing in favour of #31406, which continues this fix.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session menu chevron switches sides between desktop and phone

3 participants