Skip to content

Keep page tabs and trace images still during navigation - #2099

Merged
max-sixty merged 2 commits into
mainfrom
codex/stable-tab-and-trace-navigation
Oct 8, 2026
Merged

max-sixty merged 2 commits into
mainfrom
codex/stable-tab-and-trace-navigation

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Switching from a scrolled, long page tab to a short one could pull the sticky tab strip downward because the browser ran out of document to scroll. Root tab sets now fill the remaining viewport, so opening Serving keeps the navigation under the pointer.

Stepping a Playwright recording also preserves the reader's internal scroll position instead of pulling the image back to its top. Changing recorded sources still starts at the new source's evidence. Browser regressions cover mouse and keyboard navigation, short tab panels, frame toggles, and source changes; the developer scenarios and generated corpus describe the behavior.

Validation: focused browser regressions, 254 runtime tests, and pre-commit checks pass. The existing before/after journey confirms the tab strip remains at 42px instead of moving down by 174px.

This was written by Codex on behalf of max-sixty

Short page views reserve enough document height for their sticky tab strip. Timeline stepping preserves the recording reader’s scroll; source changes still start at the evidence. Cover both boundaries with browser regressions and update the developer scenarios.
@max-sixty
max-sixty merged commit fb607dd into main Oct 8, 2026
6 checks passed
@max-sixty
max-sixty deleted the codex/stable-tab-and-trace-navigation branch October 8, 2026 19:30
max-sixty added a commit that referenced this pull request Oct 9, 2026
Main reworked lf-trace (#2099, #2100, #2113): the recording review is in
page flow with a reserved capture viewport, a bounded metadata region, a
time-scaled timeline and a sticky toolbar. That supersedes this branch's
lf-trace work, so the playwright package, its gallery, the corpus and
the trace tests take main's versions whole: the sticky stepper, the
per-checkpoint image boxes, the held room and its releases, and the
branch's trace tests are dropped.

What this branch keeps is the layer's sticky-header focus rule
(`--lf-head-inset`, `--lf-landing-room` and its restart in state.css),
its declarations on the diff file header and action, the page tab strip
and panels, the Threads title and a sticky Ask's options, the column
sidebar's restart, and the diff code scroller's focus margin. Main's new
sticky trace toolbar now declares its inset too: focusing one of its
controls while stuck crept the page 14px a key, and moves nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 9, 2026
Tab no longer scrolls the page while it moves between the controls of a
stuck sticky header, anywhere in the layer.

The root's landing band (`scroll-padding-top`) starts 12px below the
banner, and a stuck header sits inside it. The browser treated each
focused control there as covered and scrolled toward it, but a stuck
header never comes out from under the band, so each key crept the page
again; a header standing wholly inside the band was centred instead.

| Header | Before (per focus) | After |
|---|---|---|
| lf-diff pinned file header | 17px | 0 |
| lf-diff file action | 12px | 0 |
| page tab strip | 403px (centred) | 0 |
| header after the tabs on a page with a tab strip | ~314px (centred) |
0 |
| Threads list thread title | 20px | 0 |
| lf-trace toolbar | 14px | 0 |

## The rule

- One zero-specificity focus rule in the kernel's `shadow.css` sets
`scroll-margin-top` from two properties. A focused element with neither
keeps the existing focus-ring margin.
- Each sticky header declares `--lf-head-inset`: how far below its
`--lf-top` slot its controls stand when stuck. The diff file header and
action, the page tab strip, the Threads title, the trace toolbar and a
sticky Ask's options declare it.
- `--lf-landing-room` is the scroller's landing room:
`--lf-root-headers` plus a 12px gap on the root, and the gap alone in
page-flow tab panels. It restarts with `--lf-top` at every box that
scrolls (`state.css`). The Threads list states its ring room, and the
column sidebar states none.
- A diff's sideways-scrolling code takes the file header's height as its
focus margin, so Tab from a stuck header into the code lands below the
header instead of 18px under it at phone width. `main` had the same
defect.
- `module-authoring.md` describes the declaration for package authors.

This branch began as a change to lf-trace's height model. Main's own
recording-review rework (#2099, #2100, #2113) superseded that part, so
the merge takes main's playwright package whole and keeps only the
layer-wide focus fix.

## Tests

`test_focus_in_a_stuck_header_leaves_the_page_where_it_is` pins the page
tab strip, a diff file header and file action inside the tabs, a second
diff after the tabs, and a short wide diff's code, then asserts that
focusing each one leaves scrollY where it was. Each case fails with the
kernel rule removed. The Threads title and the trace toolbar were
measured with a probe rather than asserted.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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