Skip to content

Use the phone layout sideways, and add Zen mode on phones - #599

Open
thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/phone-landscape
Open

thiblahute wants to merge 1 commit into
powerfooI:mainfrom
thiblahute:upstream/phone-landscape

Conversation

@thiblahute

Copy link
Copy Markdown
Collaborator

Summary

A phone held sideways gets the phone layout instead of the desktop one, and Zen mode works on phones: it hides the top bar and keeps the bottom bar, with Exit Zen mode in More options.

Why

The layout followed the window's width alone. A phone on its side is about 915 by 412, wider than the mobile breakpoint, so it got the desktop layout: the top bar, the workspace sidebar and the tab bar, leaving little room for the pane on a 412px tall screen. Zen mode, which gives the pane the most room, was desktop only: Settings hid its switch on phones.

What changed

  • layoutPreferences.ts: in Automatic layout, a touch screen (pointer: coarse) at most 500px tall counts as a phone however wide. An explicit Desktop choice (or ?layout=desktop) still wins. Re-evaluated on every resize, so turning the phone switches layouts.
  • ConfigMenu.tsx: the Zen mode switch shows on phones too.
  • App.tsx: on a phone, Zen mode adds phone-zen to the app, and More options offers Exit Zen mode while it is on, since Settings is in the hidden top bar.
  • mobile-nav.css: on a phone, Zen hides the top bar; the bottom bar and its buttons stay. A chat's slim header takes the safe-area padding only in Zen mode.
  • A chat on a phone now keeps the top bar outside Zen mode (it hid it always, which looked like Zen with Zen off). Zen mode gives the old full-height chat back.
  • FEATURES.md: the landscape rule and phone Zen mode.

Verification

  • bun test web/src/layoutPreferences.test.ts: a 915px wide short touch screen resolves to the mobile layout in Automatic, and to desktop when Desktop is chosen.
  • bun run format:check, bun run lint (only the existing TerminalView.tsx warning), bun run typecheck:bun, bun run build:web.
  • bun run test:quick with an isolated HOME/TMPDIR: the only failures are the two zsh tests (no zsh here), the worktree-removal process-scan timeout, and timeouts under load that pass when rerun alone.
  • Asset budget: initial JS 832.6/833 KiB, gzip 256.8/257 KiB, CSS 189.0/196 KiB (main: 832.3 and 256.7); no budget change.

Manual checks

  • A phone turned sideways switches to the phone layout, and back to it upright.
  • A tablet or laptop with a touch screen taller than 500px keeps the desktop layout.
  • Zen mode on a phone, from Settings: the top bar goes, the bottom bar stays, More options shows Exit Zen mode, which brings the top bar back.
  • A chat on a phone keeps the top bar outside Zen mode and drops it in Zen mode.

Compatibility

No stored format changes; Zen mode uses the existing preference. The visible change outside Zen mode is that a phone chat keeps the top bar.

The layout followed the window's width alone, so a phone turned on its
side (about 915 by 412) got the desktop layout: the top bar, the
workspace sidebar and the tab bar, leaving little room for the pane. In
auto mode, a touch screen at most 500px tall now gets the phone layout
too, however wide. An explicit desktop choice still wins.

Zen mode was off on phones, and Settings hid its switch there. The switch
now shows on phones too: Zen hides the top bar, keeping the bottom bar
and its buttons, and the More options menu offers Exit Zen mode while it
is on, since Settings is in the hidden top bar. A chat keeps the top bar
outside Zen mode.
@github-actions github-actions Bot added the enhancement New feature or request label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant