Repository navigation
Add lf-timeline: step through an authored sequence of events in lanes - #3973
Merged
Merged
Conversation
A new `timeline` package adds `lf-timeline`, with `lf-lane` and `lf-event` members. An event is an instant at `at` or a span from `at` to `end`, in milliseconds. Previous and Next, the Left and Right arrows, Home and End, the step list's rows and a press on a mark all set the step. Each instant and each span's start is one step; events that start together share it, and a span's end is not a step. The step is tab-local view state. Everything is drawn at every step, so stepping moves only the playhead: earlier events are drawn done, a span the playhead is inside is done up to it, and later events are faint. Labels sit in their own rows above each lane's bars, take greedy rows by measured width so none overlap, read back from their mark near the axis end, and stand in front of the playhead, so the line never crosses words. The initial renderer draws the whole widget before first paint; the module adopts it. Each event is a visual part `event:<id>`, and following a comment to one steps to it. The playhead glides between steps unless the reader asked for less motion. The axis geometry the Playwright timeline kept privately (tick steps and labels, greedy rows, text measurement) moves to `browser/runtime/time-axis.js`. The Playwright timeline imports it through widget-api.js's internal exports, and lf-timeline's initial bundle compiles it in. The trace keeps its own label clustering, since its lanes hold one row each. Prototype for #3172; not for landing as is. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json # dist/kernel/runtime/widget-api.js
…eline's track fractions
leaf-agent
previously approved these changes
Oct 25, 2026
leaf-agent
reviewed
Oct 25, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
Next moves under the pointer after stepping; the inline suggestion keeps the stepping controls in place.
leaf-agent
approved these changes
Oct 25, 2026
This was referenced Oct 26, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 26, 2026
The export audit reported five module-local helpers and one real reader it could not follow. Keep the helpers private, and teach the audit to follow a dynamic import's fulfilled namespace through `catch` and `finally`. This preserves `resolvePlace`, which Page diagnostics uses to reveal a captured location, instead of removing a working navigation path. The timeline helpers came from #3973; #4198 added the diagnostics reader through `import(...).catch(...)`. Their intended behavior stays intact. Rebuilding changes only two source hashes in the kernel manifest; compiled runtime and package bundles are byte-identical. Verified locally: the original six-export failure reproduces on main and passes after this change; a focused checker regression fails before the fix and passes afterward, including an unread-export control. All 668 runtime tests, the diagnostics captured-location browser test, and the browser build/type checks pass. Closes #4250 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 26, 2026
Timeline step rows contained the event text inside native buttons, preventing the reader from selecting a passage. The step list now uses Leaf's existing selectable control primitive, with Enter and Space activation supplied by each step's command scope. Clicks, arrows, saved step position and printed event text keep their behavior; dragging across a step's words leaves the playhead unchanged. The selectable constructor now lives beside the other initial-render control constructors, so early drawing and live widget modules use the same implementation. This preserves #3973's stepping and print behavior while fixing its inaccessible event text. Validation: the reported `test_page_fixture_renders[lost-update]` failed on main and passes with this change. Both timeline tests pass, including real passage selection, Enter/Space activation, arrow focus, resizing and print. `pnpm run check` and the configured pre-commit checks pass (including 668 runtime tests). The served startup comparison uses 44 requests in both arms; code loaded before presentation changes from 2,842,898 to 2,842,996 bytes. All four before/after still pairs are unchanged: the initial timeline, a keyboard-focused active step in light and dark, and the initial phone view. Independent code and browser review found no actionable issues. Closes #4243 — automated triage Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents explaining a sequence of events, such as two jobs racing on one row, had no widget for it, so they hand-drew timelines in SVG whose labels collided with each other and with the playhead, and the render check couldn't see it. A new optional
timelinepackage addslf-timeline: lanes of authored events on a shared time axis, which the reader steps through.An
lf-eventis an instant atat, or a span fromattoend, in milliseconds. Previous and Next, the Left and Right arrows, Home and End, a row of the step list and a press on a mark set the step. Each instant and each span's start is one step, events that start together share it, and a span's end is not a step, so an author who needs a moment such as "A's write lands" writes it as an instant. Overlapping spans need no rule of their own, since they start at different times. The step is tab-local view state, never a page event. There are no modes and no continuous play: a before/after comparison is two timelines in anlf-tabs, and continuous playback, if needed later, belongs inlf-motion.Every event is drawn at every step, so stepping moves only the playhead: earlier events are drawn done, a span the playhead is inside is done up to it, and later events are faint. Labels sit in rows of their own above each lane's bars and take greedy rows by measured width, so none overlaps a bar or another label; a label that would pass the axis end reads back from its mark, and labels stand in front of the playhead, so the line never crosses words. The initial renderer draws the whole widget before first paint, and the module adopts it. Each event is a visual part
event:<id>, and following a comment to one steps to it.The axis geometry the Playwright trace's timeline kept privately (tick steps and labels, greedy rows, text measurement) moves to
browser/runtime/time-axis.js, which the trace imports throughwidget-api.js's internal exports andlf-timeline's initial bundle compiles in. An eslint exemption lets package initial sources import it, as they already importmotion-icon-paths.js.Since the prototype:
print-color-adjust: exact.lf-laneno longer declares anid, which nothing reads.examples/lost-update.htmlis the race page from the prototype: a lost update between two jobs, before and after a row lock, as two timelines in tabs. It joins the specialized catalog, the Timeline card on the Extending page links to it, and the catalog stills are refreshed.tests/browser/widgets/test_timeline.pydrives every stepping route (button, arrows, Home/End, a step row, a mark, arrows carrying focus along the list, the step surviving a reload) and checks that no label is clipped, leaves the track, or overlaps another in its row, at desktop width, at 390 px and under print media. Putting the offered view back makes the print assertion fail.Checked by hand in Chromium and Firefox, light and dark, at 1100 px, 390 px and 320 px: tapping a step row, a mark and a label goes to that step, the buttons step at 390 px, and step rows are 44 px tall under a coarse pointer. Firefox prints from a static copy and runs no script, so a printed page there keeps the screen's label rows; positions are fractions, so marks stay correct, but labels laid out for a much wider screen could overlap on paper.
Left as is: the two tabs of a comparison each scale to their own duration, so equal spans draw at different lengths across tabs; a shared scale would need an option the design left out.
Tests run:
leaf package check packages/timeline --render,pnpm run test:runtime,pnpm run check:browser, the newtests/browser/widgets/test_timeline.py, and the Playwright trace tests that read the shared axis (test_trace_overview_shows_every_row_and_preserves_page_scrolling,test_timeline_tooltips_keep_their_words_above_marks_inside_the_timeline,test_trace_render_gate_restores_the_zoomed_time_window, and intests/journeys,test_trace_dense_moments_keep_the_axis_usable_and_page_scopedandtest_trace_zoom_and_pan_stay_within_the_fitted_recording).Closes #3172