Repository navigation
Compose stable Playwright recording review with timeline and image controls - #2100
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Playback still moves the Saved elements control while the reader is inspecting a capture. The new bounded .lf-trace-metadata region keeps the surrounding page fixed, but #draw() hides and shows the action and phase rows above its <details> summary as playback crosses frame and checkpoint stops. The summary consequently jumps under the pointer or keyboard reading position. The focused test_trace_inspection_survives_playback_gaps_and_scope_changes journey passed its interaction assertions on two runs, then failed the browser movement check at teardown both times: the summary moved 15px without input. Give those changing rows stable space, or otherwise keep the summary's position fixed within the inspector during replay.
leaf-agent
left a comment
There was a problem hiding this comment.
Replay still shifts visible recording content by 15px. On the merged head, uv run pytest tests/test_render_playwright_trace.py::test_trace_inspection_survives_playback_gaps_and_scope_changes -q -n0 passes the new Saved elements position assertion, then fails at browser teardown on two consecutive runs: p.lf-trace-action, h3.lf-trace-phase, and .vis-custom-time.selection move upward without input. The changed row order stabilizes the disclosure, but the recording still jumps while it plays. The changing metadata and timeline need to hold their visible positions through frame and checkpoint stops.
leaf-agent
left a comment
There was a problem hiding this comment.
The new drawing clipping assertion fails on this head. Twice, test_drawing_ink_follows_pixels_inside_their_ancestor_viewport measured the visible difference through x=527 after panning, while the stroke endpoint computed from the captured pixels is x≈393.5 (tests/test_render_drawing.py, line 1447). The test now covers the drawing behavior this PR claims, so this result leaves that behavior unresolved and the browser check red. The painted stroke or the screenshot comparison needs to be brought into agreement with the captured coordinates.
…races Keep imported action/phase targets ahead of variable details, remove duplicated readout facts, and retain their extent through intermediate frames. Saved trees own a bounded scrolling extent and a stable disclosure; register both nested reading regions and hand their reading places across archive-phase replacement. Only the generated timeline cursor plane declares runtime control reflow. Exercise narrow closed and expanded replay geometry, exact target ownership, empty-frame gaps, and the same tree's restored inspection. Activate the visible Play control with physical input where locator pre-scrolling would change the inspected viewport before the press. Hold product playback time during transport assertions, and measure clipping before a posted card adds unrelated paint.
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]>
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]>
Recording review now has independently selectable numbered moments, a time-scaled timeline immediately above captured pixels, and working playback, scrubbing, zoom and pan. Nearby events remain separately reachable, hover and keyboard focus expose their meaning, and replay preserves inspection through empty captures and scope changes.
Vis Timeline and Viewer.js own timeline geometry and image inspection without React. The adapter prepares replacement images offscreen and commits pixels, captions and archive-scoped comment identities together. Page-scoped inspection survives disposable renderers; a reserved capture viewport and bounded point details prevent playback and disclosure from moving surrounding controls. The retained Saved elements disclosure stays first; its expanded tree owns a fixed scrolling extent, and variable checkpoint readouts follow commentable action and phase targets. Pointer, keyboard and wheel review gestures pause playback.
The shared runtime exposes uncounted animation scheduling for playback and a synchronous input subscription for pausing before native review gestures. Keyboard commands use the shared register. The bounded inspector and saved tree register their actual reading regions; archive-phase reading places restore inspected nodes after empty frames and returns. Drawing frames stay tied to exact visual parts, so panned/clipped image comments remain on their captured pixels; main's shared paint geometry supplies clipping. The details shelf owns its controls' stacking layer so sticky page headers cannot cover a focused response action. The package adds
lf-trace-bookmarkmembers and replaces the olddata-heightframe with normal page flow. Its empty first paint shares the registry's waiting markup. Author guidance, the developer gallery and generated corpus follow that contract.Validation includes real imported recording browser regressions, native desktop and phone replay, source keyboard navigation, exact image/saved-element comments, drawing clipping, renderer retirement, API round trips and resizing. Vendored bundles and license notices are regenerated from the lock. Independent source and rendered reviews cover the final merged candidate.
A served recording startup comparison adds three requests and about 604 KB by presentation (about 572 KB of code), principally the two recording libraries. They render the visible timeline and inspected image, so the widget loads them before claiming presentation. Pages without this package do not load them.