Repository navigation
Avoid trace image resets on unchanged resize events - #2126
Merged
Merged
Conversation
leaf-agent
commented
Oct 9, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
The new size guard never skips an unchanged resize. .lf-trace-canvas has a one-pixel border on each side, so its clientWidth and clientHeight stay two pixels below Viewer's dimensions (960×640 versus 958×638 in the browser probe). A same-size resize still wrote the image's style attribute 10 times. Viewer also handles the window resize event itself, so changing this comparison alone would let it reset the inspection view before Leaf decides whether to restore it. Let Leaf own Viewer's resize call and compare the same outer dimensions, then retain the inspection and assert that an unchanged signal writes no image styles.
The nightly margin checks caught repeated Viewer style writes and geometry reads on each resize event. Only refit an open trace image when its container dimensions change. Keep the user's zoom and pan after a same-size resize signal.
Viewer's own window listener refit the image on every signal, and the canvas border made the new client-size guard always true. Let the trace widget own resize calls using matching outer dimensions. The browser test now rejects redundant image style writes while retaining the zoomed inspection.
leaf-agent
force-pushed
the
fix/ci-37863827619-viewer-refresh
branch
from
October 9, 2026 02:37
0eeee30 to
0e16f46
Compare
leaf-agent
added a commit
that referenced
this pull request
Oct 9, 2026
Five nightly browser checks in [main CI run 37880455978](https://github.com/max-sixty/leaf/actions/runs/37880455978) were asserting older UI behavior. This changes their expected readings to match the shipped interaction while retaining their checks of focus, reachability, and stable search position. Each of the five failed on `main` before the edit and passed with it. - The compact comment and draft journeys now expect Send to focus the conversation card, as [#2116](#2116) intended. - The banner journey accounts for the visible Copy control in More. The command reference journey accounts for its preference checkbox as a native Tab stop. - At a 320 px tall viewport, the reference can stay at its height limit after filtering because its fixed controls and empty result occupy the available room. The test still requires a smaller dialog at taller viewports, a steady search field, and a visible empty result. Verification: the five named browser tests passed locally after failing individually before the edit; all three viewport variants of the reference filtering test passed. The run's margin failures are covered by [#2126](#2126), and its trace gallery failures remain recorded in [#2128](#2128). The focused visual review editor failure is separate from these outdated assertions. Co-authored-by: leaf-agent <[email protected]>
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.
An unchanged resize event was making the open trace image reapply its zoom and pan, which wrote the same Viewer styles repeatedly and forced page geometry reads. This change refits the image only when its container dimensions change, while preserving the inspection after a resize signal.
The failed main run included two margin refresh failures. Both reproduced on current
mainbefore this change and passed after it. The trace inspection journey, including a same-size resize signal, also passed on Python 3.12.The run's other failures concern focused reading position, stylesheet wording, the reader state probe, and trace gallery layout and rest state. The first three have since received separate changes on
main; the trace gallery failures still need their own repair.