Repository navigation
fix: keep the resting comment box off a target the margin rail doesn't stand beside - #5512
Conversation
…t stand beside The comment box at rest (#5428) waits for `c` when its seat is above or below its target, because there it would lie on the page's own controls. A seat to the side passed even where no margin stands beside the target: on a workspace, a pane whose neighbour fills the window beside it seated the box on the right, over the neighbour pane's first words, and a click there opened the box instead of reaching the page. The placement now also withholds the box when the target has no margin (`place.margin` is null), as #5428 meant: "Without room there, as on a workspace page or in a window under about 1340 px, it waits for the press". Behavior changed: after a click on a pane's words, no resting box appears over the other pane; `c` still opens the comment box there. Refs #5475
|
@leaf-agent The new
|
The resting box waited for c where place.margin was null, but marginSpot returns a visible row's rectangle before it asks whether the rail stands beside the target, so a shown row would have let the box rest over a neighbouring pane. margin-layout.js now exports railStandsBeside(target), which marginSpot also reads, and the resting box decides by it; marginSpot's geometry for its other callers is unchanged. A pane test covers an empty pane and a pane already showing another comment's pin.
|
Pushed 8586e8a. The rail-adjacency fact now has one home, On coverage: I couldn't reach the exact case where the resting target has its own visible row. With a comment on the pane itself ( Locally: that test, the panes click test, the resting-box tests in |
#5428 stands the empty comment box beside the target `c` would open it on, and its placement header says the box stands only in "the margin its rail stands in". The code withheld it only above or below the target and beside a target the rail doesn't stand by (#5512), so a box seated left of its target, or right of a target that ends short of the column's edge, stood on the page's own words and controls. Beside an On me stop inside a tab panel it covered the panel's "Second" tab; beside an inline suggestion it covered a draft's Edit control; beside a widget whose value shortened, the solve slid it across the column with no input. The box now rests only on the rail's side and only where its target reaches the column's edge (`railEdge` in margin-layout.js, which `marginSpot` reads too). Elsewhere it waits for `c`, as #5428 already has it do with no room beside the target; `c` still opens the box there. Tests that fail on main and pass with this: - test_a_tally_counts_its_regions_obligations_and_walks_them - test_g_hints_press_each_visible_page_map_margin_entry - test_widget_controller_owns_presentation_across_values_and_lifetimes [light], [shadow-host], [shadow-child] - test_page_owned_registry_and_widget_use_the_captured_public_api - 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 Refs #5641
…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]>
#5425 landed the repair this branch sat on, so its focusInPage move and its wheel test are main's now. passages.js takes main's focusInPage, which #5511 extended to Leaf surfaces seated in the page. reading-regions.js keeps this branch's chosen region beside main's removal of the local focusInPage. test_panes.py keeps #5512's resting-box test, the wheel test once, then this branch's two tests. Refs #4062
On a workspace with two panes side by side, a click on the left pane's words shows the resting comment box (#5428) over the right pane's first line. The next click there opens the box instead of reaching the page. This keeps the box off any target with no margin beside it, as #5428 described: "Without room there, as on a workspace page or in a window under about 1340 px, it waits for the press".
Cause. The placement (
browser/runtime/annotation-overlay/composing/floating-response.js) withholds the resting box only when its seat is above or below the target. Clicking the pane's words focuses its scroller, socnames the whole pane. The seat on the right has 600 px of room, but that room is the neighbouring pane, not a margin: a workspace keeps no rail, and a pane isn't in the column the rail lies beside (margin-layout.js).Change. The resting box also waits for
cwhen the rail doesn't stand beside its target. That fact now has one home,railStandsBeside(target)inmargin-layout.js, whichmarginSpotreads too; the box no longer infers it fromplace.margin, which can be a shown row's rectangle wherever the rail stands. Pressingcstill opens the comment box. The module header now says so.How #5228 relates. The box came after #5228. #5475 bisected the panes test to #5228, which first broke it at
userReadingRegion(); #5425 fixed that, and the click then hit this box.Tests.
tests/browser/navigation/test_panes.py::test_a_click_on_a_panes_words_makes_it_the_subject_of_every_scroll_keyfailed on main and passes with the change. The newtest_the_box_waits_for_the_press_beside_a_pane_the_rail_does_not_stand_bycovers an empty pane and a pane already showing another comment's pin. The resting-box tests intests/browser/navigation/test_commenting.pypass, includingtest_the_box_waits_for_the_press_with_no_room_beside_its_target.Refs #5475 — automated triage