Repository navigation
test: compare a grown control's own right edge, not left plus width, in the news sweep - #6398
Merged
Merged
Conversation
leaf-agent
approved these changes
Nov 18, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 18, 2026
…alue (#6404) ## What changes The layout box sweep (`DEFINE_BOXES`, `displaced`) now reads each watched control's `left`, `top`, `right` and `bottom` unrounded from `getBoundingClientRect()` and compares them exactly. The sixth `Math.round(box.right)` field added in #6398 is gone, since an unrounded right edge needs no special field. Failure messages report `(left, top, right, bottom)`. ## Why Rounding each value is a tolerance with fixed boundaries: an edge moving from 804.49 to 804.51 reads as a 1 px move, and a 0.4 px move inside a bucket reads as none. #6398 fixed one case of this (a right edge that never moved, read as 805 then 804, failing `test_the_poll_leaves_the_panel_where_it_was` on macOS); this removes the cause. ## Evidence Exact comparison adds no constant. On macOS, the poll test, the whole-row detection test and all seven `test_each_control_archetype_holds_its_neighbours_still` cases pass with it, so no run showed sub-pixel noise on boxes that didn't move; the `abs(a - b) <= 0.5` tolerance is not needed. Refs #6392 > _This was written by Claude Code on behalf of max-sixty_
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.
The panel-stays-put sweep (
displaced(..., news=True)) lets a control whose own words changed grow into free room as long as one edge holds still. It compared the right edge as roundedleft + width, but left and width are each rounded alone, so the edge can read a pixel off where it stands.That is what failed
test_the_poll_leaves_the_panel_where_it_wasin #6392 once #6304 put Next On Me at the field's end: publishing v2 swaps it for Open latest, which grows leftward with its right edge exactly at 804.375 px before and after (left 705.578 and width 98.797 round to 706 and 99, giving 805; left 667.484 and width 136.891 round to 667 and 137, giving 804). So the lead that the label overflows its slot on macOS metrics was wrong: nothing moves, and the test fails at full speed on a Mac, deterministically. It passes at #6304's parent and fails at #6304.The boxes now carry the edge rounded from the box's own right edge, and
heldcompares that. On a Mac the test fails before and passes after (2 of 2 at full speed, 5 of 5 under six busy loops).Refs #6392