Skip to content

Fit the session picker to a phone screen (2.5.4) - #85

Merged
ESJavadex merged 1 commit into
ESJavadex:mainfrom
nsleigh:fix/picker-narrow-layout
Nov 12, 2026
Merged

ESJavadex merged 1 commit into
ESJavadex:mainfrom
nsleigh:fix/picker-narrow-layout

Conversation

@nsleigh

@nsleigh nsleigh commented Nov 8, 2026

Copy link
Copy Markdown

Low priority: this doesn't warrant a release on its own. It's a small
layout fix for something that has been bugging me on my phone, so it's
fine to hold it until the next release. Happy to rebase or renumber if
something else goes out first.

Problem

On a phone (portrait, about 45 columns) the session picker is hard to read:

  • the 64-column box banner wraps into a broken frame;
  • several options wrap onto a second line, e.g. "…conversation (" / "-c)";
  • option 4's ⚙️ runs into the text, and the line was sometimes drawn twice.

Fix

scripts/claude-session-picker.sh:

  • Narrow layout: below 64 columns, a one-line header
    (🤖 Claude Terminal · Session Picker plus a rule) and shorter labels.
    The Update option's version goes on its own line. Wider terminals look
    exactly as before, and the option numbers are unchanged.
  • Width from stty size: the image has no tput (no ncurses tools).
  • Redraw on resize: at start-up the menu is drawn before any browser
    is attached, at tmux's default 80 columns. While it waits for a choice,
    the picker checks the width each second and redraws when it changes.
    Typed text stays in the terminal's line buffer until Enter, so it isn't
    lost. This also covers resizing a window or rotating the phone.
  • 🔧 for option 4: ⚙️ (with the emoji selector) is one cell wide in some
    terminals and two in others. With one space it touched the text, with two
    it left a gap (the CHANGELOG shows it has gone back and forth before).
    🔧 is always two cells, like the other icons. DOCS.md updated to match.
  • The script only runs main when executed, so the tests can source it.

Tests

New tests/test-session-picker.sh (added to run-tests.sh):

  • at 45 columns, every line fits (emoji counted as two cells), with no box;
  • at 80 columns, the box and the full labels are unchanged;
  • with and without the Update option (use_persistent_claude);
  • option 4 uses 🔧, never ⚙️.

The resize redraw was also checked in a real Linux pty: drawn at 80
columns, shrunk to 45, the picker switched to the narrow layout by itself.

Tested

On Home Assistant OS, through ingress:

  • iPhone, Home Assistant app: the compact layout shows and fits.
  • Mac browser: the wide layout as before. A narrow window gets the
    compact layout, and option 4 lines up in both.

🤖 Generated with Claude Code

https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6

The picker's box banner and menu labels need 64 columns; a phone in
portrait shows about 45, so the frame broke up and options wrapped.

Below 64 columns, show a one-line header and shorter labels, with the
Update option's version on its own line. Wider terminals are unchanged.
The width comes from `stty size` (the image has no tput), and the menu
redraws when it changes: at start-up it is drawn at tmux's default 80
columns before any browser attaches.

Option 4 uses 🔧 instead of ⚙️, which is one cell wide in some terminals
and two in others, so no spacing after it lined up everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6
@ESJavadex
ESJavadex merged commit 4a86152 into ESJavadex:main Nov 12, 2026
6 checks passed
@ESJavadex

Copy link
Copy Markdown
Owner

Thanks, @nsleigh — I reviewed the narrow-width layout, resize redraw, and regression coverage. CI is green across browser, checks, lint, and both architecture builds. This is a focused, useful phone fix; merged as 2.5.4.

@nsleigh
nsleigh deleted the fix/picker-narrow-layout branch November 13, 2026 08:35
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.

2 participants