Skip to content

Reuse classified direction when Reach paints scroll cues - #3721

Merged
leaf-agent merged 6 commits into
mainfrom
fix/ci-39917870081-reach
Oct 23, 2026
Merged

leaf-agent merged 6 commits into
mainfrom
fix/ci-39917870081-reach

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Reach now reuses the computed direction it already reads while classifying each declared scroll surface. Its page-wide continuation repaint previously called getComputedStyle again for every sideways scroller after a drawing stroke, including all 40 unrelated cards in the regression page. A scroller's own scroll event still refreshes its direction, and layout classification refreshes it after layout changes.

test_releasing_a_drawing_does_not_read_every_card_before_preview fails on the reported main CI run and passes locally after the change. The sideways continuation test also passes, including its right-to-left transition. Verification: pnpm run check, pnpm run test:runtime, and both focused browser tests. The compiled kernel is rebuilt. Refs #2775 and #3695; other failures in this run remain separate.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The continuation cue remains visible after a declared scroller stops allowing horizontal scrolling. paintSidewaysReach now uses only the cached classification and the box widths; when overflow-x changes from auto to hidden through an inline style, the box can still have scrollWidth > clientWidth, so a child resize repaints a false data-lf-more-after. A base/candidate browser probe confirmed the base clears that cue and this head leaves it visible. The style change needs to invalidate the classification before the next paint while keeping the page-wide repaint free of per-card style reads.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A parent can change a declared scroller's computed overflow and direction without changing the scroller's own class or style. The new watcher then leaves sideways cached: after the next layout paint, a box with overflow-x: hidden still shows data-lf-more-after, and a box inheriting rtl still carries the ltr direction mark. A base/candidate browser probe confirmed both transitions. Reclassify when an ancestor changes the styles these cues depend on, while keeping the ordinary page-wide paint free of per-card style reads.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test check fails in pnpm run check:browser: the committed kernel still contains the pre-format version of browser/runtime/reach.js, so the generated bundle and kernel.json are stale. I’m rebuilding those outputs and will push the repair.

@leaf-agent
leaf-agent force-pushed the fix/ci-39917870081-reach branch from 94be96e to 680e6d6 Compare October 23, 2026 09:48
@leaf-agent
leaf-agent merged commit 941b59d into main Oct 23, 2026
4 checks passed
@leaf-agent
leaf-agent deleted the fix/ci-39917870081-reach branch October 23, 2026 10:02
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.

1 participant