Skip to content

fix: adaptive terminal-grid scrolling based on usable row height - #1023

Open
web3dev1337 wants to merge 1 commit into
mainfrom
fix/terminal-grid-adaptive-scroll
Open

fix: adaptive terminal-grid scrolling based on usable row height#1023
web3dev1337 wants to merge 1 commit into
mainfrom
fix/terminal-grid-adaptive-scroll

Conversation

@web3dev1337

Copy link
Copy Markdown
Owner

Summary

  • Replaces the magic ">16 visible pairs" scroll threshold in updateTerminalGrid with a height-based rule: the grid becomes scrollable exactly when squeezing all rows into the viewport would push a terminal-pair row below a usable minimum height (200px — same floor the scrollable mode's grid-auto-rows: minmax(200px, auto) already uses).
  • Re-evaluates on window resize (debounced handler), so the decision adapts to the actual window instead of a fixed count.
  • Fixes both sides of the old cliff: ≤16 pairs on a short window no longer crush into unreadable slivers, and >16 pairs on a tall monitor no longer scroll unnecessarily.

Test plan

  • Workspace with 17 worktree pairs at ~900px height: grid scrolls with ≥200px rows (unchanged from before).
  • Same workspace on a taller window: scroll disappears once rows fit at ≥200px.
  • Workspace with ~10 pairs in a short window: grid now scrolls instead of crushing tiles.
  • node --check client/app.js passes.

🤖 Generated with Claude Code

… pair count

The grid used a hardcoded ">16 visible pairs" threshold: at 16 pairs on a
short window every terminal was squeezed into an unreadable sliver, and at
17 it abruptly started scrolling regardless of how tall the monitor was.
The toggle is now height-based — the grid scrolls exactly when sharing the
viewport would push rows under a usable minimum (200px, matching the
scrollable mode's existing row floor) — and is re-evaluated on window
resize, so tall/portrait monitors fit more rows unscrolled and small
windows stay readable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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