Skip to content

fix(app): Connect a PC over a terminal peek, and the Connect a PC browser regression - #4482

Merged
devswha merged 3 commits into
mainfrom
fix/add-pc-more-followup
Nov 22, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/add-pc-more-followup

Conversation

@devswha

@devswha devswha commented Nov 22, 2026

Copy link
Copy Markdown
Owner

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 with location.replace when 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 with location.assign once 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 in scripts/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:

    • Add a PC opens and stays for 2 s, one entry above the PC page's entry, with nothing ahead.
    • Add a PC's own Back and the browser's Back land on that same entry with the sheet closed.
    • Back from the PC page then 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 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 fast on 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.ts in the CI runner image (herdr-ci-runner:local, Chrome for Testing 153.0.8010.12), from a git bundle of d49c13e after bun run build:shell: 10 runs, one after another, through bun run check run -- bun scripts/add-pc-more-relay-regression.ts. All 10 passed.
  • Before rebasing onto main, on the earlier branch:
  • Not run: the full browser lane, Windows and macOS jobs (left to CI); no browser run of the terminal-peek path itself (it is covered by the unit test only); no device run of this follow-up.

🤖 Generated with Claude Code

devswha and others added 3 commits November 23, 2026 06:03
… 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]>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Fixed navigation when opening Connect a PC from More while a terminal peek is open. Pressing Back now closes the sheet and returns to the PC page; pressing Back again leaves the page without an extra step.

When a sheet closes over a staying terminal peek, page departure replaces the current history entry if it belongs to an open or leaving sheet; otherwise, it assigns the destination. Unit and browser regression checks cover the More → Connect a PC flow and its Back behavior.

Changes: Sheet navigation history

Layer / File(s) Summary
Sheet departure and unit coverage
src/lib/sheetHistory.ts, src/lib/sheetHistory.test.ts
depart replaces the current history entry when its state belongs to an open or leaving sheet. Unit tests distinguish replace from assign and check the terminal-peek case.
Add a PC browser regression
scripts/add-pc-more-relay-regression.ts, scripts/ci-browser.sh, changelog.d/more-connect-pc-over-peek.md
A Playwright script checks sheet and browser Back behavior in the More → Connect a PC flow. Browser CI runs the script, and the changelog records the fix.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

Possibly related PRs

  • devswha/ovis#4220 — Both changes address sheet history traversal timing in sheetHistory.ts and add browser regression coverage.

Suggested labels: bug

Merge Risk: Minimal · up to d49c1

This fixes Back navigation after More → Connect a PC when a terminal peek is open. The change is small and localized, with unit and browser regression coverage. No actionable merge-blocking risk remains; the full browser lane and the Windows and macOS jobs are left to CI.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a fix for Connect a PC over a terminal peek, plus the related browser regression. It is specific and matches the changeset. It is long at 84 characters, but it stays o…
Description check Passed The description follows the template's Change and Validation sections. Change explains the problem, the resulting behavior, and the changed files. Validation lists the commands run, their results, and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a fix for Connect a PC over a terminal peek, plus the related browser regression. It is specific and matches the changeset. It is long at 84 characters, but it stays on topic.

Full details: Description check

Explanation

The description follows the template's Change and Validation sections. Change explains the problem, the resulting behavior, and the changed files. Validation lists the commands run, their results, and the checks skipped. It does not link an issue, but this is a follow-up to #4435, and the template asks for an issue link only for features. The description does not state whether HTTP/WS contract tests apply; this change touches no HTTP/WS code, so the omission is minor.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ac25e52 and d49c13e.

Files selected for processing: 5

  • changelog.d/more-connect-pc-over-peek.md
  • scripts/add-pc-more-relay-regression.ts
  • scripts/ci-browser.sh
  • src/lib/sheetHistory.test.ts
  • src/lib/sheetHistory.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@devswha
devswha merged commit 4845dcd into main Nov 22, 2026
15 checks passed
@devswha

devswha commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head d49c13e26. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

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.

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.

1 participant