Repository navigation
Split the default theme by widget, and hold widget-api to names behavior modules read - #2475
Merged
Merged
Conversation
Continues #2252's split: each widget's rules now live in `packages/default/styles/<widget>.css`, and `styles/theme.css` holds the package header and the ordered imports, which are the cascade order. The apparatus-voice rule, which spans several widgets, has its own file at its old position. Three interleaved fragments moved beside their widgets: lf-code's containment and lf-draft's source fallback (merged into its other `> pre` rule) from the shared block before the chart rules, and lf-text-document's preview rules from after the draft rules. The generated `packages/default/theme.css` differs from the old one only in those positions and esbuild's file-boundary comments; no rule between a fragment's old and new position matches the same elements, so no computed style changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
widget-api.js drops six re-exports no package, kernel widget, example, fixture package or reference reads: `inUi`, `layerLanding`, `renderInlineMarkdown`, `effectiveScroller`, `readingRegionFor` and `repaint`. The suite's reading-region probes now import `/runtime/reading-regions.js`, the owner. A layer test parses the exports and the behavior modules' imports and fails on an export with neither an importer nor a mention in a reference's code, so a name added for a probe or a test lands in check-api.js or its owner instead. `textNodesUnder`, which the survey proposed moving to check-api.js, stays: lf-suggestion imports it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 12, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 12, 2026
…kage to widget-api (#2517) Survey item F87. The physical annotation overlay moves from `skills/leaf/packages/default/runtime/annotation-overlay/` into the kernel at `skills/leaf/assets/runtime/annotation-overlay/` (a `git mv`; `index.js` shows as delete+add because its header grew). It keeps its `/runtime/annotation-overlay/*` URLs, and `leaf.js` still imports it dynamically only for overlay presentation, so a `data-annotations=page` page loads none of it. This reverses #1652's placement. Every overlay module imports private runtime owners (126 imports of 60 kernel modules), which no package may do, so the package boundary held only through exemptions. All of them are deleted: - `layer.py`: the default package's runtime is no longer a protected kernel path, and the default package is no longer skipped by the private-import check. - `.dependency-cruiser.mjs`: the `/runtime/annotation-overlay` alias, `.dependency-cruiser-resolve.mjs`, and the per-name directory fallback are gone. The overlay's imports are now relative, like every other kernel owner's, and `core-independent-of-overlay` still keeps other owners from reaching it (checked with a deliberate violating import). - `dev/leaf_dev/distribution.py` no longer deletes a second runtime tree, and `build/runtime-bundle.mjs` no longer names the overlay as an extra install entry. In a prepared install the overlay is now a lazily loaded chunk, as it already was on the website. - eslint and the pre-commit depcruise hook drop their `packages/*/runtime` globs. With the default package's exemption removed, the check also caught its vendored Sortable importing `/runtime/dom-move.js`. It now gets the same `move` from `/runtime/widget-api.js`, which already exported it (`build/vendor.mjs` and the committed bundle; `check:browser` reproduces the bytes). The default package now holds only widgets, their initial drawing, styles, theme, registry, and vendored libraries, and every bundled package passes the private-import check. The layer-returns lint message also changes. It sent packages to `runtime/focus.js` for `layerLanding`, which widget-api stopped exporting in #2475. It now names `layerLanding` as kernel-only and says a package gets `closeLayer` and `handBack` from `widget-api.js`. Checks: pre-commit (eslint, depcruise, prettier, ruff), `check:browser`, `test:browser`, `test:runtime`, a real `prepare()` of the install tree, and focused pytest for distribution, revision delivery, and layer composition. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
…3238) A decision laid its options across when an option held `lf-chart` or `lf-shot`, which `ask.css` named by tag, so a picture widget under any other name, `lf-diagram` or a project package's, did not count. Stylesheets read registry declarations through `$marks`, which paints each on the element, as pane layout already does for `x-reading-role`; `x-visual` was not among them. `x-visual` now paints `data-lf-visual` (`skills/leaf/assets/registry.json`), and `ask.css` reads it beside HTML's own picture elements, so any widget that declares it draws a picture counts. Its `$keys` entry says the declaration now also sets layout. The runtime's generated `marks.js` and the kernel are rebuilt. `test_options_holding_pictures_lay_across` adds a project package's picture widget with no module, which fails on the tag list and passes now. `lf-shot`'s reduced-motion rule moves from `toc.css`, where the theme split (#2475) left it, to `shot.css`; the compiled theme changes only in its position. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[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.
Two items from the code-quality survey's kernel/package boundary branch (F110, F91).
Default package theme by widget (F110).
packages/default/styles/theme.csswas one 2,482-line source; each widget's rules now live instyles/<widget>.cssbesideshot.css, andtheme.cssholds the package header and the ordered imports, which are the cascade order. Three interleaved fragments moved beside their widgets (lf-code's containment, lf-draft's source fallback, lf-text-document's preview rules). The generatedpackages/default/theme.cssdiffers from main only in those three positions and esbuild's file-boundary comments; no rule between a fragment's old and new position matches the same elements, so no computed style changes.widget-api holds only names behavior modules read (F91). Six re-exports with no package, kernel widget, example, fixture or reference reader are gone:
inUi,layerLanding,renderInlineMarkdown,effectiveScroller,readingRegionForandrepaint. The suite's reading-region probes import/runtime/reading-regions.jsinstead. A new test intests/test_interact_layer.pyparses widget-api's exports and the behavior modules' imports, and fails on an export that has neither an importer nor a mention in a reference's code. A name only probes or tests need then goes incheck-api.jsor its owning module.textNodesUnder, which the survey proposed moving tocheck-api.js, stays because lf-suggestion imports it.Checks:
build/browser/build.mjs --check,check:framework,test:runtime, the layer guards, and the seven browser tests whose probes were repointed.