Repository navigation
Drop repaint's dead version-shortcuts slot, and draw a screenshot's controls with the library's offered - #7130
Merged
Merged
Conversation
…ontrols with the library's offered Two cleanups the nightly survey found, neither changing what a page draws: - `repaint.js` declared a `paintVersionShortcuts` painter and called it each frame, but no caller of `mountRepaint` passes one (`browser/leaf.js` supplies the live and export painters), so the slot and its call are removed. - `shot-view.js` built its own `offered(cls, pressable)` as a `ref` around `offerElement`. That is what `offered` in `runtime/lib/controls.js` already is, so the screenshot now imports the library's directive. Both write through `keeps` on every render, since an inline `ref` callback is new on each render. With its one outside caller gone, `offerElement` stops being exported, and the library's header names `offer` and `offered` as the forms that mark a field or box.
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.
Two cleanups from the nightly survey. Neither changes what a page draws.
repaint.js'spaintVersionShortcutsslot was dead. ThePainterstypedef declared it and each frame calledp.paintVersionShortcuts?.(), but neithermountRepaintcall inbrowser/leaf.js(live page or export) passes such a painter, and nothing else inbrowser/names it. The slot and the call are removed.shot-view.jshad its own copy ofoffered. Itsrender()definedoffered(cls, pressable)as arefaroundofferElement, which is whatofferedinruntime/lib/controls.jsalready is (elementDirective("offered", offerElement)). The screenshot now imports the library's directive, and its caption uses it too. Lit'srefre-runs a callback that changed, and an inline arrow is new each render, so the copy already wrote on every render, as the directive does; both write throughkeeps. With the screenshot gone as its only outside importer,offerElementis no longer exported (knip flags it otherwise), and the library header namesofferandofferedas the forms that mark a field or a box.The survey also flagged
drafts.jsimporting the framework as./framework.js, the one backward import #7113 recorded for it; #7119 movesframework.jsbesidedrafts.jsand drops that entry, so this PR leaves it alone.Verified: pre-commit on the changed files (eslint, oxfmt, knip, dependency-cruiser) passes;
pnpm run check:browserpasses;pnpm run test:runtimepasses 1130 of 1130; the screenshot teststest_shot_controls_have_disjoint_targets_and_labels_stay_passive,test_shot_inspects_either_original_without_flipping_or_moving,test_a_shot_takes_a_view_pressed_as_the_page_shows_and_keeps_its_dividerandtest_a_shot_opens_in_the_view_its_author_namespass. No regression test is added, since no behavior changes.