Repository navigation
fix(ui): stop the reveal reflow from dismissing popovers - #10487
Merged
Merged
Conversation
The main process reflows the renderer on every reveal, resume, and restore. On macOS 26 that nudges the emulated device scale factor, and Chromium fires a real window resize for it even though innerWidth/innerHeight are identical. Anything bound directly to resize treated that as a user resize. The selection copy menu and the markdown link bubble both dismiss on resize unconditionally, so they closed on their own whenever the window was revealed or restored. Gate both on an actual dimension change. Only fixes the macOS 26 path: the pre-Tahoe repaint jiggles the native frame by a real pixel, so the renderer sees a genuine dimension change and no change-detection guard can — or should — filter it. Co-authored-by: Orca <help@stably.ai>
Pins both halves of the wiring: a same-size resize must not dismiss, a real one still must. Mutation-checked — reverting to a bare resize listener, or dropping the listener entirely, each fails the suite. Co-authored-by: Orca <help@stably.ai>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
This was referenced Jul 25, 2026
This was referenced Jul 27, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
) * fix(ui): stop the reveal reflow from dismissing popovers The main process reflows the renderer on every reveal, resume, and restore. On macOS 26 that nudges the emulated device scale factor, and Chromium fires a real window resize for it even though innerWidth/innerHeight are identical. Anything bound directly to resize treated that as a user resize. The selection copy menu and the markdown link bubble both dismiss on resize unconditionally, so they closed on their own whenever the window was revealed or restored. Gate both on an actual dimension change. Only fixes the macOS 26 path: the pre-Tahoe repaint jiggles the native frame by a real pixel, so the renderer sees a genuine dimension change and no change-detection guard can — or should — filter it. Co-authored-by: Orca <help@stably.ai> * test(ui): cover the reveal-reflow guard at the component level Pins both halves of the wiring: a same-size resize must not dismiss, a real one still must. Mutation-checked — reverting to a bare resize listener, or dropping the listener entirely, each fails the suite. Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Orca <help@stably.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
forceRepaintruns on every window reveal, resume, and restore. Both paths it can take fire a real Chromiumresizeevent at the renderer:reflowRendererViewport) — nudges the emulated device scale factor.innerWidth/innerHeightare unchanged; the resize is a phantom.createMainWindow.ts:86,97) —setSize(width + 1, height)then back. A genuine 1px change.Transient UI bound directly to
resizetreats the phantom as user intent. On macOS 26, the selected-text copy menu and the rich-markdown link bubble both dismiss on every window restore, with no user interaction.Fix
addViewportSizeChangeListenercachesinnerWidth/innerHeightand invokes the callback only when they actually differ, rebasing the cache each time it fires. Wired into both consumers in place of their barewindow.addEventListener('resize', …).The guard compares actual dimensions rather than counting events, so it is indifferent to how many resizes a given reflow emits.
Verification
Measured in real Electron 43.1.0 on macOS 26.3.1 (Darwin 25.3.0):
setSizejiggle (pre-Tahoe)invalidate()aloneTests: 12 across three files — 5 unit (
viewport-size-change-listener.test.ts), 4 component (SelectedTextCopyMenu.test.tsx), 3 component (RichMarkdownLinkBubble.render.test.tsx). Component tests render the real components underhappy-domand assert the menu/bubble survives a same-size resize but still dismisses on a real one.Mutation-checked — each of these fails the suite:
resizelistener → the same-size test failsTypecheck clean (all three projects); 1182 tests pass across
src/main/window/, the hook, and both component dirs.Limits
This fixes the macOS 26 path only. Pre-Tahoe still dismisses these popovers on reveal, and deliberately so: the
setSizejiggle is a real 1px viewport change, so no renderer-side dimension guard can filter it without also swallowing genuine user resizes. Closing that would mean changingforceRepaint's jiggle itself — out of scope here, and disclosed rather than papered over.Related
Follow-up to #10473 and #10485, which fixed the main-thread deadlock and the terminal re-gridding respectively. This closes the last renderer-visible side effect of the reflow that I could reproduce.
Made with Orca 🐋