Skip to content

fix(lens): recover crashed sessions, preserve login popups, and expand inspection - #561

Merged
astyfx merged 1 commit into
mainfrom
fix/web-browser-bug
Sep 19, 2026
Merged

astyfx merged 1 commit into
mainfrom
fix/web-browser-bug

Conversation

@astyfx

@astyfx astyfx commented Sep 19, 2026

Copy link
Copy Markdown
Member

Summary

Fix the Lens and external-browser failures that made the surface unusable, and raise Lens inspection quality (DevTools access, better pointer/component detection, simpler toolbar).

Changes

Features

  • lens: add a control to open DevTools for the current Lens page
  • lens: enrich element context with React component/source metadata and attach the selected region image
  • lens: improve inspect/annotate pointer tracking — remove hover delay, recheck the stationary pointer on scroll/resize via requestAnimationFrame coalescing, and select the parent element with Alt
  • lens: simplify the Lens toolbar

Fixes

  • lens: reset the recovery budget and recreate the session on manual retry/navigate so a tab whose auto-recovery was exhausted can be reloaded instead of failing with "No browser session"
  • lens: preserve the opener link and POST data for login popups by using Electron's native window-open path (keeping the existing security checks), so auth flows relying on window.opener.postMessage or a posted form no longer break
  • browser: fix local CUA runner compatibility so the external browser runtime initializes

Refactors / Chores

  • lens: extract pointer and component-context injection into dedicated modules (browser-pointer.ts, browser-component-context.ts)

Breaking Changes

  • None

Test Evidence

  • bun run test:ci passed end to end (exit 0): check:licenses, check:reliability-gates, check:style-channel, check:doc-paths, check:max-lines-ratchet, check:switch-exhaustiveness, typecheck, typecheck:lens-main, test:isolated, build, and build:desktop.
  • New unit coverage in tests/lens-pointer.test.ts (pointer move coalescing + scroll recheck; shadow-host hit-test boundary) passes.
  • New Electron e2e coverage in tests/e2e-electron/lens-browser-controls.electron.e2e.ts.

Notes

  • The full single-process bun test run shows a pre-existing environmental failure profile (62 fail / 11 errors) caused by the electron module webContents export not resolving under full-suite parallelism. This profile is identical on a clean origin/main checkout and is unrelated to this change; the authoritative gate (test:isolated / test:ci) is green. CI runs the isolated variant.
  • Live comparison against external reference browsers and a real login-site UI reproduction could not be completed in this environment (access-restricted sites, and @web/Chrome needs a fresh interactive session), so the "quality target" is documented in docs/features/lens-quality.md rather than asserted as fully met.

…d inspection

Fix Lens and external-browser failures that made the surface unusable, and
raise inspection quality:

- Reset the recovery budget and recreate the session on manual retry/navigate
  so a tab whose auto-recovery was exhausted can be reloaded instead of dying
  with "No browser session".
- Preserve the opener link and POST data for login popups by using Electron's
  native window-open path while keeping the security checks, so auth flows that
  rely on window.opener.postMessage or a posted form no longer break.
- Add a control to open DevTools for the current Lens page.
- Simplify the Lens toolbar.
- Improve inspect/annotate pointer tracking: drop hover delay, recheck the
  stationary pointer on scroll/resize via requestAnimationFrame coalescing,
  and select the parent element with Alt.
- Enrich element context with React component/source metadata and attach the
  selected region image.
- Fix local CUA runner compatibility so the external browser runtime
  initializes.

Adds unit coverage for pointer coalescing and shadow-host hit-testing, plus
Electron e2e coverage for the new browser controls, and documents the quality
bar in docs/features/lens-quality.md.
@astyfx
astyfx requested a review from a team as a code owner September 19, 2026 12:11
@astyfx
astyfx requested review from JongSikLim and png-1105 and removed request for a team September 19, 2026 12:11
@upwind-code-us

upwind-code-us Bot commented Sep 19, 2026

Copy link
Copy Markdown

Upwind Upwind Code Scan - ⚠️ Warn

7 newly introduced vulnerabilities · 0 resolved · 64 total in this PR vs main

Total breakdown: 🔶 13 High | 🟡 48 Medium | 🟢 3 Low


🔶 High · 7 findings
CVE Package Version Fix
CVE-2026-6321 fast-uri 3.1.0 3.1.1
CVE-2026-75975 fast-uri 3.1.0 3.1.6
CVE-2026-6322 fast-uri 3.1.0 3.1.2
CVE-2026-76172 fast-uri 3.1.0 3.1.6
CVE-2026-16221 fast-uri 3.1.0 3.1.4
CVE-2026-18446 fast-uri 3.1.0 3.1.5
CVE-2026-13676 fast-uri 3.1.0 3.1.3

View full analysis in Upwind Console

Scan completed in 18s

Scan history (1 scan)
Commit Scanned at New Resolved Net
4e4cdc2 < 2026-09-19 12:11 UTC +7 0 +7

Last scanned: 4e4cdc2 · 2026-09-19 12:11 UTC

@upwind-code-us

upwind-code-us Bot commented Sep 19, 2026

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 6s

Scan history (1 scan)
Commit Scanned at New Resolved Net
4e4cdc2 < 2026-09-19 12:11 UTC 0 0 0

Last scanned: 4e4cdc2 · 2026-09-19 12:11 UTC

@astyfx
astyfx enabled auto-merge (squash) September 19, 2026 12:11

@heath-s heath-s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@astyfx
astyfx merged commit cfed189 into main Sep 19, 2026
6 checks passed
@astyfx
astyfx deleted the fix/web-browser-bug branch September 19, 2026 12:20
@astyfx astyfx mentioned this pull request Sep 19, 2026
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.

2 participants