Skip to content

fix(mobile): size session tabs to their titles - #28482

Closed
wutonglab wants to merge 3 commits into
stablyai:mainfrom
wutonglab:fix/mobile-session-tab-density
Closed

wutonglab wants to merge 3 commits into
stablyai:mainfrom
wutonglab:fix/mobile-session-tab-density

Conversation

@wutonglab

@wutonglab wutonglab commented Oct 14, 2026 •

Copy link
Copy Markdown

ELI5

Short mobile session titles use less horizontal space. Tabs still scroll horizontally when needed, so the last one remains reachable.

What Changed

Size tabs to their titles, with a 44 minimum and 128 maximum, and reduce side padding from 8 to 6. Let the scroll viewport and truncated text shrink beside the action buttons while preserving those buttons' sizes. Add the tablist/tab accessibility roles, full title labels and selected state. IDs, press/long-press handlers and active-tab reveal behavior are unchanged.

The patch is based on main at 8b0fa15. Final source: 841d24f. Only two UI files and three focused behavior tests change.

Why

Fixed 128-wide tabs waste space around short titles on narrow windows. In the rendered fixture, five tabs with agent icons use 311 pixels instead of 656. Horizontal scrolling already worked; this reduces how much scrolling is needed. Long titles still truncate and retain their full accessible labels.

Linked Issue

Fixes #28472

Visual Proof

Same generic header fixture in headless Chromium, 390 pixels wide. Native Android hardware has not been tested.

Before After
Fixed-width session tabs Content-sized session tabs

Testing

  • Independent review of the exact final source: no blocking findings or unresolved should-fix findings.
  • Changed-file formatting and mobile lint, mobile typecheck, tests-typecheck ratchet, changed-code-quality and max-lines checks pass in the review setup.
  • Related mobile tests: 21 pass across three files. All three new behavior tests fail on the unmodified baseline and pass with the patch.
  • Rendered React Native Web header: 9/9 checks pass with CDP touch at 320, 390 and 768, including icons, mixed tab types, long titles, scrolling, tap IDs, long press, active-tab reveal, resizing and a keyboard simulation.
  • The 390-wide icon fixture has content 311 / viewport 309: it slightly overflows. Wider/longer titles can require swiping; this does not promise every set fits on one screen.
  • Full repository tests and release build success are not claimed. Native Android, a Samsung foldable, a real IME and device font scaling remain unverified.

Review

The initial 4-pixel padding caused some Chromium edge taps to select a neighbour. Padding 6 removes the zero-radius regression and matches padding 8 in the checked cases. A large 30-pixel contact touching 2–4 pixels inside a short tab beside a long title still has two wrong-target results out of 128 synthetic cases, versus one on the fixed-width baseline. This edge-contact limitation is documented for hardware verification.

The missing tablist ancestor is fixed and covered by a behavior test. No server, protocol, host installation or app identity changes are included.

AI Disclosure

Prepared with Claude Code using its configured model, coordinated with Codex, and independently reviewed with Cursor Agent (Claude Opus 5.5 High).

Agent skill upstream boundary

  • This change copies no skill-installer source, fixtures or registry entries.

Checklist

  • Small UI-only diff with a linked issue and before/after screenshots.
  • Focused tests and independent source review completed.
  • Remote/SSH and protocol behavior preserved.
  • Full repository tests and release build pass; local validation limits are stated above.

wutonglab and others added 3 commits October 14, 2026 00:02
Session tabs were a fixed 128px wide, so on 320-390px screens five short tab names
overflowed the strip. Tabs now size to their title (min 44, max 128, no shrink) with
4px side padding; the scroll viewport can shrink beside the pinned + / Quick commands
buttons, which no longer shrink. Each tab exposes the tab role, selected state and its
full title.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Tabs had the tab role but no tablist ancestor, so assistive tech could not group
them; the scrolling strip now carries the tablist role. Side padding goes from 4px
to 6px: at 4px a touch a few pixels inside a tab's right edge could land on the next
tab, including with a small contact area. Tabs still size to their title, so five
icon tabs take about 311px instead of 648px.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@wutonglab
wutonglab marked this pull request as ready for review October 14, 2026 00:45
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7f7babea-6ef1-432a-8e2a-50f707ea7759
📥 Commits

Reviewing files that changed from the base of the PR and between 36e1291 and 841d24f.

📒 Files selected for processing: 3
  • mobile/src/session/MobileSessionHeader.tabs.test.tsx
  • mobile/src/session/MobileSessionHeader.tsx
  • mobile/src/session/mobile-session-frame-styles.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The mobile session tab strip uses content-based tab widths with a 44-point minimum, reduced horizontal padding, and a 36-point maximum height on its scroll container. Tabs and action controls have updated shrink constraints. The tab strip and tabs expose accessibility roles and selected state, and tabs use their titles as accessibility labels. Tests cover tab labels, tablist membership, and press and long-press handlers.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 841d2

The tab-sizing and accessibility changes are mergeable after normal checks; native-device behavior remains unverified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: sizing mobile session tabs to their titles.
Description check Passed The description covers the required sections, including user impact, implementation details, rationale, linked issue, visual proof, testing, AI disclosure, review notes, and validation limits. It clea…
Linked Issues check Passed The change satisfies the coding requirements in #28472. MobileSessionHeader.tsx uses a tablist, exposes each tab with a full-title accessibilityLabel, and reports selected state. `mobile-session…
Out of Scope Changes check Passed The changes stay within #28472. They modify only the mobile session header, its tab styles, and focused tab behavior tests. The accessibility additions and layout safeguards directly support the reque…
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#28472) has been resolved on main by #29222 (80e2c68058). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 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.

Mobile session tabs waste narrow-screen space with fixed 128px widths

2 participants