Repository navigation
fix(app): Connect a PC over a terminal peek, and the Connect a PC browser regression - #4482
Conversation
… over a phone's round trip The browser regression for the Connect a PC bounce (fixed in #4435), held out of that PR while its history check read the wrong thing. On a hosted PC page at 390 px with touch, one real PC paired through a Bun relay, it taps More → Connect a PC with 150 ms of DevTools latency on the page's network (a phone's round trip, so the More sheet's own step back lands while the load is still on its way) and prints the order of history steps, popstates and loads. It checks that Add a PC opens and stays 2 s, one entry over the PC page's entry with nothing ahead; that its own Back and the browser's land on that same entry with the sheet closed; and that Back from it moves one entry down. The tab's history is read from the browser (Page.getNavigationHistory) and the PC page's entry is followed by its id: the two pages' Navigation APIs list different parts of the history (the PC page left out the pairing page's entry, Add a PC listed it), so an index read on one page does not compare with one read on the other, which failed the earlier version in the CI runner image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y of the peek under Add a PC More opened while a sheet that stays up has an entry (the terminal peek over a chat) shares that sheet's entry; closing More hands the entry back to the peek and takes no step, so Add a PC loads from the peek's entry and pushes over it. Back from Add a PC then lands on that entry, which the reloaded PC page draws without the peek, and the next Back stays on the same PC page: two presses to leave it. The page must take the peek's entry instead. Red: the load is a location.assign from the peek's entry, not a replace of it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s entry for Add a PC When the entry the closed More leaves is still the entry of a sheet that stays up under it (the terminal peek over a chat), leavePageFromSheet loads the page with location.replace: Add a PC takes that entry, so the history ends [..., PC page, Add a PC] as from a plain PC page, and Back from Add a PC lands on the PC page with one press to leave it after. No traversal runs, so nothing races the load. Elsewhere it still loads with location.assign from the entry under the sheet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Merged through Follow-up to the owner-reported More → Connect a PC (PC 연결) menu fix in #4435: it adds the browser regression held out of #4435 (scripts/add-pc-more-relay-regression.ts, listed in scripts/ci-browser.sh) and the terminal-peek history fix. Checks that ran: GitHub CI at this head all green (Fast checks, Integration and browser incl. this regression, which passed first try in Browser regression (other scripts 3/3); Native Windows install; Hook kill tests); bun run check fast locally; the regression 10/10 in herdr-ci-runner:local (Chrome for Testing 153). Reviews: CodeRabbit reviewed this head with no actionable comments; no unresolved threads. The two script files are a test script and one line adding it to the browser lane; nothing in them touches a workflow, auth or a contract. Merged on the team lead's instruction. |
What changes
Follow-up to the More → Connect a PC fix that shipped in #4435 (the menu's own step back as it closed cancelled the load of
/#add, or brought the PC page back right after it, on Android 15 and 16).Terminal peek: More opened while the terminal peek is up over a chat shares the peek's history entry. Closing More handed that entry back to the peek without a step, so Add a PC loaded on top of it: Back from Add a PC landed on a copy of the PC page with nothing up, and the next Back stayed on the same PC page (two presses to leave it).
leavePageFromSheet(src/lib/sheetHistory.ts) now loads the page withlocation.replacewhen the entry it leaves is still a sheet's that stays up, so the history ends[…, PC page, Add a PC]as from a plain PC page. No traversal runs in that case, so nothing races the load. Elsewhere it still loads withlocation.assignonce the closing sheet's step has landed. Changelog fragment:changelog.d/more-connect-pc-over-peek.md.Browser regression
scripts/add-pc-more-relay-regression.ts, listed inscripts/ci-browser.sh. It was held out of feat(relay): 0.5.10 approve card, unified sidebar, PC join, phone first screen, always-QR and About update check #4435 while its history check read the wrong thing. On a hosted PC page at 390 px with touch (one real PC paired through a Bun relay), it taps More → Connect a PC with 150 ms of DevTools latency (a phone's round trip, so the sheet's step back lands while the load is on its way) and prints the order of history steps, popstates and loads. It checks that:The tab's history is read from the browser (
Page.getNavigationHistory) and the PC page's entry is followed by its id. The earlier version compared Navigation API indexes read on two different pages; the PC page's list left out the pairing page's entry while Add a PC's included it. That failed about one run in two in the CI runner image (Chrome for Testing 153), although the browser's own history was right.No UI text or layout changes; this is history handling only. Device QA of the #4435 fix: Android 15 (WebView 124) and Android 16 (WebView 133), real taps, 10/10 each: Add a PC opened and stayed, one Back returned to the PC, and the next Back left it in one press.
Validation
bun run check faston this branch's head (d49c13e): passed. Workflow syntax, generated types and themes, typecheck, build, and unit tests: 23252 pass, 0 fail, 100 skip in 1147 files.scripts/add-pc-more-relay-regression.tsin the CI runner image (herdr-ci-runner:local, Chrome for Testing 153.0.8010.12), from a git bundle of d49c13e afterbun run build:shell: 10 runs, one after another, throughbun run check run -- bun scripts/add-pc-more-relay-regression.ts. All 10 passed.e20b020dcand an earlier main on this PC.src/lib/sheetHistory.test.ts) failed before the fix (alocation.assignfrom the peek's entry, not a replace) and passes after it.🤖 Generated with Claude Code