Repository navigation
Read lf-trace's Lit nodes through refs and let #paint read its own inputs - #2514
Merged
Merged
Conversation
…puts Finishes the Lit conversion of lf-trace (#2346), review issue #36. - The 22-entry selector table that queried the rendered view and stored nodes as public element properties (`trace.play`, `trace.next`, `trace.body`, ...) is gone. The template binds each node the widget reads to a private `createRef()`. Nothing outside the widget read those properties. The six transport classes only the table read (`lf-trace-first`, `-previous`, `-next`, `-zoom-in`, `-zoom-out`, `-zoom-fit`) are dropped from the markup. - `#viewState()` built a bag of eleven values that `#paint()` unpacked. `#paint` now reads scope, extent, choices, origin and moments itself; `#draw` passes only the selected point, its saved tree and rows, which it also uses for projection. - The overlays built beside Viewer (missing-image note, input badge and point, playback image) are private fields. The playback image's construction, which `#placePlayback` repeated, has one helper. - Each capture figure keeps its canvas, image and status nodes, so `#drawPicture` no longer queries the figure by class. Three image lookups use `#imageById`, and a Moment that targets a saved element finds its row in the part inventory instead of querying `data-lf-datum`. - The position, selection and image zoom labels stay hand-written; a comment on `#drawTime` now says why: they change on every playback frame or pinch step, and `#draw` re-renders and re-projects. The window `resize` listener the review mentions beside the ResizeObserver was removed in #2429; the observer is the only feed. No user-visible behaviour changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 2026
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.
Follow-up to #2346, from the review of the Lit survey PRs (item 36 in that review's numbering, not a GitHub issue). It finishes the Lit conversion of
lf-trace, whose lifecycle already moved towhileConnected/frameForin #2503.Review item 36:
lf-tracereads its Lit nodes through refstrace.play,trace.next,trace.body, ...). The template now binds each node the widget reads to a privatecreateRef(). No test, widget or tool outside the widget read those properties. Only the table read the six transport classeslf-trace-first,-previous,-next,-zoom-in,-zoom-outand-zoom-fit, so they are gone from the markup.#viewState()removed. It built a bag of eleven values that#paint()then unpacked.#paintnow reads scope, extent, choices, origin and moments itself.#drawpasses only the selected point, its saved tree and the tree rows, which it also uses for projection.#placePlaybackused to build a second time. Each capture figure keeps its canvas, image and status nodes, so#drawPictureno longer queries the figure by class. Threeimages.findcalls now use#imageById. A Moment that targets a saved element finds its row in the part inventory instead of through adata-lf-datumquery.#drawTimenow says why: they change on every playback frame or pinch step, and#drawre-renders and re-projects.resizelistener the review saw beside the ResizeObserver was already removed in Draw the recording timeline on one time scale and remove Vis Timeline #2429, so the observer is the only thing that calls#resize.Behaviour that changed: none visible to the user.
lf-trace.js)Validation
tests/test_render_playwright_trace.pypass: comments restoring an exact image, bookmarks, comparison pairing, transport and playback, inspection through playback gaps and scope changes (it includes the saved-tree place checks), zoom and pan, the hidden recording, capture replacement, frames keeping saved elements, the play press, images at their capture times, and idle presentation.