Skip to content

A page's copy of a package keeps the sheets its sheets import - #6011

Merged
max-sixty merged 2 commits into
mainfrom
page-copy-keeps-imported-sheets
Nov 18, 2026
Merged

max-sixty merged 2 commits into
mainfrom
page-copy-keeps-imported-sheets

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A package that splits a sheet with @import "./styles/tabs.css", as packages.md documents, broke any page that selected it by path: page init --package ./pkg passed, and every later read of the page refused with "cannot compose the page's layer … imports './styles/x.css', which is no file". package check --render, which starts such a page, refused the same way while plain package check passed. The page's copy took the package's top files and directories and left a sheet imported from anywhere else behind.

The install copy already followed imports, in a second listing of what a layer input reads. layer.package_files is now the one listing, imported sheets included, and both the page's copy and the install copy write it. The install copy no longer preserves file times or modes outside scripts/.

Found by a package author working from the shipped references in #5981's trials. One model test composes the source, an installed copy and a page's copy and holds them equal; it fails without the imported sheets.

This was written by Claude Code on behalf of max-sixty

`page init --package ./pkg` copied a package's top files and directories into
the page but not a sheet one of its sheets imports from elsewhere in the
package, the `@import "./styles/tabs.css"` split packages.md documents. Init
passed, and every later read of the page refused to compose its layer; `package
check --render`, which starts such a page, refused too while plain `package
check` passed.

The install copy already followed imports, in its own listing of what a layer
input reads. `layer.package_files` is now the one listing, with the imported
sheets, and both copies write it.
# Conflicts:
#	src/leaf/runtime_selection.py
@max-sixty
max-sixty marked this pull request as ready for review November 18, 2026 06:32
@max-sixty
max-sixty merged commit b95189f into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the page-copy-keeps-imported-sheets branch November 18, 2026 06:49
max-sixty added a commit that referenced this pull request Nov 18, 2026
…s it missed (#6377)

`layer.input_paths` and `layer.package_files` each listed what a layer
input reads, by different rules: `input_paths` followed the imports of
every top-level `.css` in an input, while composition and
`package_files` follow only the sheets the layer composes. Both now take
one walk, `_input_entries`. `input_paths` resolves each path it yields,
and `package_files` reads the files among them. This follows #6011,
which made `package_files` the one listing for package copies.

A new test records every sheet composing the layer reads and holds
`input_paths` to it. It found two kernel sheets `composed_sheets` reads
by name that `KERNEL_STYLES` didn't list, `styles/control-face.css` and
`styles/shadow-leading.css`, so a `leaf-dev preview` missed an edit to
either. `KERNEL_STYLES` now names both.

Behavior changes: `input_paths` no longer follows the imports of a
top-level sheet the layer doesn't compose, and a package copy reads
`instructions/` one level deep, as composition does. Two tests that used
one scratch directory as the kernel and then as a package now put the
importing sheet in a package.

Tests: `tests/model/test_interact_layer.py` passes.
`dev/tests/model/test_interact_preview.py` has the same 8 failures on
its base as with this change, in the desktop-chat, file-subscription and
Codex-feedback tests.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants