Repository navigation
fix(test): read the header crumb apart from the session line in the reconnect regression - #2937
Merged
Merged
Conversation
…econnect regression #2909 added a second .context-sub (.context-session) under the pane title, so the reconnect header regression's crumb locator matched two elements and Playwright's strict mode failed it on main. Target the crumb alone; the product already hides the session line while the connection word shows.
|
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 3 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. |
Owner
Author
|
Local merge gate (owner-approved): test-only fix; the script failed on main and passes at 390/412/1280; check fast green; omo CLEAR. Merged without waiting for GitHub CI to unblock main's browser lane. |
This was referenced Nov 5, 2026
devswha
added a commit
that referenced
this pull request
Nov 5, 2026
… pictures included, behind a Settings toggle (#2908) ## What Settings > Terminal > **Draw with libghostty** (off by default, this device only). On a PC that runs herdr-core, as the desktop app does, a pane is drawn by [libghostty-vt](https://github.com/ghostty-org/ghostty) (Ghostty's terminal core, MIT) instead of xterm.js's own text layer, and the pictures a program sends with the **Kitty graphics protocol** are drawn: `chafa -f kitty`, `timg -pk`, `kitten icat --transfer-mode=stream`. xterm stays the engine underneath: it still takes every key, IME syllable, paste, click, selection, link, search and scroll, and still answers the program's queries. Its text and cursor layer is hidden; libghostty draws the same bytes, in the same order, as plain DOM rows over xterm's screen at xterm's cell size, plus a canvas per Kitty placement (below or above the text, as Kitty's z says). libghostty answers nothing: a reply it made to a replayed stream would reach the program as typing (herdr-core already answers size queries itself). This complements #2871 (sixel and iTerm2 through `@xterm/addon-image`, which has no Kitty graphics): libghostty has no sixel, the addon has no Kitty, and the two layers do not overlap. ## How - `src/lib/ghostty/ghostty-vt.wasm`: libghostty-vt at ghostty e95bed6 for wasm32, rebuilt by `scripts/ghostty-vt/build.sh` with `kitty-on-wasm.patch`. Upstream turns Kitty graphics off on freestanding wasm; the patch turns it on, refuses the file / temp-file / shared-memory media (no filesystem in a browser), and links ghostty's bundled wuffs PNG decoder. 1.11 MB (345 KB brotli). The build now writes .br/.gz copies beside it, but the server still serves precompressed copies for js/css only, so today the module goes out uncompressed (follow-up below). Notices for ghostty, wuffs and uucode in THIRD_PARTY_NOTICES.md. - `src/lib/ghostty/capture.ts`: from the terminal's mount (setting on), every byte xterm is given is held; once the server lists its features and says `terminal-history` (herdr-core), the overlay module is loaded and starts from those bytes. herdr's own server, a module that fails to load, or more than 32 MB held leave the terminal to xterm and never fetch the module. - `src/lib/ghostty/vt.ts`, `overlay.ts`: the wasm wrapper (rows as styled runs, the render state's Kitty image list, palette from the xterm theme, scroll sync with xterm's own herdr-core history) and the DOM layer. Each cell carries its own grapheme and width, so a combining mark never shifts a wide cell. - CSP: `script-src 'self' 'wasm-unsafe-eval'` (the same line #2871 adds), so the page may compile WebAssembly; no string eval. - The choice applies to a pane the next time it is opened (the description says so): libghostty must see the stream from its first byte. Design reference: Ghostty's own split of a terminal core (libghostty-vt) from the renderer an app draws with, rather than a second terminal widget; everything already built on xterm keeps working while the drawing moves. Clean-room from ghostty's public MIT source. ## Validation - `bun run check fast`: pass (exit 0) on 312eb94 (merged with origin/main 22a4b33, #2871 and #2937 included). `check full` not run here; CI runs the browser lane. - `bun scripts/terminal-ghostty-demo-regression.ts` (new, added to `scripts/ci-browser.sh`): a herdr-core pane is drawn from its first byte (printed before the module loaded), a Kitty picture is drawn at its row and goes on `a=d`, a wide cell after a combining accent stays the CJK character (fails on the first head), ANSI red under a palette that names no ANSI colours is xterm's red (fails before 8189fde), typing still reaches the pane through xterm; on herdr's own server and with the setting off nothing is drawn by libghostty and the `.wasm` is never fetched. - `bun test src/lib/settings.test.ts server/static.test.ts server/static-encoding.test.ts scripts/compressed-assets.test.ts scripts/changelog-fold.test.ts`: pass. - Manual, isolated hc 0.1.17 core (own HC_SESSION, XDG dirs, socket) + this branch's server on loopback, headless Chromium at 1280x800 and 390x844: chafa / timg / icat (stream) pictures drawn; with the setting off xterm draws none; resize (rows match xterm), wheel through history (top 10 rows identical to xterm's), drag selection + copy + Quote, Korean text input, `less` alternate screen and back. - Known, not in this PR: `kitten icat` in its default mode gives up because herdr-core answers the DA1 query on the server before the browser's Kitty reply arrives, and hc gives the pty no pixel size; those are herdr-core-side. ## Follow-ups (this PR is step 0) The end state is one rendering path: libghostty draws every terminal, on herdr-core and on herdr, and xterm's drawing code goes. 1. **Default on for herdr-core** once: the two renderers match row text and cell colours across the themes (a two-renderer browser regression); light-theme contrast correction matches xterm's minimumContrastRatio 4.5; cursor and selection positions match for emoji, CJK, combining marks, Nerd icons and box glyphs; link hover underline and cursor blink are drawn. 2. **herdr mode too, then drop xterm's drawing**, gated on: - serve the module's precompressed copy (server/static.ts compresses js/css only today); - phone first load: the extra 345 KB brotli adds at most 0.5 s to the first terminal text on an emulated 4G phone with a 4x CPU slowdown (median of 5, off vs on); - repeat loads: 0 wasm bytes on the second visit and across a build that keeps the module (the service worker serves `/assets/` cache-first and carries a same-named file into the new build's cache); - iOS long-press select and copy on the libghostty rows (iOS Simulator script); - screen readers: VoiceOver and NVDA read new output and walk the rows (the layer is aria-hidden today); - low-end phone frame time under runaway output at a 6x CPU slowdown: no more 50 ms stalls than xterm, p95 frame gap at most 33 ms. Then input, selection and search move to libghostty's key encoder, selection and search APIs, and xterm's parser and renderer are removed.
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.
Summary
scripts/reconnect-header-demo-regression.tsfails on main (reproduced onea3b07fa):#2909 added the session line (
.context-sub.context-session) under the pane title, so the regression's crumb locator now matches two elements. The product is right: the session line is a second row thatApp.tsxalready hides while the connection word (Reconnecting…/Connected) has the crumb's place. Only the test's locator was too broad, so this PR narrows it to the crumb:.context-sub:not(.context-session).No product code changes.
Validation
bun scripts/reconnect-header-demo-regression.ts: failed before (strict mode violation above), passes after:PASS 390,PASS 412,PASS 1280.bun run check fast: passed (workflow syntax, generated types/themes, typecheck, build, unit tests: 11869 pass, 0 fail, 46 skip)bun run check full(test-only change to a single browser script; CI's Integration and browser job runs it).