Skip to content

fix(browser): keep native pages contained in their pane - #5116

Merged
reachjalil merged 6 commits into
devfrom
fix/browser-container-bounds-20260917
Oct 8, 2026
Merged

reachjalil merged 6 commits into
devfrom
fix/browser-container-bounds-20260917

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Keep the built-in browser from covering chat when its container is clipped, hidden, replaced, or resized. Electron paints the native WebContentsView above the app renderer, so CSS overflow alone cannot contain it.

  • Measure the visible container rectangle, including clipping ancestors and the viewport; hide detached or invisible containers.
  • Discard stale native placement on conversation changes, renderer replacement, and invalid geometry. Preserve browser documents and background tabs.
  • Clamp native bounds to window content, reject stale zoom measurements, and invalidate renderer caches when the host changes placement.
  • Restrict geometry IPC to the main renderer frame.
  • Extend the existing browser viewport journey with pane and toolbar non-overlap assertions.

Existing layout and controls are unchanged; the existing geometry synchronization path is reused rather than introducing another browser layer (DESIGN.md P5).

Validation

Incomplete — focused checks and a real macOS containment capture pass; the full Electron regression journey remains pending.

  • node --test apps/desktop/electron/browser-panel.test.mjs: 94 passed, 0 failed.
  • bun test --isolate ./apps/app/src/react-app/domains/session/panel/browser-bounds-sync.test.ts: 8 passed, 0 failed. DOM rectangles are synthetic; this is not native rendering proof.
  • Electron typecheck, 52-method bridge check, focused renderer geometry typecheck, and git diff --check: passed.
  • pnpm --dir evals typecheck: 487 source files passed. The first run reported 12 errors from existing usage-meter assertions; this PR includes a one-line type-only addition of the standard progressbar role to TargetRole to resolve them without weakening assertions.

Screenshot

Real macOS Electron window: the built-in browser remains contained beside the chat composer

Captured from clean PR head 76bb04a5d in an isolated macOS Electron 43.2.0 test instance. This is a native window-only capture, including the actual WebContentsView—not a renderer-only image or a composite (DESIGN.md P10). The content is example.com alongside a synthetic, unsent draft; no personal profile or private conversation is shown.

After resizing with the divider keyboard controls, the native browser and page viewport both measured 447 × 721, matched the live content container, and stayed inside the side pane below its toolbar. The image was visually inspected and the isolated test process was stopped. This confirms the pictured state, not every transition.

Remaining proof

  • Run pnpm evals:e2e browser-panel-viewport-recovery on this candidate; the extended journey was not executed here.
  • The original reported overlap sequence and full zoom/conversation-switch matrix remain unverified end-to-end; the screenshot above demonstrates one real resized state.

No release or deployment is included.

@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

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

4 Skipped Deployments
Project Deployment Actions Updated
openwork-app Ignored Ignored Preview Oct 7, 2026 11:32pm UTC
openwork-den Ignored Ignored Preview Oct 7, 2026 11:32pm UTC
openwork-diagnostics Ignored Ignored Preview Oct 7, 2026 11:32pm UTC
openwork-landing Ignored Ignored Preview Oct 7, 2026 11:32pm UTC

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Selected evidence: Incomplete · 12/12 tests · 18/18 assertions · 8 images

Commit b947b180dc595df0a1c7e7ec159ffc1a3ca34add · selected evidence
Required verification is reported separately by the current-head Required verification check.

Open review report

Coverage gaps: Required verification: incomplete. Selected evidence does not satisfy all required specs. No authenticated current-head required plan is available.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟢 Ready · evidence passed fac4b36 Open preview 2026-10-07 23:37:53 UTC

Run details · Open the preview to inspect evidence and sandbox options.

diff-warden[bot]
diff-warden Bot previously approved these changes Oct 7, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden clearance. Complete security and confidentiality review of efb0eae0d13d06dc0c78a41aea7a811e0ebeb736 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@diff-warden

diff-warden Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Warden: approved

No high or medium security findings and no confidentiality findings.

Reviewed fac4b36b86a9 · Warden run · Updates after every Warden run.

diff-warden[bot]
diff-warden Bot previously approved these changes Oct 7, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden clearance. Complete security and confidentiality review of 1ca613c4c993363a96d552f413dd7245e95ce886 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

diff-warden[bot]
diff-warden Bot previously approved these changes Oct 7, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden clearance. Complete security and confidentiality review of 5702a14ef9a9deccf5a222a8f5dc5ec6fb6611d4 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@github-actions
github-actions Bot temporarily deployed to Evidence / PR 5116 October 7, 2026 21:11 Inactive
Electron 43.5 restores a page's view size when a DevTools client that set
Emulation.setDeviceMetricsOverride disconnects without clearing it
(electron/electron#52946). Since dev moved from Electron 43.2.0 to 43.7.7
(#5535), closing the capture client while building the world undid the
leftover 1440x900 viewport before the test body ran, so the spec failed
before the tab was selected.

Keep the client connected until the world is disposed. A client that stays
connected still leaves the page laid out at its capture size inside the
panel, which is the case selecting the tab must recover.

Signed-off-by: Jalil <[email protected]>

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden clearance. Complete security and confidentiality review of fac4b36b86a9aed6a00f31c001b0fadaf95796a0 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@reachjalil
reachjalil merged commit 3bc8229 into dev Oct 8, 2026
38 checks passed

This branch was successfully deployed

5 active (4 outdated) and 1 inactive deployments
Evidence / PR 5116 — fac4b36b Deployed Oct 7, 2026 by github-actions[bot]
Preview – openwork-app — c74d56de Deployed Oct 7, 2026 by vercel[bot]
Preview – openwork-landing — c74d56de Deployed Oct 7, 2026 by vercel[bot]
Preview – openwork-den — c74d56de Deployed Oct 7, 2026 by vercel[bot]
Preview – openwork-diagnostics — c74d56de Deployed Oct 7, 2026 by vercel[bot]
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