Repository navigation
feat(terminal): fit 80 columns in a narrow split pane - #824
Merged
Merged
Conversation
A split pane under 80 columns draws its terminal in the largest smaller whole-pixel font that gives it 80, never below 10px, so a program that refuses a narrower screen (btop) still draws. A pane alone in its tab or zoomed, one that 10px cannot bring to 80 columns, and one this browser only watches or mirrors keep the user's size, and the saved size never changes. Settings -> Terminal -> Fit 80 columns in a split pane turns it off.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
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. Comment |
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
## Change The pull request template and `CONTRIBUTING.md` asked every UI change to attach a screenshot or recording. The maintainer does not review from those images, and a PR opened from the command line cannot attach one, so recent PRs (#823, #824) carried a note saying the images were captured but not attached. Remove the requirement from both places. Unchanged: the rules about where a capture comes from when someone does make one (`AGENTS.md` and `CONTRIBUTING.md`: a demo or test session, never a live one). ## Validation Documentation only. `git diff` touches one sentence in `.github/pull_request_template.md` and one in `CONTRIBUTING.md`; a search of `.github`, `CONTRIBUTING.md`, the `AGENTS.md` files and `docs/development.md` found no other place that asks for an attachment. ## Release No app or runtime change.
devswha
added a commit
to sobir-git/herdr-web-ui
that referenced
this pull request
Oct 11, 2026
main added a browser script (devswha#824) and raised the lane's expected count to 34, the same number this branch already used for its own script, so the two edits merged without a conflict and left the count one short. It is 35 now.
This was referenced Oct 11, 2026
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
## Change `scripts/ui-regression.ts` could fail with every check passing. On #824 the first CI attempt ended with ``` 451 | await route.fulfill({ response, json: body }); error: fulfill: Route is already handled! ``` after the check that owns that route had printed PASS; a rerun of the same commit passed. The handlers in question await `route.fetch()` before they answer, and the app polls `/api/machines` on its own, so a call can be in flight whenever a check ends. `page.unroute` does not wait for it. When the route taken away is the page's last one, Playwright drops the page's interceptor and continues the request on the server side; the handler's own `fulfill` then finds the route handled. The rejection travels through Playwright's event listener, outside every assertion, and Bun exits 1. `scripts/drained-route.ts` adds `routeDrained(page, url, handler)`: it registers the route and returns an unroute that first waits for the calls in flight (15 s deadline), then removes that handler. It is used at: - `ui-regression.ts`: the held stale poll, the BG status check, and the plan check on the desktop page and on the phone (its context is closed right after). - `tab-menu-regression.ts`: the pending-selection check, which unrouted first and waited for its handlers afterwards. Not used, on purpose: `unrouteAll({ behavior: "wait" })` has the same race between two calls in flight (playwright-core 1.63) and removes unrelated routes; `"ignoreErrors"` and a `.catch(() => {})` would hide a handler's real failure. A handler that throws still fails the unroute here. Left alone: `tab-menu-regression.ts:292` and `terminal-copy-regression.ts:176` only race in a failure's cleanup, and five scripts close a context with a fetched route registered (a different error, if any). #806 moves the `ui-regression.ts` sites into `ui-regression-palette.ts`; it needs this carried over when it is rebased. ## Validation - Reproduction (throwaway script, local Chrome): two requests in flight, then `page.unroute` → `fulfill: Route is already handled!` twice as unhandled rejections; the same with `routeDrained` → both fulfilled, no rejection; a handler that throws → the unroute rejects with that error. - `TMPDIR=/tmp CHROME_PATH=<lockfile Chromium> bun run check run --build bun scripts/ui-regression.ts`: exit 0, 115 PASS lines, on an isolated herdr (this includes `checkTabMenu`). - `bun run typecheck`: passed. - The diagnosis and the fix were reviewed read-only against playwright-core's source (`Route.removeHandler` continuing the request, `_startHandling`'s assertion). The original failure is rare (one of the last 26 failed CI runs), so a passing run does not prove its absence; the reproduction is what shows the race gone. ## Release Test scripts only; no app, contract or runtime change.
alexanderkreidich
added a commit
to alexanderkreidich/t-rex-ovis-fork
that referenced
this pull request
Oct 23, 2026
Opening a split changed how the terminal looked: the text in both halves got smaller, and grew back once the pane was alone again. On a 1450px window the demo client drew a split pane at 10px instead of 13px. The cause was upstream's "fit 80 columns in a narrow split pane" (devswha#824): any pane drawn beside another that had fewer than 80 columns at the user's size was drawn at the largest smaller size that gave it 80, down to 10px. Upstream later removed the setting that turned it off (devswha#1099), so every split under 80 columns shrank and nothing could stop it. Every pane now draws at the user's terminal font size, alone or split. A program that needs 80 columns (btop) gets them from a zoom, a wider split or a smaller size in Settings. Removed: lib/narrowPaneFont.ts and its unit test, the `split` prop of PaneTerminal and the split flag PaneCanvas passed to renderPane, the refit that ran when that flag changed, the font resets on observe and on a fixed grid (they only undid the shrunk font), and the browser lane's narrow-pane-demo-regression.ts. DESIGN.md states the new rule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Splitting a window can leave a pane a few columns short of 80, and a program that needs 80 columns then refuses to draw: btop in a 72-column pane shows only its "terminal size too small" notice. Until now the way out was to drag the divider, zoom the pane or lower the font size in Settings.
A split pane that would have fewer than 80 columns at the user's font size now draws in the largest smaller whole-pixel size that gives it 80, never below 10px. It returns to the user's size as soon as it is wide enough.
baseFontRefholds the user's size (Settings, or a pinch in progress) apart from the size drawn.Each pane already fits its own xterm and sends its own grid for its pty, and herdr's layout rectangles are not pty dimensions (
DESIGN.md), so a pane sending 80 columns for a rectangle 72 cells wide does not move the layout or the divider math. The pty is shared as before: herdr's own TUI shows such a pane at the grid this client set.Known limit: with the setting on, a pinch in a narrow split pane saves the size its badge shows, but the pane stays at the size that fits 80 columns until it has the room.
DESIGN.mdsays so.Validation
bun run typecheck: passed.bun scripts/narrow-pane-demo-regression.ts(new, added toci-browser.sh): passed on the unmodified client over the demo transport. It reads the drawn font and the columns each pane sends for its pty through: a pane alone, a wide split, a split under 80 columns (11px for 80 columns at a 1450px window), the setting off and on again, a split no font can bring to 80, a zoom and unzoom, and the split widened; it also asserts the smaller size is never the saved one.bun scripts/settings-pages-demo-regression.ts: passed (the Terminal page with its new row fits 390px and 320px phones in en, ko, ja and zh).bun run test:unit: 2676 passed, 4 failed. The four also fail onmainat 6e77292 on this macOS / Bun 1.4.0 host and are unrelated:scripts/check.test.ts(3): the temporary unix socket path is 120 characters, over the 100-character limit.server/voice.test.ts:229(1): expected multipart filenameaudio.webm, receivedclip.webm.src/lib/narrowPaneFont.test.ts(the size chosen, the 10px floor, the unreachable case) and asettings.test.tscase for the new setting.PaneTerminal.tsx; its two findings (a shrunk font surviving a fixed or observed grid; no way to opt out) are fixed here.Not run locally: the integration suite and the rest of the browser lane (left to CI), and btop itself in a live herdr session. The fixed-grid and observe paths were checked by reading the code, not in a browser.
Release
Client-side change; no HTTP/WS contract or remote runtime bundle change. The new setting defaults to on, so installed users get the smaller font in narrow split panes with the app release containing this PR.