Skip to content

test(runtime): verify mobile geometry through desktop restores - #29323

Merged
OrcaWin merged 23 commits into
mainfrom
OrcaWin/test-audit-mobile-geometry
Oct 16, 2026
Merged

OrcaWin merged 23 commits into
mainfrom
OrcaWin/test-audit-mobile-geometry

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Prove that taking a terminal back from a phone restores the desktop’s measured size, rather than checking an internal cache. Remove the production getter that existed only for those tests.

What Changed

Replace five getter checks with actual terminal-size restoration or retain their already stronger restoration assertions. Use distinct physical and reported sizes so controller fallback cannot hide a lost measurement. The suppression case now first activates resize suppression, then proves a new measurement survives the next phone/desktop cycle. Remove the seven-line test getter.

Keep all 87 current owner cases. Three duplicate cases were removed by an earlier merged PR; this PR removes no further case and preserves the later real mobile-floor regression repair. Two test names now describe the observable behavior. Test changes are +37/-16 lines; production changes are -7 lines.

Why

Checking the restored terminal catches the regression where users experience it and removes a test-only production method. Reusing the existing runtime suites preserves the phone, desktop and remote ownership paths without a separate test layer or new injection hook.

Linked Issue

Maintainer-requested audit of tests running on every PR.

Visual Proof

N/A — test changes and removal of a test-only getter; terminal behavior is unchanged.

Testing

  • Linux, background launch, Node 24.21.0 / Bun 1.4.3.
  • Final main-based seven-suite shuffled run passes 1,558 tests with one existing skip, including all 87 owner cases, remote desktop/reconnect, stale handles, terminal sends and the full runtime owner. The earlier two clone fixture failures are fixed by landed test: restore worktree Git spies after each case #29558.
  • Four deliberate owner mutations fail the intended physical-size assertions: suppression of reports, missing successful desktop refresh, missing remembered-map write and acceptance of invalid dimensions. Sources restored byte-for-byte; all four relevant source/test files remain byte-identical through the latest main reconciliation.
  • One fresh main-based owner pair retains all 87 outcomes (85 names unchanged, two intentional renames): command wall 10.728→10.607 s; summed module phases 9.067→9.028 s. Single unpaired local sequence; no speed claim.
  • Final Node typecheck, changed-code quality, targeted lint, formatting and whitespace checks pass.
  • Exact head c2c3516e2d2e37c796c2499f6bc54fb049c350d3: full PR workflow 38882810127 and aggregate PR checks passed job116916876542 pass, along with separate headless/persistence and LoC checks. All five full inventories reconcile: 12,340 unique files, zero unhandled errors or omitted failures; all 87 selected cases pass. Source-qualified recent baseline→candidate module phases 20.064→21.122 s (+5.27%); displayed test duration 365→369 ms. This unpaired observation shows no speedup. The actual checkout includes unrelated newer main code; geometry owners and reviewed candidate bytes are preserved.

This is stronger geometry proof and removal of a production test seam. No CI speedup is claimed.

Review

Independent preservation review approved the exact three-path +37/-23 change at the earlier refreshed head. The final main merge changes none of those three files or the input-floor owner used in the mutation controls. Existing paste-floor, remote/windowless, suppression and invalid-geometry contracts remain intact. No platform condition, SSH ownership, folder-workspace assumption or wire change is introduced.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied or translated.

Checklist

  • Before/after, mechanism and rationale explained.
  • Visual proof N/A; platform and remote behavior considered.
  • Retained regression controls and final shuffled owner/sibling validation.
  • Final local gates and exact-head full CI pass.

@OrcaWin
OrcaWin changed the base branch from OrcaWin/test-audit-runtime-close-startup to main October 16, 2026 09:46
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b63205bc-f9dc-4c3a-b668-0ce713e1b1ff
📥 Commits

Reviewing files that changed from the base of the PR and between da14046 and c2c3516.

📒 Files selected for processing: 3
  • src/main/runtime/mobile-presence-lock.test.ts
  • src/main/runtime/mobile-subscribe-integration.test.ts
  • src/main/runtime/terminal/layout/terminal-display-mode.ts
💤 Files with no reviewable changes: 1
  • src/main/runtime/terminal/layout/terminal-display-mode.ts

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

📝 Walkthrough

The tests verify that desktop reclaim restores recorded renderer dimensions after mobile subscribe, including after controller-reported dimensions drift. They also cover non-positive dimensions and geometry recording during resize suppression. The getLastRendererSize accessor was removed.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c2c35

No actionable issue is identified in the terminal-size restoration tests; normal checks remain before merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Title check Passed The title clearly and concisely describes the main change: verifying mobile geometry through desktop restores.
Description check Passed The description covers the change, rationale, testing, visual-proof exception, review notes, and checklist. It is detailed and aligned with the stated objectives. The Notes section is omitted, and no …
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description covers the change, rationale, testing, visual-proof exception, review notes, and checklist. It is detailed and aligned with the stated objectives. The Notes section is omitted, and no issue reference is provided, but the description identifies this as a maintainer-requested audit, which matches the template’s maintainer exception.

✨ Finishing Touches
📝 Generate docstrings
  • 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

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit b56cc36 into main Oct 16, 2026
31 checks passed
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