Skip to content

fix: keep a chart's ring off when Escape's landing passes focus through it - #7516

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7513
Nov 28, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7513

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

When Escape lets go of a comment's card, Leaf moves Tab's starting point beside the reading by focusing the block on screen and blurring it in the same script (landAtReading). Focus and blur are the only way the platform moves that starting point. When the block is a chart, its focus listener put the reader on a point, showing g.lf-chart-at and circle.lf-chart-aim, and its blur listener hid them again. That made two display writes that changed nothing, which the write watch fails at teardown.

The chart now waits until the script that moved focus has finished before it reads focus (queueMicrotask). Focus that only passes through puts the reader on no point, and nothing is written. A Tab or click onto the chart still puts the reader on a point within the same task, before the next key arrives. The fix stays inside the chart package: Leaf's landing and the package interface are untouched.

test_escape_from_a_point_s_card_leaves_the_chart_s_ring_off follows the steps in the issue: arrow to a line point, comment with c, send, then press Escape. On main it fails in Chromium and Firefox with the two unchanged writes, and with the change it passes in both. The 51 other chart tests that match focus, key, ring, step and walk also pass. test_a_comment_takes_the_point_a_chart_s_ring_is_on fails on main with and without this change (#7495). #7512 repairs it, and with this fix that test could go back to the line's comment first.

Closes #7513 — automated triage

Escape from a comment's card lets go of it, and Leaf lands Tab's start
beside the reading by focusing the reading block and blurring it in the
same script (dom/focus.js, landAtReading). When that block is a chart, its
focus listener put the reader on a point, showing the ring and its aim,
and the blur took them off again: two writes of display that changed
nothing, which the write watch fails. The chart now reads focus once the
script that moved it is done, so focus that passes through puts the reader
on nothing; a Tab or a click still lands them on a point before the next
key.

The new browser test fails on both engines before the change with the
unchanged writes on g.lf-chart-at and circle.lf-chart-aim.

Closes #7513
@leaf-agent
leaf-agent merged commit 75af0c4 into main Nov 28, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7513 branch November 28, 2026 08:23
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.

Closing a chart comment's card with Escape writes an unchanged display on the chart's reading and aim

1 participant