Repository navigation
fix(remote): what rendering the client role's screens for real turned up - #983
Merged
Merged
Conversation
The screenshot harness renders the real app (real CSS, real bundle, real input events) and had not been run against this feature — there was no scenario for any client-role screen. Running it found six defects, one of them mine from the first PR and none of them visible to the jsdom suite. **1. The harness was rendering blank pages, for every scenario.** `remote_peer_list` was read straight into React state, so a backend that answers `null` — the harness mock does, for a command it does not implement — put `null` into `peers`, and the first screen that rendered it (`peers.map`) threw during render and took the *whole application* down. Not just the remote screen: every capture since #955 produced a white rectangle, and nobody noticed because no scenario runs in CI. Validated at the helper boundary now (an empty list is the honest reading of "no answer"), with a test. **2. A turn that ran several tools showed only the first.** The transcript did `blocks.find(tool_call)`, so a turn that ran `read` then `shell` rendered one row — and the second call's arguments were never fetched, so the line that says what the machine actually ran was simply missing. One row per call now, each fetching its own target, with the fixture updated to a two-call turn (the old fixture had one tool per turn, which is why the tests agreed with the bug). **3. The local conversation tree disappeared in merged mode.** Merged mode turns on as soon as *any* host is connected, and it passed neither `depth` nor `hasChildren` to the local rows: forks rendered as roots, with no indent and no fold toggle, so a user with a host connected lost their tree. The rail now keeps each local row's place, and collapsing a parent hides its forks exactly as the local list does — a toggle that renders but does nothing would have been worse than no toggle. **4. The client direction's explanation was printed twice** on the Remote page: the hub renders it as the section subtitle and the section rendered it again. The host half had been fixed in the same PR that introduced this; only the client half was missed. **5. A button's label wrapped into two stacked lines.** The host-settings "保存" button measured 44×32 with the label on two line boxes (保 over 存) — the shared `Button` had no `whitespace-nowrap`. Now it does, with a test; a control whose label is unreadable is not a control. **6. The device selector had no accessible name.** Its visible name starts with a decorative glyph, so the control's accessible name was the emoji — unreadable to a screen reader and unaddressable by label. `aria-label` added. **Verified as *not* defects, by measurement rather than by eye.** A visual read claimed the remote conversation's header overlapped its compress button and that the button contained an overlapping icon. Measured: the header does not overflow (`scrollWidth == clientWidth`) and no two children's boxes intersect; the button renders no icon at all (it is `{t("compact")}` and nothing else). Both claims were artefacts of a magnified crop, and I left the code alone. **Two scenarios were also broken** by the #965 rename of the rail entry — they still tapped "手机遥控" — which is what a scenario file nothing runs in CI does. **New scenarios (desktop):** `remote-hub`, `remote-merged`, `remote-device-picker`, `remote-conversation`, `remote-host-settings`, `remote-host-tasks`, each with `eval` assertions against the rendered DOM: both directions named, this machine's and the host's conversations interleaved, a row naming its host, a remote composer saying where the message runs, tool targets read back, the host's model in the picker, no API key anywhere in the UI, and no duplicate explanation. The harness's desktop mock gained the client-role commands (peers, catalogues, workspaces, the routed `remote_peer_request` family) and a two-host fixture — one connected, one disconnected, because "a host that is not reachable" is a state the list has to survive. 11/11 scenarios captured (7 new, 4 pre-existing as a regression net) with every assertion passing, and 3679 tests with 0 uncovered lines added.
huichen
enabled auto-merge (squash)
October 11, 2026 06:15
CI lints `shot/**` as well as `src/**`; my local run only covered src, so this reached CI. Running the project's own lint script (which is what CI runs) is the scope that matters — the same lesson as clippy's --no-default-features earlier.
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.
What
The screenshot harness renders the real app — real CSS, real bundle, real input events — and had never been run against the client role: there was no scenario for any of its screens. Running it found six defects, one of them from the first PR of the series, and none of them visible to the jsdom suite.
1. The harness was rendering blank pages, for every scenario
remote_peer_listwas read straight into React state, so a backend answeringnull— the harness mock does, for a command it does not implement — putnullintopeers, and the first screen that rendered it threw during render and took the whole application down. Not just the remote screen: every capture since #955 was a white rectangle, and nobody noticed because no scenario runs in CI.Validated at the helper boundary now: an empty list is the honest reading of "no answer".
2. A turn that ran several tools showed only the first
The transcript did
blocks.find(tool_call), so a turn that ranreadthenshellrendered one row — and the second call's arguments were never fetched, so the line saying what the machine actually ran was missing. One row per call now, each fetching its own target. The old fixture had one tool per turn, which is exactly why the tests agreed with the bug.3. The local conversation tree disappeared in merged mode
Merged mode turns on as soon as any host is connected, and it passed neither
depthnorhasChildrento local rows: forks rendered as roots, with no indent and no fold toggle. Every user of the client role silently lost their tree. The rail now keeps each local row's place, and collapsing a parent hides its forks exactly as the local list does — a toggle that renders but does nothing would have been worse than none.4. The client direction's explanation was printed twice
The hub renders it as the section subtitle and the section rendered it again. The host half was fixed in the same PR that introduced this; only the client half was missed. Now guarded by an assertion that the sentence appears exactly once.
5. A button's label wrapped into two stacked lines
The host-settings "保存" button measured 44×32 with two line boxes (保 over 存): the shared
Buttonhad nowhitespace-nowrap. A control whose label is unreadable is not a control.6. The device selector had no accessible name
Its visible name starts with a decorative glyph, so the control's accessible name was the emoji — unreadable to a screen reader, unaddressable by label.
aria-labeladded.Verified as not defects, by measurement rather than by eye
A visual read claimed the remote conversation's header overlapped its compress button, and that the button contained an overlapping icon. Measured: the header does not overflow (
scrollWidth == clientWidth), no two children's boxes intersect, and the button renders no icon at all ({t("compact")}and nothing else). Both claims were artefacts of a magnified crop; the code is unchanged.Also
Two scenarios were broken by the #965 rename of the rail entry — they still tapped "手机遥控" — which is what a scenario file nothing runs in CI turns into.
New scenarios (
remote-hub,remote-merged,remote-device-picker,remote-conversation,remote-host-settings,remote-host-tasks), each withevalassertions against the rendered DOM: both directions named, this machine's and the host's conversations interleaved, a row naming its host, a remote composer saying where the message runs, tool targets read back, the host's model in the picker, no API key anywhere in the UI, and no duplicated explanation. The desktop mock gained the client-role commands and a two-host fixture — one connected, one disconnected, because "a host that is not reachable" is a state the list has to survive.Verification: 11/11 scenarios captured (7 new + 4 pre-existing as a regression net) with every assertion passing; 3679 tests;
tsc/eslint/stylelintclean; 0 uncovered lines added.Process note
I again created the branch in the main checkout, against the repo's rule. Recovered properly: cherry-picked into
.worktrees/remote-render, stray branch deleted,mainleft atorigin/mainand clean. No commit was lost (it was recovered from the reflog) and nothing was pushed from the main checkout.