Repository navigation
Draw a ring a box wears on its ::after through the box's tween - #6842
Conversation
#6800 moved the floating panel field's focus ring from the field's outline onto its ::after, so Send's box and an error no longer paint over it. The box motion found a part's ring only in its own outline, so it stopped drawing the field's ring on its surface while the field changed size: when a key took a line away, the ring jumped to the field's new size in the tween's first frame while the box's top edge still travelled down, and the field was carried as a painted face, which cut its words off where the shrunken field no longer reached. The motion now reads a ring from the part's own outline or, where none, from its ::after's (surfaces.css, "A focused box whose band something would cover"), draws it on the surface as before, and holds the ::after's ring transparent meanwhile. The same reading applies to the moving box's own ring, which a ring overlay such as the thread card wears on its ::after. test_a_line_the_field_gives_up_rides_the_box_s_top_edge and test_the_field_s_words_and_mark_keep_to_its_top_edge_both_ways fail at 52258cd (#6800) and on main, pass at its parent and with this change. Closes #6836
|
@leaf-agent The new
|
The motion held a box's ::after ring only when the box wore it as the tween began. That box exists only while the focus paint marks it, and a motion started for an ::after that doesn't exist yet never reaches it once it does, nor does one started for an ::after that a focus leaving took away. So a ring that arrives on the box's ::after mid-tween, whether for the first time or with focus coming back, stood at the box's rest size over an outline still travelling. For each tween, a MutationObserver now watches the focus paint's visible marks (`VISIBLE_FOCUS_MARKS`, focus.js) in the box's root. Each time they change, it reads the box's ring again and, where the ring is on its ::after, holds that ring transparent until the tween ends, on the tween's clock. test_a_ring_the_comment_box_comes_to_wear_mid_tween_waits_for_its_end fails without this change and passes with it.
|
Done in af13f16. A ring that arrives on the moving box's You were right that it was missed. A held animation on an Which boxes this reaches:
|
|
@leaf-agent The new late-focus check covers the moving comment box itself, but the floating panel field is a child part of the moving surface. During its line-removal tween, Tab away and Shift+Tab back can recreate the field's
|
The mid-tween hold reread only the moving box, so a ring a part of it wears on its ::after, as the floating panel's field does, came back at the part's rest size when focus left the field and returned during a line-removal tween. The watch now rereads the box and every part the tween resizes, and holds each ::after ring that arrives until the tween ends. test_a_ring_the_field_comes_back_to_mid_tween_waits_for_its_end covers Tab away and Shift+Tab back to the panel's field while the tween is held; it fails without this change and passes with it.
|
Fixed in 08a4d2b. The late-ring hold now rereads every part the tween resizes as well as the moving box. When a ring arrives on one of their
The floating panel and aim tests that cover rings and motion pass (18 tests), and so do |
leaf-agent
left a comment
There was a problem hiding this comment.
ruff format rejects the new floating panel test: it adds a third blank line before test_a_ring_the_field_comes_back_to_mid_tween_waits_for_its_end and leaves only one blank line between that test and the BELOW_THE_EDGE comment. Pre-commit's format hook would fail on it, so I'm pushing the reformat. The runtime change itself, re-holding a ring that comes back on an ::after of the box or a part the tween resizes, does what the two maintainer requests asked for, and I found nothing else to change in it.
|
Merged as 39ee727 with one red check, The two tests this PR claims to fix aren't edited by it, so its CI didn't run them. I ran them on main (e6753bb) and on this head: |
When a key takes a line out of the floating panel's field, the field's focus ring now shrinks with the box's top edge over the tween, as it did before #6800. Since #6800 it jumped to the field's new size in the tween's first frame, and the words were cut off at the top where the smaller field no longer reached.
Cause. #6800 moved the field's ring from its
outlineonto its::after, so that Send's box and an error no longer paint over the ring.box-motion.jslooked for a ring only in a part's ownoutline. With none there, it stopped drawing the field's ring on its moving surface. It carried the field as a painted face instead, so the::afterring stood at the field's resting size from the first frame.Change.
ringOfreads the ring from the part's own outline or, where it has none, from its::after(surfaces.css, "A focused box whose band something would cover"). The motion draws that ring on the surface as before, and holds the::after's outline transparent while it moves. The moving box's own ring is read the same way, which covers the floating comment box: it wears its ring on its field's::after. #6800's intent is unchanged: at rest the ring still draws over Send and errors.A ring that arrives mid-tween. An
::afterexists only while the focus paint marks its box. A motion started for one that doesn't exist yet never reaches it once it does, and the same goes for one started for an::afterthat focus took away by leaving. So for each tween, aMutationObserverwatches the focus paint's visible marks (VISIBLE_FOCUS_MARKS, exported from focus.js) in the box's root. Each time a ring arrives on the::afterof the box or of a part the tween resizes, such as the floating panel's field, it holds that ring transparent on the tween's clock until the tween ends, as the motion already does for a ring worn from the start.Verification.
test_a_line_the_field_gives_up_rides_the_box_s_top_edgeandtest_the_field_s_words_and_mark_keep_to_its_top_edge_both_waysfail at #6800's commit52258cd8band on main49007d755. They pass at #6800's parent and with this change. The other floating panel, thread and draft-sending tests that cover motion, focus and rings pass (-kselections, 145 tests).test_a_ring_the_comment_box_comes_to_wear_mid_tween_waits_for_its_endcovers the late ring: a line taken out of the comment box, then Tab and Shift+Tab back to the field while the tween is held. It fails without the late-ring hold (the ring is drawn mid-tween) and passes with it.test_a_ring_the_field_comes_back_to_mid_tween_waits_for_its_enddoes the same on the floating panel's field, a part of the moving box: it fails when the hold rereads only the box and passes when it rereads the resized parts too.pnpm run test:runtimeandpnpm run check:browserpass.test_a_side_comment_s_words_and_send_keep_to_its_edges_as_lines_come_and_goandtest_a_growing_margin_reply_keeps_its_whole_ring_from_the_first_framefail the same way with main'sbox-motion.js, so this PR doesn't cause them.First frame of the removal on main (the field's region as it stood, then at time 0)
On main the words sit one line higher at time 0, and the field's lower edge is already at its new height. The ring tracked the field's new size instead of the travelling edge. With this change the pixel difference stays under the test's 300 px tolerance; on main it was 2231 px.
Closes #6836 — automated triage