Fix BrowserView not resizing on maximize, and Reels media controls staying hidden #1

Merged
alex merged 1 commit from nupipun/instagram-linux:fix/maximize-and-reels-controls into main 2026-07-12 00:21:52 +00:00
Contributor

Summary

  • Maximize bug: the BrowserView content pane stayed at its pre-maximize size when the system window was maximized. A prior attempt (setAutoResize) did not fully fix this. Root cause: on this KWin/Wayland setup, maximize/unmaximize fire before the compositor commits the new content size, so the synchronous re-layout read stale bounds. Fixed by deferring the re-layout slightly so it reads the settled window size. Verified with a standalone Electron BrowserView bounds test across repeated maximize/unmaximize cycles.
  • Reels media controls (Instagram Augmenter extension): the floating controls overlay has an anti-jank check that hides itself whenever the video moves more than 0.5px relative to its nearest scrolling ancestor between frames. In Reels the video sits inside a continuously scrolling container, so this offset never stabilizes and controls stay permanently hidden. Fixed by using the extensions existing isReelOrStory flag to skip that drift-based hide check in Reels/Stories, leaving normal feed-video behavior (and the off-screen-hide check) untouched. Verified by extracting the literal patched function and exercising it against simulated continuous drift.

Test plan

  • Standalone Electron test: BrowserView bounds match window content size across 5 consecutive maximize/unmaximize cycles
  • Extracted-function test: Reels overlay stays visible under continuous position drift; regular feed-video anti-jank behavior unchanged; off-screen hide still works
  • Manually confirmed maximize + Reels controls work correctly in the running app

🤖 Generated with Claude Code

## Summary - **Maximize bug**: the BrowserView content pane stayed at its pre-maximize size when the system window was maximized. A prior attempt (setAutoResize) did not fully fix this. Root cause: on this KWin/Wayland setup, `maximize`/`unmaximize` fire before the compositor commits the new content size, so the synchronous re-layout read stale bounds. Fixed by deferring the re-layout slightly so it reads the settled window size. Verified with a standalone Electron BrowserView bounds test across repeated maximize/unmaximize cycles. - **Reels media controls (Instagram Augmenter extension)**: the floating controls overlay has an anti-jank check that hides itself whenever the video moves more than 0.5px relative to its nearest scrolling ancestor between frames. In Reels the video sits inside a continuously scrolling container, so this offset never stabilizes and controls stay permanently hidden. Fixed by using the extensions existing `isReelOrStory` flag to skip that drift-based hide check in Reels/Stories, leaving normal feed-video behavior (and the off-screen-hide check) untouched. Verified by extracting the literal patched function and exercising it against simulated continuous drift. ## Test plan - [x] Standalone Electron test: BrowserView bounds match window content size across 5 consecutive maximize/unmaximize cycles - [x] Extracted-function test: Reels overlay stays visible under continuous position drift; regular feed-video anti-jank behavior unchanged; off-screen hide still works - [x] Manually confirmed maximize + Reels controls work correctly in the running app 🤖 Generated with [Claude Code](https://claude.com/claude-code)
BrowserView bounds were only re-laid out on maximize()/unmaximize() by
calling layout() synchronously inside the event handler, but on this
KWin/Wayland setup 'maximize'/'unmaximize' fire before the compositor has
actually committed the new content size, so layout() read stale bounds
and the view was left at its pre-maximize size. Defer the re-layout so it
reads the settled size instead. Verified with a standalone BrowserView
bounds test across repeated maximize/unmaximize cycles.

Separately, the bundled Instagram Augmenter extension's floating controls
overlay has an anti-jank check that hides the overlay whenever the
video's position relative to its nearest clipped/scrolling ancestor
shifts by more than 0.5px between frames, only re-showing once the
position is stable for two consecutive frames. In Reels, the video sits
inside a continuously scrolling container, so this offset keeps drifting
every frame and the overlay never stabilizes - controls stay permanently
hidden. The extension already computed an isReelOrStory flag (previously
only used for a CSS class); it's now also used to skip the drift-based
hide check in Reels/Stories, while leaving normal feed-video behavior
(and the off-screen-hide check) untouched. Verified by extracting the
literal patched function and exercising it against simulated continuous
drift.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner

Mierdon

Mierdon
alex merged commit b320e24202 into main 2026-07-12 00:21:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
alex/instagram-linux!1
No description provided.