Skip to content

fix(mobile): show the session title beside the tabs on a landscape phone - #30879

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/mobile-landscape-title-width
Oct 21, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/mobile-landscape-title-width

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

On a phone turned sideways, the session screen's top bar holds the workspace title on the left and the tab strip beside it. Right now the title is missing there: the tabs take the whole bar and you can't see which workspace you're in. This puts the title back.

What Changed

  • Before: on a landscape phone with open tabs, the title block in the top bar is zero pixels wide. The workspace name and its status line (connection dot, tab count) are gone.
  • After: the title shows at its natural width, up to 160 points, and the tab strip gets the rest of the bar. A long title still truncates, and the title shrinks only when the bar runs out of room.

Mechanism: the title block's landscape style (sessionTitleBlockBesideTabs) used flex: 0 plus flexShrink: 1. The session screen ships as a web page inside the phone app, and on the web flex: 0 means a flex basis of 0%. A block with zero basis and no growth is zero wide. flex: -1 is the one value that means "natural width, shrink when needed" on both the web renderer and native layout: react-native-web expands it to grow 0, shrink 1, basis auto.

Why

This is a regression from the landscape top-bar change (#29070) and the follow-up that sized tabs to their titles (#29222). They were checked against native layout, where flex: 0 behaves differently. Listing grow, shrink and basis separately doesn't work here, because the base title style's flex: 1 would still decide the layout on native. flex: -1 replaces that shorthand with one that means the same thing on both renderers.

Linked Issue

Found in QA for #30389 (tracked there); no separate issue.

Visual Proof

b686ffa

PASS — real served mobile page inside the signed iOS app shell, checked October 20, 2026 with Codex CLI on iPhone SE (3rd generation) and iPhone 17 Pro, iOS 26.5. Same two worktree sessions and two terminal tabs on main and the PR: qa and a 60-character workspace name. Main reproduces the missing landscape title; the PR restores the name and status line.

Phone / landscape session Main ef950401d3be7fdd44c44ebbeb4f196fdcbda165 PR b686ffa83aad98dbd950b02063d8b6a16290e4c8
iPhone SE, short title main-se-short-landscape-oriented.png branch-se-short-landscape-oriented.png
iPhone SE, long title main-se-long-landscape-oriented.png branch-se-long-landscape-oriented.png
iPhone 17 Pro, short title main-pro-short-landscape-oriented.png branch-pro-short-landscape-oriented.png
iPhone 17 Pro, long title main-pro-long-landscape-oriented.png branch-pro-long-landscape-oriented.png

PASS on both phones: the short title block is about 51 pt wide; the long title block is 160 pt with an ellipsis (measurements from screenshot dividers and device scale). The connection dot and tab count are readable; tabs use the remaining space; Files, Source Control, and More stay on screen. The SE overflow strip moves about 50 pt after a horizontal swipe. The Pro’s two capped tabs fit, so overflow scrolling there was not tested; the swipe caused no regression.

Additional check iPhone SE iPhone 17 Pro
PASS — portrait, title above its separate tab row Short · Long Short · Long
PASS — landscape with no tabs, title fills available bar Short · Long Short · Long
PASS — title-area tap leaves session open, no action or crash Main · PR Main · PR

Main has no visible title target; its collapsed title position was tapped. On the PR the visible title text was tapped. Both sessions remained unchanged.

Build-id footers distinguish the served builds: main a5cb235c7062 (full ID a5cb235c706255973de451241ebdf00c40a1416fe93e3a861d962ef861688019), PR 5448facea553 (full ID 5448facea55334023e89cb57130cdffd2041bf75f5df75d845f483affe29dbc8). The hidden desktop was built at main and restarted after the PR mobile-web rebuild to clear its cached manifest; both phones then displayed the PR footer. Landscape proof images are orientation-only copies of original simulator screenshots.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

The change is one style value whose effect is in the rendered layout, which unit tests with mocked React Native can't see. It's verified by real landscape QA of the served page inside the phone app (screenshots above).

Review

Review path

Light path, per criterion:

  1. Small: 1 production file, 3 lines added and 2 removed (mobile/src/session/mobile-session-frame-styles.ts).
  2. Outside the risky areas: one layout style value. No lifecycle, saved data, ordering, wire, processes, auth or orchestration.
  3. Not a repeat: the file's history (fix(mobile): put the session tabs in the top bar on a landscape phone #29070 and fix(mobile): one button style for the session header and tab strip; size tabs to titles #29222 in the last 30 days) added this style. Nothing in it fixed this symptom before, and there's no revert.
  4. Local effect: layout of one header block on landscape phones.

Plan: change the shorthand to flex: -1, then check it in real landscape QA of the served page inside the phone app (two phone sizes, short and long titles, two tabs), main against the branch.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile only. Portrait and tablet layouts don't use this style. No desktop, SSH or wire impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

The served session page (react-native-web) reads flex: 0 as flex-basis 0%,
so the title block collapsed to zero width beside the tab strip. flex: -1
is natural width capped at 160, shrinking only when the row overflows, on
both web and native.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 19, 2026 21:21
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d90572ac-b4c7-43ce-a9fb-2be242659db4
📥 Commits

Reviewing files that changed from the base of the PR and between 55bfb69 and 7bb157e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: 10f92af0-4a5d-4886-a178-aba4fad59809
📥 Commits

Reviewing files that changed from the base of the PR and between ec44a50 and 55bfb69.

📒 Files selected for processing: 1
  • 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; 3 remain after this review.

📝 Walkthrough

The sessionTitleBlockBesideTabs style now uses flex: -1 instead of flex: 0 with flexShrink: 1. The change preserves natural title width and allows shrinking when the row overflows.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 55bfb

The localized layout change has no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: restoring the session title beside tabs on landscape phones.
Description check Passed The description is mostly complete and follows the required template. It explains the user impact, mechanism, rationale, linked issue context, visual proof, testing, scope, and compatibility considera…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is mostly complete and follows the required template. It explains the user impact, mechanism, rationale, linked issue context, visual proof, testing, scope, and compatibility considerations. Minor checklist inconsistencies remain, but they do not prevent review.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches: 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

@brennanb2025

brennanb2025 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

On landscape phones with tabs, the session title disappeared because the web renderer treated flex: 0 as a zero-width starting size. This change restores the title and connection/tab-count line at their natural width, capped at 160 points, while tabs use the remaining space.

Review complete on b686ffa — light path. One fresh adversarial reviewer confirmed all four light-path criteria, traced the header and tab layout, and completed the performance, compatibility and readiness checks. No production-code findings or fix round. Exact-version react-native-web compiler execution and Yoga source inspection confirm the intended sizing on web and native. The PR description was corrected to avoid claiming a new tap action; the served page title remains noninteractive.

Validation: owner-run QA passed in the real served page inside the signed iOS shell on iPhone SE and iPhone 17 Pro: two tabs, short/long workspace names, portrait, landscape without tabs, and title-area taps. SE overflow scrolling passed; the Pro's two tabs fit, so overflow was not exercised there. Full PR workflow passed on this exact head, including static analysis, the mobile web bundle and PR checks passed. GitHub reports CLEAN/MERGEABLE. No open code findings or deferred fixes. Android and native Yoga rendering were not run; native semantics were checked in source.

For Brennan's review

Landscape input Main PR
SE, short title Main SE short PR SE short
SE, long title Main SE long PR SE long
17 Pro, short title Main Pro short PR Pro short
17 Pro, long title Main Pro long PR Pro long

Additional portrait, no-tab and tap comparisons are in the PR Visual Proof. The only changed sizing decision is the negative flex shorthand with the existing 160-point cap.

Final sync: merged main into the branch twice. The first merge brought in #31169 (tab icon sizing, same styles file); the second brought in #31260, which fixed main's zod mismatch that had failed the e2e typecheck ratchet. Neither merge changed this PR's own diff, which is still the one-value flex: -1 change. CI is green on the merged head 7bb157e.

@brennanb2025
brennanb2025 merged commit 03f4ce3 into main Oct 21, 2026
23 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/mobile-landscape-title-width branch October 21, 2026 04:11
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.

1 participant