Repository navigation
test: let the comment box rest beside a target after a reaction, Escape or press - #5661
Merged
Merged
Conversation
…pe or press #5428 stands the empty comment box beside the target `c` would open it on, so after a reaction returns focus to a diagram part, after Escape closes the field on an aimed item, and after a press leaves focus on a control, the bar stands at rest (`data-lf-rest`) where four tests expected it hidden. What those tests protect is that no field stays open, so they now assert that of the bar outside its rest. The tests' other assertions, focus returning to the part and the pending mark clearing, are unchanged. Refs #5641
leaf-agent
added a commit
that referenced
this pull request
Nov 7, 2026
…umn (#5662) The resting comment box from #5428 could stand over the page's own words and controls, which its placement header rules out: the box "stands only in the room beside what it is about, the margin its rail stands in". The code withheld it only above or below its target and beside a target the rail doesn't stand by (#5512). A box seated on the target's left, or right of a target that ends short of the column's edge, still stood over the column. It now rests only on the rail's side, and only where its target reaches the column's edge. `railEdge()` in `margin-layout.js` gives that edge, and `marginSpot` now reads it too. Anywhere else the box waits for `c`, as #5428 already has it do where there's no room beside the target. `c` still opens the box in every case. **What changes on screen.** Focus on a target that ends short of the column's right edge no longer shows the empty box. That covers an inline link or suggestion, a diagram part, a widget's control, and a question inside a tab panel. Beside a paragraph, a question or another block that reaches the edge, the box still rests in the margin. `tests/browser/navigation/test_commenting.py`, which holds #5428's behaviours, passes unchanged. | | Before | After | |---|---|---| | On me stop in a side-list tab panel |  |  | | Inline suggestion beside a draft |  |  | In the first, the box covers the "Second" tab the user presses next. In the second, it covers the draft's Edit control. **Tests from #5641 that fail on main `ec2799b1d` and pass on this branch** (`--run-main`, run singly): - `test_a_tally_counts_its_regions_obligations_and_walks_them`: the box intercepted the tab click. - `test_g_hints_press_each_visible_page_map_margin_entry`: the box intercepted the draft's Edit. - `test_widget_controller_owns_presentation_across_values_and_lifetimes[light]`, `[shadow-host]`, `[shadow-child]` and `test_page_owned_registry_and_widget_use_the_captured_public_api`: when the widget's value got shorter, a new placement moved the box 29 px with no input. It no longer rests beside that widget. - `test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place` - `test_a_reaction_returns_focus_to_the_visual_target[keyboard]`, `[aim]`, `test_a_declared_visual_part_can_raise_the_same_bar_from_the_keyboard`, `test_an_aim_at_a_seam_promises_the_element_its_press_takes` and `test_a_picture_in_a_control_stays_the_controls_and_any_other_takes_a_comment`: #5661 loosened these to accept a resting bar. The box no longer rests beside a diagram part, an aimed item or a button icon, so the second commit restores their original assertion that the bar is hidden, and they pass with it. <details><summary>Other checks</summary> - The resting-box and pane tests in `test_commenting.py` and `test_panes.py` (`-k "rest or box or waits or c_ or press"`): 27 passed. - `pnpm run test:runtime` (896 pass), `pnpm run check`, and `pre-commit run --files` on both files: pass. </details> Refs #5641 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
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.
#5428 rests the empty comment box beside the target
cwould open it on, whenever focus is on a target the user can see. Four tests ran a gesture that leaves focus on such a target and then expected.lf-fab-barhidden. What they protect is that no comment field stays open, and the resting box is #5428's intended result, so they now check.lf-fab-bar:not([data-lf-rest]). Their other assertions are unchanged.test_a_reaction_returns_focus_to_the_visual_target[keyboard]and[aim]: a reaction returns focus to the diagram part, and the box rests beside it.test_a_declared_visual_part_can_raise_the_same_bar_from_the_keyboard: Escape hands focus back to the part.test_an_aim_at_a_seam_promises_the_element_its_press_takes("within a pixel of the seam"): Escape returns focus to the aimed item.test_a_picture_in_a_control_stays_the_controls_and_any_other_takes_a_comment: a press on a button icon or a slider's picture leaves focus on that control. CI on main has failed it with the same "visible" message since run 42264154777, and it passes locally both before and after this change.The first three fail on main
ec2799b1dand pass on this branch, run singly with--run-main.Refs #5641 — automated triage