fix(tray): stop auto-fit ResizeObserver feedback loop - #352
Open
MiguelMachado-dev wants to merge 1 commit into
Open
fix(tray): stop auto-fit ResizeObserver feedback loop#352MiguelMachado-dev wants to merge 1 commit into
MiguelMachado-dev wants to merge 1 commit into
Conversation
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.
Summary
ResizeObserver.mainbefore the hook fix and settles after it.The auto-fit pass temporarily removes height and overflow constraints to measure the full surface. On the affected Windows/WebView2 setup, the observer saw those programmatic changes and re-entered auto-fit indefinitely, making the Pop Out Dashboard alternate between measured and committed layouts. This is a separate feedback path from the fractional-DPI native-size cycle handled in #272.
Related issue
Follow-up to #261 and #272.
Affected areas
Validation
powershell.exe -ExecutionPolicy Bypass -NoProfile -File scripts\local-check.ps13reveal calls instead of settled2) and all 3 sizing tests pass afterwardpnpm --dir apps\desktop-tauri run tauri:build:debugUI / tray proof
CUA Driver is not installed on the test machine (
%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exeis absent), so I used equivalent native Windows/WebView2 proof against a fresh debug build from this branch:ResizeObservercallback328 x 920For comparison, the affected build produced roughly 160 body/surface height transitions and about 240 observer callbacks in 12 seconds, plus 37 one-frame visual pulses in 12.6 seconds.
Notes for reviewers
The
layoutReadyRef.currentguard is intentional: observer callbacks remain active during first-open convergence, then callbacks caused by the hook's own measurement pass are ignored whileprogrammaticInFlightRefis active. This preserves initial auto-fit and avoids misclassifying the hidden window's tiny bootstrap frame as a user-resized size.The diff is limited to
useTrayPanelLayout.tsand its sizing test; it contains no Rust/backend or local process-discovery changes.