Repository navigation
fix: read the floating panel's cover to the window foot, and let its own controls wear their keys - #5551
Conversation
…own controls wear their keys #5361 made the floating panel declare one cover box, and two readings of that cover went wrong: - `seenRect` kept the larger part of a box above or below the cover, so the strip between the panel card and the window's foot counted as seen. A seat send whose reply box showed 14px there skipped its landing and left the sent message under the panel. A cover now takes everything from itself to the window edge it stands nearer (`coverCut`), the rule `shownWindow` already used, and both read it. - `covered` read an empty box as covered, since nothing is left of a box with no height, so an empty widget seat was refused the comment editor. It now asks whether a cover cuts the box. - Key badge placement kept every chip off every cover, which since #5361 spans the panel's open view, so a control inside the panel's own thread view lost its key face. A chip keeps off the covers over its own control (`coverBoxes(owner)`), so chips for page controls still keep off the whole panel. test_required_page_failure_retains_composer_seat_focus_and_caret also expected an arriving thread to wait behind "1 new" in the rail, which #5392 replaced with drawing it at once; its later step now expects the thread drawn. Refs #5486
|
@leaf-agent The I reproduced the calculation with a 900px layout viewport, a visual viewport spanning y=600–900, and a cover spanning y=500–886: the base returns layout room y=0–500, while this head returns y=886–900. Please preserve the caller's selected viewport in the shared calculation and cover this layout-versus-visual case in a focused test.
|
`coverCut` chose the side a cover takes from the visual viewport even
when `shownWindow({viewport: "layout"})` asked for layout bounds, so
with the visual viewport panned toward the foot, `pinSeating` got the
14px strip under the floating panel instead of the room above it. The
cut now takes the viewport the caller reads; `uncovered` and `covered`
keep the visible one. A Node test pins the layout-versus-visual case.
|
Confirmed and fixed in e6586d2. |
ESLint's config gives tests/runtime no browser globals, so the bare `visualViewport` failed no-undef in the pre-commit job. The other runtime tests reach it as `window.visualViewport`.
leaf-agent
left a comment
There was a problem hiding this comment.
coverCut dropped the old guard that left alone a box with no overlap with a cover. A span that lies entirely past the window's edge now gets cut too, so covered reports a seat scrolled below the window as covered whenever a cover such as the floating panel's card stands at the foot. surface.js then refuses that seat the comment editor, although its comment says a seat merely scrolled out of the window should take it, as a file's comment below a long hunk does. A runtime check with a cover at y=842–886 and a seat at y=2000–2040 gives covered true on this head and false on cd527ca22. paintClips meets the same cut: paint for a box wholly below the window now gets an empty window, where the base left it uncut. I'll push the fix: a cover takes nothing from a span wholly past the window edge it is cut toward.
coverCut cut every span in a cover's columns toward the window edge the cover stands nearer, so a seat scrolled below the window read as covered under the floating panel's card at the foot, and composing refused it the editor; paint wholly below the window got an empty window. A span wholly past that edge now keeps all of itself, as the base's overlap guard did.
Travel and the walks land a destination at its start or centre, but since #5361 they decided whether to land by asking `alreadyShown`, which asks whether a *nearest* landing would move nothing. A nearest landing moves nothing for a box taller than the window that already fills it. So `t` to a thread on a long section the user is reading inside, and a diff file chosen in its tree after reading down, stopped bringing in the destination's opening. Before #5361, `readableDestination` always landed a tall destination's opening. #5361's description lists no such change, and two tests that protect it went red. `alreadyShown` now takes the `block` of the landing that follows. A box taller than its room counts as shown only where that landing would move nothing. Travel's start and centre gates, its departure plan, the queue walk and the change walk pass their block. Every nearest caller (Tab arrivals, entering a reply, returning to a thread, `scrollIntoView`'s own nearest check) keeps today's answer. For a box that fits its room, the block changes nothing. This fixes three of the seven tests #5486 tracks. Each fails on `main` (`19e31482b`) and passes here: - `test_render_aim.py::test_a_pointed_comment_keeps_the_rows_still_owed[thread]`: `t` lands the thread's section at its top again. - `test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down[pane]` and `[document]`: choosing a file in the tree lands its first line again. - `test_current_location.py::test_the_obligation_walk_keeps_its_place_when_a_version_lands`: a test-only change. Its 400px window left the decision the user stands on taller than its room and under the floating panel. It passed before #5361 only because that hid the decision, so the version's restore didn't land it. Since #5468 a key lets go of a focused control the user can't see, so that setup tests something else. At 600px the decision fits and stays on screen with the earlier obligation's words above it, which is the case the test describes. It still tells the kept walk place from the viewport's reading, since a walk from the reading block would step to `t-baffles`, not `t-bath`. **Verification.** `pnpm run test:runtime` (819) and `check:browser` pass. The landing change also ran with `test_obligation_walk.py`, `test_threads.py`, `test_render_navigation.py`, `test_render_diff_controls.py`, `test_render_aim.py`, `test_current_location.py`, `test_reading_place.py`, `test_changes_in_place.py`, `test_seated_threads.py` and `test_go_to.py`. Every failure there also fails on unchanged `main`. #5551 fixes three of the other four tests, through the floating panel's cover. The last one, `test_sample_host_view_changes_leave_its_scroll_and_keyboard_position`, stays open on #5486. Refs #5486 — automated triage Co-authored-by: leaf-agent <[email protected]>
…#5551, #5552 and #5566 chose (#5685) Ten of #5658's nightly journey cases still expected behavior that a recent change replaced on purpose. This PR updates those tests to what each change intended. One example page also changes: the feature gallery had lost a face that the server would draw. Each case was bisected locally to the first commit where it fails and checked against that commit's parent, which passes. Each fails on main `02a1e05cb` and passes on this branch. | Case | Since | What changed | | --- | --- | --- | | `test_render_widgets.py::test_notification_configuration_becomes_a_commentable_local_artifact` | #5508 | Every playground choice now has its own id. The receipt's comment anchors on the Banner choice that holds it (`format-banner`), not on `notification-simulator`. | | `test_render_gate.py::test_every_table_the_theme_sets_honestly_passes_the_gate` | #5566 | The fixture's available `<figure>` holds a question whose words start at the figure's edge, and #5566's new `words-off-column` advice flags exactly that. The journey checks tables, so it now leaves that question out. The browser test that measures the question's table inside the figure keeps it. | | `test_render_margin.py::test_margin_card_holds_its_top_as_a_turn_arrives_and_as_a_reply_wraps` | #5537 | Beside its passage, a card now holds its reply's foot while the user writes in it. The test now steps onto the thread with Escape before reading, as #5537's own tests do. It checks that each wrap, a long draft and the answer after a send grow the card upward. It is renamed `…holds_its_top_while_read_and_its_reply_while_written`. | | `test_thread_response_continuity.py::…keep_the_first_line[margin-delete-desktop]` | #5537 | Same rule: Backspace in a margin card's reply keeps the reply's foot still, so the margin case reads the foot. The seat cases are unchanged. | | `navigation/test_key_surfaces.py::test_user_news_interrupts_and_then_restores_background_news` | #5448 | The panel's key now stands with Comment after the field's words, so a notice reads `Agent replied — open Threads · Comment… c`. | | `test_page_holds_still.py::…[message-reply-below-chromium]`, `[…-firefox]` | #5551 | A thread's reply box under the floating panel now counts as unseen. A clicked message therefore stays still as an answer joins below it, the strict xfail passed, and its entries leave `MOVES_ON_MAIN`. | | `test_render_navigation.py::test_the_feature_gallery_exercises_its_core_journeys` | #5552 | `progressFace` reads a workflow's `at_work`, which the server stamps on every served workflow. The gallery's margin atlas builds its sample workflows from a stage alone, so its Working samples had lost the working face. The sample now carries `at_work` as the server would stamp it (`examples/developer/feature-gallery.page/widgets/lf-margin-entry-gallery.js`). | The other #5658 cases are handled elsewhere. #5684 (merged) fixed the fixture-resource case. A separate PR widens `--wide` for #5611's diff gutter. The `message-edit-above` cases of `test_page_holds_still.py` come from a runtime regression in #5551, which has its own cause issue. Refs #5658 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
…it grows (#5693) Since #5551, a reply box under the floating panel counts as unseen. When the user clicked a message's words, the keep therefore fell back from the thread's reply box to the thread's top, and a message above the clicked one that grew by 63px pushed the clicked message down by 63px. Now the keep first holds the caret that the click left in the focused container, as long as the caret lies outside the box the container stands at (`standsAt`) and the container isn't a text field. So the clicked message stays put when a message above it grows or an answer joins below it, and the reply box moves instead. This matches the rule `thread/reply-landing.js` already states ("a message they stand on stays and the box below it moves down"). A thread focused with its caret in the reply box, or with no caret in it, keeps the reply box's hold as before, so a send still holds the emptied box. #5551's rule that a box under the panel counts as unseen still holds. This change gives the keep a better place than the thread's top when that rule applies. Verification: - `test_page_holds_still.py::…[message-edit-above-chromium]` and `[message-edit-above-firefox]` fail on main `0534adc7d` with `the place moved 63.0px`. Both pass with this change. - The whole of `tests/journeys/test_page_holds_still.py --run-nightly` passes: 94 passed, and its 14 strict xfails still fail as recorded. That includes the `message-reply-below` cases, which #5685 had just un-xfailed. - `pnpm run test:runtime` (896 pass) and `pnpm run check:browser` pass. - One failure came up in the held-news browser tests I ran, `test_summaries.py::test_a_root_summary_keeps_thread_actions_outside_its_fold[1400-True-10]` (`labelLines` 3.0 > 1.1). It fails the same way on main without this change. One known gap: if the change rewrites the very words the caret sits in, the caret's range leaves with them, so this hold keeps nothing and the browser's scroll anchoring takes over. Closes #5687 — automated triage Co-authored-by: leaf-agent <[email protected]>
Three of the seven tests #5486 tracks fail because #5361's single cover box for the floating panel is read wrongly in two places, and one of them also hides a test step #5392 made stale. This fixes those three; the other four have separate mechanisms that are still being diagnosed under #5486.
test_a_seat_send_at_the_window_foot_shows_the_thread_it_started[verdict].seenRectkept the larger part of a box above or below the panel's cover, so the 14px strip between the panel card (842–886) and the window's foot (900) counted as seen. After a verdict seat's send, its reply box showed only that strip, soreturnToThreadskipped the landing and left the sent message under the panel. A cover now takes everything from itself to the window edge it stands nearer (coverCut).shownWindowalready used that rule, and nowuncovered(behindseenRect,inFrontand paint cuts) uses it too.test_required_page_failure_retains_composer_seat_focus_and_caret.coveredread an empty box as covered, because nothing is left of a box with no height. The widget's empty seatb(720×0) was refused the comment editor, although nothing stood over it.coverednow asks whether a cover cuts the box. The test's later step expected the thread that loses its seat to wait behind "1 new" in the rail. Draw news at once in the thread the user is in, and hold only threads already drawn on screen #5392 deliberately replaced that hold with drawing the thread at once, so the step now expects both threads drawn.test_a_thread_obligations_done_press_keeps_its_keys_and_one_workflow. Key badge placement kept every chip off every cover. Since Ask one question of whether the user sees a box, and land only what it says isn't shown #5361 the panel's cover spans its open view, so the Done button inside the panel's own thread view lost its key face. A chip now keeps off only the covers over its own control (coverBoxes(owner), which already leaves out a surface for what it holds). Chips for page controls still keep off the whole panel, as Ask one question of whether the user sees a box, and land only what it says isn't shown #5361 intended.What the user sees: a message sent from a seat at the window's foot lands clear of the panel, the comment editor takes an empty widget seat, and controls in the panel's thread view show their digits again. #5361's rule that what a panel view covers counts as unseen is unchanged.
Verification. Each of the three fails on
mainand passes on this branch's head, rebased on8bece180c.pnpm run test:runtime,check:browserandtest:browserpass.test_go_to.py,test_key_surfaces.py,test_composing.py,test_reading_place.pyandtest_render_floating_panel.pyshow no new failures. The four failures there also fail on unchangedmain: three are in main's run 42074354782, andtest_sending_flashes_only_the_new_message[card]fails the same way locally onmain.The four #5486 tests this leaves
These still fail with this change, each with its original message:
test_render_aim.py::test_a_pointed_comment_keeps_the_rows_still_owed[thread]:tnow gates its start landing onalreadyShown, a nearest-landing question. A section taller than the window that fills it counts as shown, sotno longer lands the section's top. The oldreadableDestinationasked whether the whole destination stood in the landing band.test_current_location.py::test_the_obligation_walk_keeps_its_place_when_a_version_landstest_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_downtest_render_controls.py::test_sample_host_view_changes_leave_its_scroll_and_keyboard_position(ResizeObserver error at teardown, still present after Lay the margin out once per resize, with one observer owning what it watches #5544)Refs #5486 — automated triage