Skip to content

ship 2026-06-07: desktop browser-view placement during window resize - #69

Merged
SawyerHood merged 3 commits into
mainfrom
sawyer/ship-2026-06-07
Jun 7, 2026
Merged

SawyerHood merged 3 commits into
mainfrom
sawyer/ship-2026-06-07

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

What this ships

Fixes the desktop shell's native browser views (secondary-panel webviews) misbehaving during interactive window resizes. Three stacked changes: the renderer becomes the single placement authority for view bounds, views hide entirely during resize bursts instead of rubber-banding behind the chrome, and a captured snapshot of each view stands in while it is hidden so the panel never goes blank.

Commits in this batch (3)

Commit What
a2b6ac3 Renderer-owned view placement — the renderer measures the panel rect and pushes it on its own layout cadence; the main process stops extrapolating bounds from cached edge insets and only re-clamps the last renderer rect to the live window. The resize-invariant layout descriptor (types + both projection helpers + renderer dedupe/rAF deferral) is deleted.
d8b5a55 Hide views during resize bursts — chrome and native views composite independently, so no bounds protocol keeps them glued mid-drag; views hide for the burst and reveal at the latest renderer rect once it settles (resized for manual drags, 200ms settle timer for programmatic streams). Mid-burst visibility changes are recorded and applied on reveal.
1881feb Snapshot placeholder while hidden — beginWindowResize captures each visible view and pushes the bitmap to the renderer as a JPEG data URL over a new snapshot channel (capped at 80ms); the renderer paints it inside the panel so it stretches with the chrome. endWindowResize reveals the live view then drops the stand-in — overlap on the swap, never a blank gap. onSnapshot is optional on BbDesktopBrowserApi for version skew with older shells.

QA checklist

  • Open a browser tab in the secondary panel, drag-resize the window: no webview rubber-banding/stretching outside its panel, no blank panel — the snapshot stand-in tracks the chrome until release, then the live view returns.
  • Programmatic resize (e.g. zoom/maximize): view reveals at the correct rect after the 200ms settle.
  • Shrink the window so the panel would clip: view stays clamped inside the window; grow back restores the full rect.
  • Hide/show the panel mid-drag: visibility applies correctly on reveal.
  • SPA against an older desktop shell (no snapshot channel): resize falls back to the bare panel background, no errors.
  • pnpm exec turbo run typecheck and pnpm exec turbo run test green.

Notes

  • sawyer-next carries one more commit on top of this batch (external app sources) that ships separately.
  • Merge style: Rebase and merge, per ship convention.

🤖 Generated with Claude Code

SawyerHood and others added 3 commits June 7, 2026 12:47
During a native window drag the desktop main process reprojected each
browser view from a cached edge-inset descriptor (left/top pinned, right/
bottom insets pinned to the window edge). The secondary panel lays out
proportionally, so that extrapolation was geometrically wrong: the view's
right edge snapped to the live window while the (lagging) chrome painted
the old layout, visibly stretching the webview out of its panel; stale
renderer corrections then fought the projection, producing jitter.

The renderer is now the single placement authority: it measures the panel
rect and pushes it whenever the rect actually changes, at its own layout
cadence (ResizeObserver tick, window resize, layout-sync event) — so the
native view always lands where the chrome around it is painted. The main
process no longer extrapolates on resize; it only re-clamps the last
renderer rect to the live window so a shrinking window cannot leave the
view spilling past its edge, and a grow-back restores the full rect.

The resize-invariant layout descriptor (type, both projection helpers,
and the renderer's descriptor dedupe + rAF deferral) is deleted; bounds
equality is the dedupe key and measurements send synchronously.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Renderer-cadence bounds tracking still bleeds during an interactive
window resize: the chrome repaints at ~6-10fps under a drag while the
native view composites independently, so the view rubber-bands behind
the chrome and overlaps the thread content. No bounds protocol can keep
two independently composited surfaces glued mid-drag.

Hide the views for the duration of the resize burst instead — the
chrome's own panel background shows in their place, always exactly where
the chrome painted it — and reveal them at the latest renderer rect
(clamped to the live window) once the resize settles. `resized` ends a
manual drag on mouse release; a 200ms settle timer covers programmatic
resize streams, which never emit `resized`. Renderer visibility changes
made mid-burst are recorded and take effect on the reveal. The per-tick
clamp pass is gone; clamping now happens at apply time and on reveal.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Hiding the native view during a window resize burst left a bare panel.
Now beginWindowResize captures each visible view first, pushes the
bitmap to the renderer as a JPEG data URL over a new snapshot channel,
and hides the view only once the capture resolves (capped at 80ms so a
stalled capture cannot prolong the stale-view exposure). The renderer
paints the bitmap absolutely inside the panel, so it stretches with the
chrome and stays glued to the panel however far the chrome paint lags
the drag. endWindowResize reveals the live view, then pushes a null
snapshot to drop the stand-in — overlap on the swap, never a blank gap.
Captures that resolve after their burst ended are discarded.

onSnapshot is optional on BbDesktopBrowserApi purely for version skew:
the SPA routinely attaches to older shells whose preload predates the
channel, and falls back to the bare panel background during resizes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@SawyerHood
SawyerHood merged commit e82c436 into main Jun 7, 2026
5 of 6 checks passed
@afterhoursmx

afterhoursmx commented Nov 19, 2026 •

Copy link
Copy Markdown

Posted in error by an automated workflow. Apologies.

@afterhoursmx

afterhoursmx commented Nov 19, 2026 •

Copy link
Copy Markdown

This comment was posted to the wrong repository by an automated workflow. Its technical content has been removed from this location. Apologies for the noise.

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