Skip to content

Fix built-in browser popup lifecycle#898

Merged
arul28 merged 1 commit into
mainfrom
ade/start-skill-see-find-issues-8c2c6699
Jul 24, 2026
Merged

Fix built-in browser popup lifecycle#898
arul28 merged 1 commit into
mainfrom
ade/start-skill-see-find-issues-8c2c6699

Conversation

@arul28

@arul28 arul28 commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • adopt Electron pre-created popup web contents to prevent OAuth/new-tab crashes
  • preserve background-tab focus and selection while safely ending Inspect for foreground popups
  • use a white browser canvas so transparent light pages remain readable
  • document the popup lifecycle contract

Validation

  • builtInBrowserService.test.ts: 84 passed
  • adeActions registry tests: 76 passed
  • desktop Vitest shard 1/8: 1,160 passed
  • desktop typecheck passed

Greptile Summary

This PR updates the built-in browser popup and inspect lifecycle. The main changes are:

  • Adopt Electron-created popup webContents for foreground popup tabs.
  • Load deferred background-tab popups without changing the active tab or clearing selection.
  • Use a white backing canvas for browser views.
  • Keep inspect teardown scoped to the web contents that started the inspect session.
  • Update tests and feature docs for the revised browser behavior.

Confidence Score: 5/5

Safe to merge with low risk.

The changed popup and inspect lifecycle paths have focused test coverage, and no concrete correctness or security issues were identified.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The focused test proof for the popup OAuth service was run, and the popup/OAuth service tests executed and passed.
  • A typecheck attempt for the popup code was started with tsc -p tsconfig.json --noEmit using the requested heap option and was subsequently killed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/desktop/src/main/services/builtInBrowser/builtInBrowserService.ts Updates popup tab adoption, background-tab focus behavior, navigation selection clearing, white browser backing color, and inspect teardown ownership.
apps/desktop/src/main/services/builtInBrowser/builtInBrowserService.test.ts Expands Electron fakes and coverage for adopted popup webContents, background popups, white backgrounds, and inspect teardown races.
docs/features/chat/README.md Documents the revised built-in browser popup lifecycle, inspect behavior, background-tab handling, and white backing canvas.

Sequence Diagram

sequenceDiagram
participant Page as Opener page
participant Electron as Electron windowOpenHandler
participant Service as Built-in browser service
participant Tab as Internal browser tab
participant Inspect as Inspect teardown

Page->>Electron: window.open(popupUrl, disposition)
Electron->>Service: createWindow(options)
Service->>Service: validate URL and agent access
alt Electron supplies popup webContents
  Service->>Tab: adopt webContents in WebContentsView
else deferred/background popup
  Service->>Tab: create WebContentsView with browser preferences
  Service->>Tab: loadURL(popupUrl)
end
alt foreground popup
  Service->>Inspect: stop opener inspect if active
  Service->>Tab: activate tab and open panel
else background-tab popup
  Service->>Tab: keep opener active and preserve selection
end
Service-->>Electron: return tab.webContents
Loading

Reviews (1): Last reviewed commit: "Fix built-in browser popup lifecycle" | Re-trigger Greptile

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Jul 24, 2026 2:27pm

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@arul28, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ee8aa68e-d93f-40c8-9e2a-c239a902e837

📥 Commits

Reviewing files that changed from the base of the PR and between afe5904 and a1e5b54.

⛔ Files ignored due to path filters (1)
  • docs/features/chat/README.md is excluded by !docs/**
📒 Files selected for processing (2)
  • apps/desktop/src/main/services/builtInBrowser/builtInBrowserService.test.ts
  • apps/desktop/src/main/services/builtInBrowser/builtInBrowserService.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/start-skill-see-find-issues-8c2c6699

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.

@arul28 arul28 changed the title gmail-sign-in-crash-blue-whites -> Primary Fix built-in browser popup lifecycle Jul 24, 2026
@arul28
arul28 merged commit 9f9d1ea into main Jul 24, 2026
34 checks passed
@arul28
arul28 deleted the ade/start-skill-see-find-issues-8c2c6699 branch July 24, 2026 14:43
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