Skip to content

Let a press's history entry and a strip's reveal move the control it pressed - #3972

Merged
max-sixty merged 3 commits into
mainfrom
press-travels-by-history-entry
Oct 25, 2026
Merged

max-sixty merged 3 commits into
mainfrom
press-travels-by-history-entry

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#3921 failed a gesture whose own scroll carries the control it was made
on unless its command declares travels, so a press, which has no
command, could take the user nowhere. The tab tests stayed unsurveyed;
forced on, they reported three lf-tabs presses. Max chose: a root
switch travels, the sideways reveal stays, and the embedded move is a
defect.

What the watch allows now

  • A gesture that adds a history entry takes the user somewhere. The
    watch reads it from the Navigation API's navigate event (a push),
    so the root set's switch, which adds one and opens the view at its
    place, needs no declaration of its own. Renaming the entry the user is
    on (replaceState) takes them nowhere. The link exemption stays,
    since a link whose script travels in place of the browser adds its
    entry only after arrival.
  • A scroll may bring the pressed control whole into the view of a box
    that showed only part of it (its scrollport less its scroll-padding,
    clear of the control's scroll-margin), by no more than the part it
    hid, as the browser's own focus does. #showTab revealing a tab from
    under the strip's edge press is one.
  • A scroll counts only on the boxes the gesture's own calls scrolled:
    the box a call names, or every box holding a reveal's or a focus's
    target. Before, once a gesture had called any scrolling API, the test
    driver's actionability scroll before its next press counted too.
  • Back and Forward open a rendering, as an input does: the browser's
    chrome makes them, so no event in the page carries them.

What the forced run reported, measured

  • The 295px "root switch" was the driver: after a framed tab's reveal,
    Playwright scrolled the page 370px to reach the next tab, and the
    watch blamed the framed tab's click. Per-box attribution removes it.
  • The 51px "reveal" was the driver too. A first tab's ring room at its
    strip's start asked the strip to scroll -35px it could not travel;
    that no-op scrollBy marked the press as scrolling, and Playwright
    then scrolled the strip 51px for the next tab. localScrollBy now
    clamps every path to what the scrollport can travel, and
    scrollIntoView skips a box that won't move. The real reveal on the
    next press is 7px, its ring room.
  • The root switch's own landing carries the tab 72px
    (test_a_tab_layout_completion_preserves_native_navigation) and is
    now allowed by its entry.
  • The embedded set's 24px was scroll anchoring. The browser's anchor
    stood in the panel the switch hides; once anything laid out that
    panel's content again (the watch, a passage read, find-in-page), it
    lost the open panel's 24px padding and the page scrolled by that.
    Unwatched, one getBoundingClientRect on the hidden panel's heading
    after the switch reproduced it. A hidden panel or part now declares
    overflow-anchor: none: before 229 → 205 scrollY, after 229 → 229.

Tests

  • The tab tests (widgets/test_tabs.py, navigation/test_tabs.py) now
    watch shifts, except the gallery case whose live revision adds a tab
    set above and moves the strip 430px, recorded in TODO.md. The side
    list test's large root font is now the second page's own from first
    paint, since setting it by script moved the page without input.
  • test_a_scroll_during_a_gesture_may_not_carry_its_control gains an
    entry the press adds (passes) and one it renames (fails); the first
    fails without the push rule. It now serves from an origin, which a
    data: URL lacks for the Navigation API.
  • test_a_press_may_bring_its_control_whole_into_its_scroller: a scroll
    by exactly the hidden 40px passes, 80px fails; without the reveal rule
    the first fails, without its bound the second passes.
  • Without the overflow-anchor rule,
    test_embedded_tab_selection_preserves_the_document_reading_position
    fails 205 vs 229; without the clamp,
    test_pointer_tab_underline_moves_without_delaying_the_view reports
    the 51px; without traversal as input,
    test_back_to_a_fragment_the_page_has_hidden_since_lands_on_it
    reports a passive 196px move.
  • With Fail a gesture whose own scroll carries the control it was pressed on #3921's Escape landing reverted and its position assertion
    removed, test_escape_from_a_box_leaves_it_where_it_stood still
    reports 49px under per-box attribution.

The merge film's Next inspection (83px) scrolls to keep its details in
view rather than to reveal the button, so it stays in TODO.md.

This was written by Claude Code on behalf of max-sixty

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 3 commits October 25, 2026 09:03
…pressed

#3921 failed a gesture whose own scroll carries the control it was made
on unless its command declares `travels`, so a press, which has no
command, could take the user nowhere. The tab tests stayed unsurveyed;
forced on, they reported three `lf-tabs` presses. Max chose: a root
switch travels, the sideways reveal stays, and the embedded move is a
defect.

## What the watch allows now

- A gesture that adds a history entry takes the user somewhere. The
  watch reads it from the Navigation API's `navigate` event (a `push`),
  so the root set's switch, which adds one and opens the view at its
  place, needs no declaration of its own. Renaming the entry the user is
  on (`replaceState`) takes them nowhere. The link exemption stays,
  since a link whose script travels in place of the browser adds its
  entry only after arrival.
- A scroll may bring the pressed control whole into the view of a box
  that showed only part of it (its scrollport less its scroll-padding,
  clear of the control's scroll-margin), by no more than the part it
  hid, as the browser's own focus does. `#showTab` revealing a tab from
  under the strip's edge press is one.
- A scroll counts only on the boxes the gesture's own calls scrolled:
  the box a call names, or every box holding a reveal's or a focus's
  target. Before, once a gesture had called any scrolling API, the test
  driver's actionability scroll before its next press counted too.
- Back and Forward open a rendering, as an input does: the browser's
  chrome makes them, so no event in the page carries them.

## What the forced run reported, measured

- The 295px "root switch" was the driver: after a framed tab's reveal,
  Playwright scrolled the page 370px to reach the next tab, and the
  watch blamed the framed tab's click. Per-box attribution removes it.
- The 51px "reveal" was the driver too. A first tab's ring room at its
  strip's start asked the strip to scroll -35px it could not travel;
  that no-op `scrollBy` marked the press as scrolling, and Playwright
  then scrolled the strip 51px for the next tab. `localScrollBy` now
  clamps every path to what the scrollport can travel, and
  `scrollIntoView` skips a box that won't move. The real reveal on the
  next press is 7px, its ring room.
- The root switch's own landing carries the tab 72px
  (`test_a_tab_layout_completion_preserves_native_navigation`) and is
  now allowed by its entry.
- The embedded set's 24px was scroll anchoring. The browser's anchor
  stood in the panel the switch hides; once anything laid out that
  panel's content again (the watch, a passage read, find-in-page), it
  lost the open panel's 24px padding and the page scrolled by that.
  Unwatched, one `getBoundingClientRect` on the hidden panel's heading
  after the switch reproduced it. A hidden panel or part now declares
  `overflow-anchor: none`: before 229 → 205 scrollY, after 229 → 229.

## Tests

- The tab tests (`widgets/test_tabs.py`, `navigation/test_tabs.py`) now
  watch shifts, except the gallery case whose live revision adds a tab
  set above and moves the strip 430px, recorded in `TODO.md`. The side
  list test's large root font is now the second page's own from first
  paint, since setting it by script moved the page without input.
- `test_a_scroll_during_a_gesture_may_not_carry_its_control` gains an
  entry the press adds (passes) and one it renames (fails); the first
  fails without the `push` rule. It now serves from an origin, which a
  data: URL lacks for the Navigation API.
- `test_a_press_may_bring_its_control_whole_into_its_scroller`: a scroll
  by exactly the hidden 40px passes, 80px fails; without the reveal rule
  the first fails, without its bound the second passes.
- Without the `overflow-anchor` rule,
  `test_embedded_tab_selection_preserves_the_document_reading_position`
  fails 205 vs 229; without the clamp,
  `test_pointer_tab_underline_moves_without_delaying_the_view` reports
  the 51px; without traversal as input,
  `test_back_to_a_fragment_the_page_has_hidden_since_lands_on_it`
  reports a passive 196px move.
- With #3921's Escape landing reverted and its position assertion
  removed, `test_escape_from_a_box_leaves_it_where_it_stood` still
  reports 49px under per-box attribution.

The merge film's Next inspection (83px) scrolls to keep its details in
view rather than to reveal the button, so it stays in `TODO.md`.

> _This was written by Claude Code on behalf of max-sixty_

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit c967bed into main Oct 25, 2026
4 checks passed
@max-sixty
max-sixty deleted the press-travels-by-history-entry branch October 25, 2026 16:18
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.

2 participants