Repository navigation
refactor(browser): remove the unused screenshot-prep visibility helper - #22526
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe browser manager no longer defines Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable behavior regression is established; the change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings
🛠️ Fix failing CI checks 💡
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. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Deleted dead
ensureWebviewVisiblehelper — removed fromsrc/main/browser/browser-manager-visibility.ts; repo-wide search finds no callers or string/IPC lookup, so it never ran in production. - Removed its five tests and the harness mock — the deleted cases in
browser-manager-guest-visibility.test.tsonly exercised the removed method, andbrowserWindowFromWebContentsMockis dropped from the top-level destructuring (still defined and used in theelectronmock, so nothing is left unused). - Refreshed the
screenshotTurncomment —agent-browser-bridge-state.tsnow attributes shared paintability to the automation visibility lease, matchingwithSerializedScreenshotAccessinagent-browser-bridge-capture-commands.ts.
Verification: rg ensureWebviewVisible returns nothing across the repo; the remaining browser-manager-guest-visibility.test.ts and agent-browser-bridge-automation-visibility.test.ts suites pass (9 tests). The live screenshot path still uses acquireAutomationVisibility, which the PR leaves untouched.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
3c4ddbb to
36205c0
Compare

ELI5
The desktop app had a piece of code that could briefly flip the user's screen to a hidden browser page so a screenshot could be taken, then flip it back. Nothing uses it any more, so this removes it.
What Changed
ensureWebviewVisiblefromsrc/main/browser/browser-manager-visibility.ts. It ran a script inside the app window that switched the active worktree, tab, and browser page, then restored them afterwards.Before and after, the user sees nothing different: the method had no callers, so the app never ran it.
Why
Evidence it was unused: searching the whole repository (including
src/,mobile/,tests/,config/, anddocs/) forensureWebviewVisiblefinds only the method itself, its tests, and the test-harness mock. It is not reached by name through any IPC channel or string lookup. Screenshots already go throughholdPaintForCapture, which keeps a page drawn without changing what the user sees; other browser commands don't need the page drawn at all.Dead code that mutates the user's visible selection is a trap: a future caller could reintroduce the tab-flipping behavior that the newer approach was built to avoid. Deleting it is simpler than keeping it tested.
holdPaintForCapture, the global screenshot serialization, andwindow.__store(used widely by end-to-end tests) are untouched.Linked Issue
Part of the Linear STA-8024 browser cleanup: https://linear.app/stably/issue/STA-8024/bug-android-app-browser-issues
Visual Proof
N/A — deletes code that had no production caller, so there is no visual or interaction change.
Testing
pnpm tc:nodepasses.pnpm vitest run --config config/vitest.config.ts src/main/browser: everything passes exceptbrowser-manager-viewport-ownership.test.ts(12 tests), which fails identically on unmodifiedmainand is unrelated.pnpm run check:code-quality:changedpasses.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Tests for the deleted method were removed with it; the remaining automation-visibility tests still run.
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security, cross-platform, SSH, mobile, backwards compatibility, performance: no impact — main-process-only deletion of an uncalled method.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)