Skip to content

fix(terminal): pan a grid that is not the browser's own on a small screen - #241

Merged
devswha merged 3 commits into
mainfrom
fix/fixed-grid-pan
Oct 1, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/fixed-grid-pan

Conversation

@devswha

@devswha devswha commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closes #230

What was wrong

A terminal whose grid is not the browser's own was clipped by .pane-terminal { overflow: hidden } with no way to move it: an observe connection (the operator's grid) and a mirrored pane on a PC whose herdr cannot attach (pane-geometry with fixed: true). On a 390 px phone a wide grid showed its left part only, and the view sat at the top of the grid, so the prompt on the last rows was out of reach.

Gesture model

  • Adopted grid only (observing, or a fixed mirror): the mount scrolls (overflow: auto under data-adopted-grid). A one-finger drag pans it in both directions through the existing touch handlers (touch-action stays none); in a desktop window the wheel and the scrollbars pan it.
  • The view follows the cursor's row until the user pans: the top of the grid while that row fits there, else the bottom rows, where a prompt sits. A mirror has no cursor; xterm's rests on the last row with text. A new grid size, a role change or a resize of the mount (soft keyboard) takes the view back to that row.
  • A grid of the browser's own is untouched: overflow: hidden, the same fit, and a vertical drag is still the wheel that scrolls herdr's history. Nothing is lost on an adopted grid: an observer's wheel reports were already dropped (read-only) and a mirror reports no mouse, so a drag there scrolled nothing before.

No new control, setting or string.

Verification

scripts/windows-lens-browser-qa.ts now asserts, with real touch events (CDP Input.dispatchTouchEvent) at 390x844:

  • mirror: the view opens on the prompt's row; a drag brings the last column in, reaches the first cell, and brings the last row back; the page itself never scrolls
  • mirror in a 700x420 desktop window: the wheel pans to the last column and back
  • a normal attach on a phone: no data-adopted-grid, overflow: hidden, nothing to pan, and a drag down still scrolls herdr's history
  • an observer on a phone (role frame rewritten on the page's socket): opens on the cursor's row, pans to the operator's last column and back

Without the fix the script fails at "the view opens on the rows with the prompt".

Screenshots (local, /tmp/pan-evidence): before/windows-mirror-phone.png, windows-mirror-phone.png, windows-mirror-phone-panned-right.png, windows-mirror-phone-panned-top.png, windows-mirror-small-window.png, attach-phone-history.png, observe-phone.png, observe-phone-panned-right.png.

bun run typecheck, HERDR_TEST_MODE=unit bun test ./src (277 pass) and bun run test:ui pass. The first test:ui run timed out once in secret-input-regression.ts (the password field still attached after Send); the rerun passed.

Not verified

  • Real iOS Safari and Android Chrome: only headless Chrome with touch emulation was used. The pan has no momentum, since it is driven by the touch handlers rather than native scrolling.
  • A real Windows herdr: the mirror is the test herdr answering as one (terminalAttach: false).
  • Pinch or fit-to-width scaling from the issue's ideas is not part of this fix.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3dc407a6-cffa-4d39-92e8-3552ba450d67

📥 Commits

Reviewing files that changed from the base of the PR and between 8c04fbb and 093d07e.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • scripts/windows-lens-browser-qa.ts
  • src/components/PaneTerminal.css
  • src/components/PaneTerminal.tsx
 _____________________________________________________________________________________________________________
< Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. >
 -------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@devswha
devswha merged commit c3f7b59 into main Oct 1, 2026
2 checks passed
@devswha
devswha deleted the fix/fixed-grid-pan branch October 1, 2026 08:12
devswha added a commit that referenced this pull request Oct 1, 2026
Release v0.3.39: moves the Unreleased notes under 0.3.39 and bumps
`package.json` and `herdr-plugin.toml`.

In this release, all fixes: a password sent right after a reconnect
(#244), typing and keys outliving their connection (#235), panning a
terminal whose grid is not the browser's own on a phone (#241), omo's
question form in the chat (#237 by @nahwan-kim), and a held pane resumed
by a late herdr answer plus a new shell taken for OmO (#243). No remote
bundle change: `REMOTE_BUNDLE_VERSION` stays 9.

Changelog housekeeping that was waiting for a release:
- Compare links at the bottom now cover 0.3.31 to 0.3.39 (they stopped
at 0.3.30), and `[Unreleased]` compares from v0.3.39.
- Five references that were a bare `#N` are full PR links with their
author: #164 is the issue PR #199 fixed, #154 the issue PR #155 closed,
and #45 and #6 are PRs. No other wording of released entries changed.

`bun scripts/release-notes.ts 0.3.39` prints the notes and exits 0.
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.

A fixed-grid terminal (observe, mirrored Windows pane) cannot be panned on a small screen

1 participant