Skip to content

test: compare a grown control's own right edge, not left plus width, in the news sweep - #6398

Merged
leaf-agent merged 1 commit into
mainfrom
fix-news-sweep-right-edge
Nov 18, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix-news-sweep-right-edge

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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 rounded left + 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_was in #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 held compares 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

This was written by Claude Code on behalf of max-sixty

@max-sixty max-sixty changed the title test: compare a grown control's right edge unrounded in the news sweep test: compare a grown control's own right edge, not left plus width, in the news sweep Nov 18, 2026
@leaf-agent
leaf-agent merged commit d1e1c5d into main Nov 18, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix-news-sweep-right-edge branch November 18, 2026 17:40
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_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants