From 4dfbd0c64fa7c9ceda60119ab825336b247b59d3 Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:03:20 -0600 Subject: [PATCH 01/13] Lint: add type-aware oxlint beside Stylelint oxlint 1.95.0 with oxlint-tsgolint runs the correctness category plus the typescript, react, unicorn, oxc, import and jsx-a11y plugins. Rules with pre-existing debt are off in .oxlintrc.json for now, to be ratcheted on. Co-Authored-By: Claude Opus 5.5 --- .oxlintrc.json | 71 +++++++ AGENTS.md | 2 +- package-lock.json | 500 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 + scripts/lint.mjs | 3 +- 5 files changed, 576 insertions(+), 2 deletions(-) create mode 100644 .oxlintrc.json diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 00000000..b2f10033 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["typescript", "react", "unicorn", "oxc", "import", "jsx-a11y"], + "categories": { + "correctness": "error" + }, + "ignorePatterns": [ + "**/dist/**", + "**/.demo/**", + "**/.agent/**", + "**/.review/**", + "**/.artifact/**", + "**/.build/**", + "**/fixtures/**", + "tools/html-skill/src/modules/copy.js", + "tools/html-skill/src/modules/terminal.js" + ], + "rules": { + "no-control-regex": "off", + "no-unused-vars": "off", + "no-unused-expressions": "off", + "no-useless-escape": "off", + "unicorn/prefer-string-starts-ends-with": "off", + "unicorn/no-useless-spread": "off", + "react/refs": "off", + "react/immutability": "off", + "react/set-state-in-effect": "off", + "react/purity": "off", + "react-hooks/exhaustive-deps": "off", + "typescript/no-floating-promises": "off", + "typescript/no-base-to-string": "off", + "typescript/no-misused-spread": "off", + "typescript/unbound-method": "off", + "typescript/restrict-template-expressions": "off", + "typescript/no-duplicate-type-constituents": "off", + "jsx-a11y/anchor-is-valid": "off", + "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/control-has-associated-label": "off", + "jsx-a11y/interactive-supports-focus": "off", + "jsx-a11y/no-autofocus": "off", + "jsx-a11y/no-noninteractive-element-interactions": "off", + "jsx-a11y/no-noninteractive-tabindex": "off", + "jsx-a11y/no-redundant-roles": "off", + "jsx-a11y/no-static-element-interactions": "off", + "jsx-a11y/prefer-tag-over-role": "off" + }, + "overrides": [ + { + "files": ["**/test/**", "**/*.test.*"], + "rules": { + "no-eval": "off", + "no-constant-condition": "off", + "no-self-assign": "off", + "oxc/double-comparisons": "off", + "unicorn/no-new-array": "off", + "unicorn/no-useless-fallback-in-spread": "off", + "unicorn/prefer-set-size": "off", + "typescript/no-implied-eval": "off", + "typescript/require-array-sort-compare": "off" + } + }, + { + "files": ["tools/review/**"], + "rules": { + "react/jsx-key": "off", + "jsx-a11y/label-has-associated-control": "off", + "typescript/require-array-sort-compare": "off" + } + } + ] +} diff --git a/AGENTS.md b/AGENTS.md index 5da0e2a6..261594c5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -259,7 +259,7 @@ skill folder. | Command | What it checks | When | |---|---|---| -| `npm run lint` | Token-only CSS (Stylelint) and the dependency allowlist. Takes seconds. | Before every commit. The pre-commit hook runs it for you. | +| `npm run lint` | Token-only CSS (Stylelint), type-aware JS/TS/JSX correctness (Oxlint), the dependency allowlist, and the public-surface vocabulary. Takes seconds. | Before every commit. The pre-commit hook runs it for you. | | `npm test` | The tokens' tests (contrast and the generated outputs), the React package's typecheck, build and browser tests (behaviour, accessibility with axe in both themes, bundle size and the size table, the browser floor), then the HTML skill's, the brand's and the sites' tests | Before every push | | `npm run check` | Everything CI runs on Linux: lint, tests, reference previews, packed-package consumer | Before opening a PR | | `npm run ci:local` | Both CI jobs, from `ci.yml`'s own steps: the Linux job above plus the generated-Swift drift check, then `swift build` and `swift test` | Before every merge while CI can't run (GitHub Actions minutes run out), on the PR's exact head and again after resolving conflicts. Post the result on the PR. | diff --git a/package-lock.json b/package-lock.json index 9d420136..f3fbebea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,8 @@ ], "devDependencies": { "esbuild": "0.28.2", + "oxlint": "1.95.0", + "oxlint-tsgolint": "7.0.2008", "stylelint": "17.16.0" }, "engines": { @@ -2027,6 +2029,437 @@ "node": ">= 8" } }, + "node_modules/@oxlint-tsgolint/darwin-arm64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/darwin-arm64/-/darwin-arm64-7.0.2008.tgz", + "integrity": "sha512-RXcQ439KXqspwHtw39825cyFmvrkOa1AA2CnqFNNG0pVJB0FdhpfQZsDLjRc/3Mt/uEG0MWOG50Hl09J2Ra9UA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint-tsgolint/darwin-x64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/darwin-x64/-/darwin-x64-7.0.2008.tgz", + "integrity": "sha512-4FpkHVDF1I4W0Owgsff8rDdf/XVcI9aoqflqyh3JiMCg7zCzWNkB0hfKMNjMDYDAeK/k1CNawAb7Y7mYGr/Xhg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint-tsgolint/linux-arm64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/linux-arm64/-/linux-arm64-7.0.2008.tgz", + "integrity": "sha512-CmheyZowc+sbXlZ2ksFrbqR6Mnu+HHheZZKTP3FpDBe64eCp6DzSrjcR2VHRj6mC2UKF1ZO0J8Z1e9Bgji4kKw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint-tsgolint/linux-x64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/linux-x64/-/linux-x64-7.0.2008.tgz", + "integrity": "sha512-7by4bup5rF9q7i19G6zPDXgywBi3tFB6jGzefoc/BfleNS0Q/eleYpD2SDLmsXzN2hFpDrfAskx7H0WnUtKbtQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint-tsgolint/win32-arm64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/win32-arm64/-/win32-arm64-7.0.2008.tgz", + "integrity": "sha512-u12UqT/xG64vXclqfe3/7I4j2mWSMZmXsMRBxbgmGfHaEfZUEzxl1QCNyx3TDM5OfsWWKH4dAHJtDRxTAiYA7A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxlint-tsgolint/win32-x64": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/@oxlint-tsgolint/win32-x64/-/win32-x64-7.0.2008.tgz", + "integrity": "sha512-Vjev4Ns8rdGa4Tb85ZsBkei0reLa77j3FNJsCKPo2gi5oTPK5O2eN42sim2ewoorgx7JQ3+49YuUKa1d6UKHPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.95.0.tgz", + "integrity": "sha512-hJna6w3COWJjfMPxomjZL82klTdrITm56PEpCsfO/xMkzQw/fNtJWauQ/YEwQqVttj0L5vDIa8rCcuhfAE3L4w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.95.0.tgz", + "integrity": "sha512-uAIGZQ9uJVUeogeWOSboI3F7twOuM4mNuZcHXD9+LdYLcWp7J6kbtRUXJ6GVqcs5E0Cjb4emmSBK9FNrkGuhqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.95.0.tgz", + "integrity": "sha512-Ogh1vfHO5vshKRop/He46r+WqC5BTqonYwhB4fp9e2gvOFvg1Xi6XsHTuM/lBSH85ZcaG+DS99EMAy9GcwDong==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.95.0.tgz", + "integrity": "sha512-kTrE1xfpQUBMMS50Ws6KY92N8OsJ8LE6JqxKqkHEY3KdsmguQ6kKVGSjzyt1HLwsSi0fQCvNRog8YRBBovD1AA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.95.0.tgz", + "integrity": "sha512-ho7E1VCInK0VnpneRaI1BEpe1ceJE8VjxP2O9THWdReV6bth1Q4+80kYVGGK47mHRyZ2NGztQZ2dWRo6j1lavA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.95.0.tgz", + "integrity": "sha512-94afnouMHcnHr/OtRh07gG5LehC9M0GjiSoik3xxTtrmq6cWxXOTAhYlBtxa67u/GlycbnHlDoGJfYlTshcr/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.95.0.tgz", + "integrity": "sha512-LEeclqV1/fafxPgJWN21Bri6HBBBZpEFluq/ZH7Avvu9HjJh/XOn6WwogJqX9X7pG2aITZ2nRH39+sUKEQt2WA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.95.0.tgz", + "integrity": "sha512-EpXpEQKmgtkvc6RyU84LM1e3CrVDWQkgghVzf1hMGgwjBzgKAJ/QntHgnzmu5cNeLBfa7GPCY+gGXxEll8Adcg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.95.0.tgz", + "integrity": "sha512-+96Md8c2BAgFp8nWHrUrpqba87DoU+HVJYIun6qA+QKFoeNd3xAWq1JYE6da4nVli9GgwRpfncfRePcgmQQaIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.95.0.tgz", + "integrity": "sha512-6yG99vsXct3Uv536w6Z1s03w2makRKnE0q3eJSmf+W/IwPmO56QLk8XUA6ebu/R5peCbJ67HmcWqACH+kg/6Bg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.95.0.tgz", + "integrity": "sha512-Eir0Z4ldh55AsQUqVDlLF4Pw3lSFXIdAl8ZNgU8tp/gTwT9JVCzWY0o3+ys9pCcpTN0vCqBwwuQfAUxzbIgvcQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.95.0.tgz", + "integrity": "sha512-ceRx+K2WJ7C3tIv+XjZS28oAoZ7DY29ZcWChPdXG5M100phI72FRDYwGRlWZEeDfmkROnarLTMKnnrQAtsC42Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.95.0.tgz", + "integrity": "sha512-WbD3sM08ZDk2QE6060wK/omihQKbRm+LVzKIg4W5zNTbEhYJChciqX49UZuqW59RGF+wBUxzAup7egUIESTjUA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.95.0.tgz", + "integrity": "sha512-F4ST2ZkFIiLL9OKyRCyC0KQQpwM5WIv0GTcMiZuYVa6xSRJHR05iVRqst+arOVudEPkhP47EnbuoC9UfVCYDyg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.95.0.tgz", + "integrity": "sha512-hEpYDZatpuxLrWlTlkwhHZ1e8QkL02aFS55BPQX1XA9iOd+yUEADGFF1iY6z+xkw6RkpzXFrtnDFe4/JNOLSRA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.95.0.tgz", + "integrity": "sha512-+JwIH9/uLgQXfxBvOAKzvp616m5i0fBR5ELEBHm5D+++fStBZ+74T7YW4xBpX13zNU2blr52Swoe3GTF1JyqRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.95.0.tgz", + "integrity": "sha512-pzJgcp3WkOSchukg5y5pn5mVIQ6P83RDI79YJ9gQZKed1pOgjhrmlc5AMizjuq6/P8VifhxzBsMqYI6LLjO2TA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.95.0.tgz", + "integrity": "sha512-54MeQvLRXkJqF1nEFs7wb73SrnurZJQy9fVK4NdEwumNKVwyUUxpGHhvfDMIY2NqJZS7kz0pY9uVty5664Gt1Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.95.0.tgz", + "integrity": "sha512-I/Fn+Fed1qzb1k2uRjMe2VRtRN1+ZObyU+E76B6v/Ul3Z6JdeAW5zBHSe0n5d8a0ZyU4iorzVy0Rw9LYgo3MSQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/@phosphor-icons/react": { "version": "2.1.10", "resolved": "https://registry.npmjs.org/@phosphor-icons/react/-/react-2.1.10.tgz", @@ -4885,6 +5318,73 @@ "regex-recursion": "^6.0.2" } }, + "node_modules/oxlint": { + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.95.0.tgz", + "integrity": "sha512-eNzjFjm1TU02/+ohAJjOB7aekRQgTXhOWxMGscEm8VJMokNnnix+PCZn7kqIuGIqxAoBnHxatqlN3Chz3N6PKA==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.95.0", + "@oxlint/binding-android-arm64": "1.95.0", + "@oxlint/binding-darwin-arm64": "1.95.0", + "@oxlint/binding-darwin-x64": "1.95.0", + "@oxlint/binding-freebsd-x64": "1.95.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.95.0", + "@oxlint/binding-linux-arm-musleabihf": "1.95.0", + "@oxlint/binding-linux-arm64-gnu": "1.95.0", + "@oxlint/binding-linux-arm64-musl": "1.95.0", + "@oxlint/binding-linux-ppc64-gnu": "1.95.0", + "@oxlint/binding-linux-riscv64-gnu": "1.95.0", + "@oxlint/binding-linux-riscv64-musl": "1.95.0", + "@oxlint/binding-linux-s390x-gnu": "1.95.0", + "@oxlint/binding-linux-x64-gnu": "1.95.0", + "@oxlint/binding-linux-x64-musl": "1.95.0", + "@oxlint/binding-openharmony-arm64": "1.95.0", + "@oxlint/binding-win32-arm64-msvc": "1.95.0", + "@oxlint/binding-win32-ia32-msvc": "1.95.0", + "@oxlint/binding-win32-x64-msvc": "1.95.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2008", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint-tsgolint": { + "version": "7.0.2008", + "resolved": "https://registry.npmjs.org/oxlint-tsgolint/-/oxlint-tsgolint-7.0.2008.tgz", + "integrity": "sha512-QuRK+gdriCwpOs+1PGq6/aImEEEK+EClNptdVtI0y4bDOhJ0uH/v3noz+yPKe+DYOTdkej75/5f3ouOGP5EGrQ==", + "dev": true, + "license": "MIT", + "bin": { + "tsgolint": "bin/tsgolint.js" + }, + "optionalDependencies": { + "@oxlint-tsgolint/darwin-arm64": "7.0.2008", + "@oxlint-tsgolint/darwin-x64": "7.0.2008", + "@oxlint-tsgolint/linux-arm64": "7.0.2008", + "@oxlint-tsgolint/linux-x64": "7.0.2008", + "@oxlint-tsgolint/win32-arm64": "7.0.2008", + "@oxlint-tsgolint/win32-x64": "7.0.2008" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", diff --git a/package.json b/package.json index d2333be6..451b6cb8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,8 @@ }, "devDependencies": { "esbuild": "0.28.2", + "oxlint": "1.95.0", + "oxlint-tsgolint": "7.0.2008", "stylelint": "17.16.0" } } diff --git a/scripts/lint.mjs b/scripts/lint.mjs index 087b71c1..2e2c41cb 100644 --- a/scripts/lint.mjs +++ b/scripts/lint.mjs @@ -1,9 +1,10 @@ -// `npm run lint`: the stylelint run, the dependency allowlist and the public surface's vocabulary, each to the end, then one summary (scripts/run-steps.mjs). The pre-commit hook runs this. +// `npm run lint`: stylelint, oxlint (type-aware JS/TS/JSX correctness), the dependency allowlist and the public surface's vocabulary, each to the end, then one summary (scripts/run-steps.mjs). The pre-commit hook runs this. import { isMain } from "./is-main.mjs"; import { runSteps } from "./run-steps.mjs"; export const LINT = [ { label: "stylelint", command: 'stylelint "packages/react/src/styles/**/*.css" "tools/html-skill/src/**/*.css" "sites/**/*.css"' }, + { label: "oxlint", command: "oxlint --type-aware ." }, { label: "dependency allowlist", command: "node scripts/check-deps.mjs" }, { label: "public-surface vocabulary", command: "node scripts/check-vocabulary.mjs" }, ]; From e493968220132f382d05dbd185ad4af431bb8e2e Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:13:47 -0600 Subject: [PATCH 02/13] Review fixes, batch 1: links, scale, waits, required fields, modal guard From the repo-wide review (slices B and D). Engineering only: each restores documented behaviour and changes no pixel. - HTML skill: one safeHref in core, shared by the palette and notifications; a notification link that is not relative, http, https or mailto is not written (the row is a button, warned once), and side/align are checked against the popover's values before they reach the markup. - LinkTabs: the narrow Select checks the destination before window.location.assign (React already refuses script URLs in the anchor). - Sites: an include must be inside its folder once links are followed; diagram marks resolve from the body's folder; buildPage returns external. - compose: srcset is read the way HTML reads it, so a data: URL's comma no longer lists its base64 as an external reference. - Charts (React and HTML): the step search runs five powers whatever the exponent, and ticks are capped, so values that overflow no longer hang. - takeClick: when both handlers return promises the press waits for both to settle, then raises the first failure. - MenuItem: a render element's onClick is taken into the menu's wait. - Field required: Textarea, Select and Combobox carry required too. - numeric Select with no options renders (no repeat(-Infinity)). - CommandList: focus moves only on a real view change (Strict Mode). - Scroll stops: a hidden control does not count as focusable. - Modals: the outside guard survives a changed forwarded ref, and controls that mount outside later are made inert too. - Contexts are /* @__PURE__ */ throughout. - oxlint: import/namespace off in tests (it depended on dist existing). Browser tests are written but not yet run (the machine was busy). Co-Authored-By: Claude Opus 5.5 --- .agent/skills/basalt-html/compose.mjs | 22 ++- .agent/skills/basalt-html/parts/core.js | 2 +- .../skills/basalt-html/parts/notifications.js | 2 +- .agent/skills/basalt-html/parts/palette.js | 2 +- .oxlintrc.json | 1 + packages/react/src/chart.tsx | 10 +- packages/react/src/choice.tsx | 8 +- packages/react/src/command-panel.tsx | 9 +- packages/react/src/dialog.tsx | 2 +- packages/react/src/event-log.tsx | 2 +- packages/react/src/feedback.tsx | 6 +- packages/react/src/field-group.ts | 5 + packages/react/src/field.tsx | 2 +- packages/react/src/fieldset-context.ts | 2 +- packages/react/src/forms.tsx | 6 +- packages/react/src/layers.ts | 4 +- packages/react/src/link-rows.tsx | 2 +- packages/react/src/link-tabs.tsx | 6 +- packages/react/src/listbox.tsx | 2 +- packages/react/src/menu.tsx | 7 +- packages/react/src/modal-outside.ts | 20 ++- packages/react/src/nav.tsx | 6 +- packages/react/src/open-list.tsx | 2 +- packages/react/src/reflow.tsx | 2 +- packages/react/src/scroll-stop.ts | 9 +- packages/react/src/selectable-list.tsx | 2 +- packages/react/src/site-brand.tsx | 2 +- packages/react/src/social-links.tsx | 2 +- packages/react/src/status-size.ts | 2 +- packages/react/src/tabs.tsx | 6 +- packages/react/src/toast.tsx | 6 +- packages/react/src/utils.ts | 9 + packages/react/src/wait.ts | 10 +- packages/react/test/repo-review.test.mjs | 158 ++++++++++++++++++ sites/build.mjs | 9 +- sites/test/build.test.mjs | 15 ++ tools/html-skill/src/compose.mjs | 22 ++- tools/html-skill/src/core.js | 7 +- tools/html-skill/src/modules/chart.js | 9 +- tools/html-skill/src/modules/notifications.js | 25 ++- tools/html-skill/src/modules/palette.js | 6 +- tools/html-skill/test/audit-fix-c8.test.mjs | 4 +- tools/html-skill/test/notices-b7.test.mjs | 30 ++++ 43 files changed, 396 insertions(+), 69 deletions(-) create mode 100644 packages/react/test/repo-review.test.mjs diff --git a/.agent/skills/basalt-html/compose.mjs b/.agent/skills/basalt-html/compose.mjs index d1cf730f..97622962 100644 --- a/.agent/skills/basalt-html/compose.mjs +++ b/.agent/skills/basalt-html/compose.mjs @@ -472,6 +472,26 @@ const staysInFile = (url) => /^(?:#|(?:data|blob|about|javascript|mailto|tel):)/ */ function externalReferences(held, markup) { const found = new Set(); + // The URLs of a srcset, read the way HTML reads one: a URL runs to whitespace (a data: URL's own commas included; trailing commas end the + // candidate), then its descriptors run to the next comma outside parentheses. + const srcsetUrls = (value) => { + const out = []; + let at = 0; + while (at < value.length) { + while (at < value.length && /[\s,]/.test(value[at])) at++; + let end = at; + while (end < value.length && !/\s/.test(value[end])) end++; + let url = value.slice(at, end); + const bare = url.replace(/,+$/, ""); + at = end; + if (bare.length === url.length) { + for (let depth = 0; at < value.length && (depth > 0 || value[at] !== ","); at++) depth += value[at] === "(" ? 1 : value[at] === ")" ? -1 : 0; + } + url = bare; + if (url) out.push(url); + } + return out; + }; const tags = (text) => { for (let at = text.indexOf("<"); at !== -1; at = text.indexOf("<", at + 1)) { if (!isAlpha(text[at + 1] ?? "")) continue; @@ -482,7 +502,7 @@ function externalReferences(held, markup) { if (tag.name === "link" && rel === "canonical" && key === "href") continue; if (key === "style") for (const url of cssUrls(value)) found.add(`<${tag.name} style> url(${url})`); if (!["src", "href", "xlink:href", "data", "poster", "srcset"].includes(key)) continue; - const urls = key === "srcset" ? value.split(",").map((candidate) => candidate.trim().split(/\s+/)[0]) : [value]; + const urls = key === "srcset" ? srcsetUrls(value) : [value]; for (const url of urls) if (url && !staysInFile(url)) found.add(`<${tag.name} ${key}="${url}">${tag.name === "a" || tag.name === "area" ? " (a link)" : ""}`); } at = tag.end - 1; diff --git a/.agent/skills/basalt-html/parts/core.js b/.agent/skills/basalt-html/parts/core.js index aabdc26c..e5317e95 100644 --- a/.agent/skills/basalt-html/parts/core.js +++ b/.agent/skills/basalt-html/parts/core.js @@ -1 +1 @@ -(function(){"use strict";var s={},p=[],v=[];function g(e){return String(e).replace(/[&<>"]/g,function(t){return{"&":"&","<":"<",">":">",'"':"""}[t]})}var b={};function f(e,t){var n=t||{},i=Object.prototype.hasOwnProperty.call(s,e)?s[e]:null;if(!i)return b[e]||(b[e]=1,console.warn('Basalt: unknown icon "'+e+'" (on this page: '+Object.keys(s).join(", ")+"; name an icon in quotes in the page, or add it to icons.json, and compose again)")),"";var a=Number(n.size);a>0&&a<1/0||(a=16);var o=n.label?'role="img" aria-label="'+g(n.label)+'"':'aria-hidden="true"';return''+i.map(function(l){return''}).join("")+""}function y(e){(e||document).querySelectorAll("[data-icon]").forEach(function(t){t.outerHTML=f(t.dataset.icon,{size:Number(t.dataset.size||16),label:t.dataset.label})})}var E="basalt-theme";function d(){var e=document.documentElement.getAttribute("data-theme");return e==="light"||e==="dark"?e:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function u(e,t){var n=e==="light"?"light":"dark";if(document.documentElement.setAttribute("data-theme",n),t!==!1)try{localStorage.setItem(E,n)}catch{}return v.forEach(function(i){i()}),n}function A(){var e=null;try{e=localStorage.getItem(E)}catch{}var t=e==="light"||e==="dark"?e:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return document.documentElement.setAttribute("data-theme",t),t}function w(){return u(d()==="dark"?"light":"dark")}function T(e){var t=document.getElementById("basalt-live");t||(t=document.createElement("div"),t.id="basalt-live",t.className="visually-hidden",t.setAttribute("role","status"),document.body.appendChild(t)),t.textContent="",setTimeout(function(){t.textContent=e},30)}function C(){if(!document.documentElement.__bhPrint){document.documentElement.__bhPrint=!0;var e=null;window.addEventListener("beforeprint",function(){e===null&&(e=d(),e!=="light"&&u("light",!1))}),window.addEventListener("afterprint",function(){e&&u(e,!1),e=null})}}function m(e,t,n){p.push([e,t,n])}m(10,"initTheme",A),m(40,"hydrateIcons",function(){y()}),m(100,"wirePrint",C);function k(e){var t=e||{},n=function(){p.slice().sort(function(i,a){return i[0]-a[0]}).forEach(function(i){try{i[2](t)}catch(a){console.warn("Basalt: "+i[1]+" failed: "+(a&&a.message))}})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function I(e){var t=Array.prototype.slice.call(e.childNodes),n=t.every(function(r){return r.nodeType===3||r.nodeType===1&&(r.tagName.toLowerCase()==="svg"||r.hasAttribute("data-pair"))});if(!n){var i="input,select,textarea,button,form,iframe,object,embed,script,style,video,audio,canvas,dialog,template,slot";if(t.some(function(r){return r.nodeType===1&&(r.matches(i)||r.querySelector(i))})){e.setAttribute("data-bare","");return}var a=document.createElement("span"),o=document.createElement("span"),l=document.createElement("span");t.forEach(function(r){a.appendChild(r)}),o.innerHTML=a.innerHTML,o.querySelectorAll("*").forEach(function(r){"id name form for list aria-labelledby aria-describedby aria-controls aria-owns aria-activedescendant aria-details aria-errormessage".split(" ").forEach(function(c){r.removeAttribute(c)}),Array.prototype.slice.call(r.attributes).forEach(function(c){c.value.indexOf("url(#")>=0&&r.removeAttribute(c.name)})}),o.setAttribute("data-wide",""),o.setAttribute("aria-hidden","true"),o.setAttribute("inert",""),l.setAttribute("data-reserve",""),l.appendChild(a),l.appendChild(o),e.appendChild(l),e.setAttribute("data-reserved","");return}t.forEach(function(r){var c=r.nodeType===3?r.nodeValue.trim():"";if(c){var h=document.createElement("span");h.setAttribute("data-label",c),e.replaceChild(h,r),h.appendChild(r)}}),e.setAttribute("data-reserved","")}window.Basalt={init:k,icon:f,hydrateIcons:y,announce:T,getTheme:d,setTheme:u,toggleTheme:w,_:{esc:g,reserve:I,icon:f,announce:T,getTheme:d,setTheme:u,step:m,onTheme:v,addIcons:function(e){for(var t in e)s[t]=e[t]}}}})(); +(function(){"use strict";var u={},p=[],v=[];function g(e){return String(e).replace(/[&<>"]/g,function(t){return{"&":"&","<":"<",">":">",'"':"""}[t]})}function A(e){try{return/^(https?|mailto):$/.test(new URL(String(e),"https://basalt.invalid/").protocol)}catch{return!1}}var b={};function m(e,t){var n=t||{},i=Object.prototype.hasOwnProperty.call(u,e)?u[e]:null;if(!i)return b[e]||(b[e]=1,console.warn('Basalt: unknown icon "'+e+'" (on this page: '+Object.keys(u).join(", ")+"; name an icon in quotes in the page, or add it to icons.json, and compose again)")),"";var a=Number(n.size);a>0&&a<1/0||(a=16);var o=n.label?'role="img" aria-label="'+g(n.label)+'"':'aria-hidden="true"';return''+i.map(function(l){return''}).join("")+""}function y(e){(e||document).querySelectorAll("[data-icon]").forEach(function(t){t.outerHTML=m(t.dataset.icon,{size:Number(t.dataset.size||16),label:t.dataset.label})})}var E="basalt-theme";function d(){var e=document.documentElement.getAttribute("data-theme");return e==="light"||e==="dark"?e:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function s(e,t){var n=e==="light"?"light":"dark";if(document.documentElement.setAttribute("data-theme",n),t!==!1)try{localStorage.setItem(E,n)}catch{}return v.forEach(function(i){i()}),n}function w(){var e=null;try{e=localStorage.getItem(E)}catch{}var t=e==="light"||e==="dark"?e:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return document.documentElement.setAttribute("data-theme",t),t}function C(){return s(d()==="dark"?"light":"dark")}function T(e){var t=document.getElementById("basalt-live");t||(t=document.createElement("div"),t.id="basalt-live",t.className="visually-hidden",t.setAttribute("role","status"),document.body.appendChild(t)),t.textContent="",setTimeout(function(){t.textContent=e},30)}function k(){if(!document.documentElement.__bhPrint){document.documentElement.__bhPrint=!0;var e=null;window.addEventListener("beforeprint",function(){e===null&&(e=d(),e!=="light"&&s("light",!1))}),window.addEventListener("afterprint",function(){e&&s(e,!1),e=null})}}function f(e,t,n){p.push([e,t,n])}f(10,"initTheme",w),f(40,"hydrateIcons",function(){y()}),f(100,"wirePrint",k);function I(e){var t=e||{},n=function(){p.slice().sort(function(i,a){return i[0]-a[0]}).forEach(function(i){try{i[2](t)}catch(a){console.warn("Basalt: "+i[1]+" failed: "+(a&&a.message))}})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n()}function L(e){var t=Array.prototype.slice.call(e.childNodes),n=t.every(function(r){return r.nodeType===3||r.nodeType===1&&(r.tagName.toLowerCase()==="svg"||r.hasAttribute("data-pair"))});if(!n){var i="input,select,textarea,button,form,iframe,object,embed,script,style,video,audio,canvas,dialog,template,slot";if(t.some(function(r){return r.nodeType===1&&(r.matches(i)||r.querySelector(i))})){e.setAttribute("data-bare","");return}var a=document.createElement("span"),o=document.createElement("span"),l=document.createElement("span");t.forEach(function(r){a.appendChild(r)}),o.innerHTML=a.innerHTML,o.querySelectorAll("*").forEach(function(r){"id name form for list aria-labelledby aria-describedby aria-controls aria-owns aria-activedescendant aria-details aria-errormessage".split(" ").forEach(function(c){r.removeAttribute(c)}),Array.prototype.slice.call(r.attributes).forEach(function(c){c.value.indexOf("url(#")>=0&&r.removeAttribute(c.name)})}),o.setAttribute("data-wide",""),o.setAttribute("aria-hidden","true"),o.setAttribute("inert",""),l.setAttribute("data-reserve",""),l.appendChild(a),l.appendChild(o),e.appendChild(l),e.setAttribute("data-reserved","");return}t.forEach(function(r){var c=r.nodeType===3?r.nodeValue.trim():"";if(c){var h=document.createElement("span");h.setAttribute("data-label",c),e.replaceChild(h,r),h.appendChild(r)}}),e.setAttribute("data-reserved","")}window.Basalt={init:I,icon:m,hydrateIcons:y,announce:T,getTheme:d,setTheme:s,toggleTheme:C,_:{esc:g,safeHref:A,reserve:L,icon:m,announce:T,getTheme:d,setTheme:s,step:f,onTheme:v,addIcons:function(e){for(var t in e)u[t]=e[t]}}}})(); diff --git a/.agent/skills/basalt-html/parts/notifications.js b/.agent/skills/basalt-html/parts/notifications.js index 29b2e6cb..7b68e8f2 100644 --- a/.agent/skills/basalt-html/parts/notifications.js +++ b/.agent/skills/basalt-html/parts/notifications.js @@ -1 +1 @@ -(function(M){"use strict";var o=M._,T=0,L={success:"CheckCircle",warning:"Warning",danger:"XCircle",pending:"Circle"},j='',H='';function p(l){return!!(l.entries&&l.entries.length)}function S(l){var f=[];return l.forEach(function(i){if(!p(i))return f.push(i);var c=i.entries.filter(function(d){return d.status!=="danger"});c.length&&f.push(c.length===i.entries.length?i:Object.assign({},i,{entries:c})),i.entries.forEach(function(d){d.status==="danger"&&f.push(d)})}),f}function z(l,f){var i=f||{};typeof l=="string"&&(l=document.querySelector(l));var c="bh-notes-"+ ++T,d=i.label||"Notifications",u=S(i.entries||[]),k={};l.innerHTML='

'+o.esc(d)+'

    ';var h=l.firstElementChild,r=l.lastElementChild,B=h.querySelector(".notifications-dot"),R=r.querySelector(".notifications-count"),b=r.querySelector(".notifications-mark"),V=r.querySelector(".notifications-empty"),w=r.querySelector(".notifications-scroll"),g=r.querySelector(".notifications-list"),q=r.querySelector(".notifications-foot");q.innerHTML=(i.onClearAll?'':"")+(i.viewAllHref?'View all':'');var I=q.lastElementChild,v=r.querySelector(".notifications-clear"),m;function C(){r.matches(":popover-open")&&r.hidePopover()}function P(t){return p(t)?t.entries.some(function(n){return!!n.unread}):!!t.unread}function E(t,n,e){var a=t.status||"neutral",s=e||!t.href?"button":"a",y=P(t),A=e?Number.isInteger(t.count)&&t.count>0?t.count:t.entries.length:0,N=''+(y?'Unread: ':"")+o.esc(t.title)+(e?', '+A+" times":"")+"";return"<"+s+(s==="a"?' href="'+o.esc(t.href)+'"':' type="button"')+' class="notification" data-index="'+n+'" data-id="'+o.esc(t.id)+'"'+(y?" data-unread":"")+' data-status="'+o.esc(a)+'"'+(t.current?' data-current aria-current="'+(s==="a"?"page":"true")+'"':"")+(e?' data-group aria-expanded="'+!!k[t.id]+'" aria-controls="'+e+'"':"")+'>'+(e?''+N+'"+j+"":N)+(t.description?''+o.esc(t.description)+"":"")+'"}function x(){var t=g.contains(document.activeElement)&&document.activeElement.dataset.id,n=u.reduce(function(e,a){return e+(p(a)?a.entries.filter(function(s){return s.unread}).length:a.unread?1:0)},0);h.setAttribute("aria-label",n>0?d+", "+n+" unread":d),B.hidden=n===0,R.textContent=n+" unread",n===0?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled"),v&&(u.length===0?v.setAttribute("aria-disabled","true"):v.removeAttribute("aria-disabled")),V.hidden=u.length>0,w.hidden=u.length===0,g.innerHTML=u.map(function(e,a){if(!p(e))return"
  • "+E(e,a)+"
  • ";var s=c+"-g"+a;return"
  • "+E(e,a,s)+'
      "+e.entries.map(function(y,A){return"
    • "+E(y,a+"."+A)+"
    • "}).join("")+"
  • "}).join(""),t&&[].some.call(g.querySelectorAll(".notification"),function(e){return e.dataset.id===t&&(e.focus(),!0)})}return g.addEventListener("click",function(t){var n=t.target.closest(".notification");if(n){var e=n.dataset.index.split(".");if(n.hasAttribute("data-group")){var a=n.getAttribute("aria-expanded")!=="true";k[u[Number(e[0])].id]=a,n.setAttribute("aria-expanded",String(a)),document.getElementById(n.getAttribute("aria-controls")).hidden=!a;return}var s=u[Number(e[0])];i.onSelect&&i.onSelect(e.length>1?s.entries[Number(e[1])]:s),C()}}),b.addEventListener("click",function(){b.getAttribute("aria-disabled")!=="true"&&i.onMarkAllRead&&i.onMarkAllRead()}),v&&v.addEventListener("click",function(){v.getAttribute("aria-disabled")!=="true"&&i.onClearAll()}),I.addEventListener("click",function(){i.onViewAll&&i.onViewAll(),C()}),r.addEventListener("toggle",function(t){t.newState==="open"?m=o.glide(w,w.firstElementChild,{active:".notification[data-hovered]",item:".notification"}):m&&(m(),m=null)}),x(),{element:r,button:h,setEntries:function(t){u=S(t||[]),x()},open:function(){r.showPopover({source:h})},close:C}}M.notifications=z})(window.Basalt); +(function(S){"use strict";var o=S._,z=0,L={success:"CheckCircle",warning:"Warning",danger:"XCircle",pending:"Circle"},I='',R='';function h(e){return!!(e.entries&&e.entries.length)}var V={bottom:1,top:1,left:1,right:1},G={start:1,center:1,end:1},M={};function q(e){return e==null||e===""?null:o.safeHref(e)?e:(M[e]||(M[e]=1,console.warn("Basalt: a notification link must be relative, http, https or mailto")),null)}function x(e){var f=[];return e.forEach(function(i){if(!h(i))return f.push(i);var c=i.entries.filter(function(d){return d.status!=="danger"});c.length&&f.push(c.length===i.entries.length?i:Object.assign({},i,{entries:c})),i.entries.forEach(function(d){d.status==="danger"&&f.push(d)})}),f}function P(e,f){var i=f||{};typeof e=="string"&&(e=document.querySelector(e));var c="bh-notes-"+ ++z,d=i.label||"Notifications",u=x(i.entries||[]),k={},U=V[i.side]?i.side:"bottom",_=G[i.align]?i.align:"end",N=q(i.viewAllHref);e.innerHTML='

    '+o.esc(d)+'

      ';var b=e.firstElementChild,s=e.lastElementChild,D=b.querySelector(".notifications-dot"),K=s.querySelector(".notifications-count"),g=s.querySelector(".notifications-mark"),O=s.querySelector(".notifications-empty"),w=s.querySelector(".notifications-scroll"),m=s.querySelector(".notifications-list"),H=s.querySelector(".notifications-foot");H.innerHTML=(i.onClearAll?'':"")+(N?'View all':'');var W=H.lastElementChild,v=s.querySelector(".notifications-clear"),y;function C(){s.matches(":popover-open")&&s.hidePopover()}function X(t){return h(t)?t.entries.some(function(a){return!!a.unread}):!!t.unread}function E(t,a,n){var r=t.status||"neutral",l=n?null:q(t.href),p=l?"a":"button",A=X(t),j=n?Number.isInteger(t.count)&&t.count>0?t.count:t.entries.length:0,B=''+(A?'Unread: ':"")+o.esc(t.title)+(n?', '+j+" times":"")+"";return"<"+p+(p==="a"?' href="'+o.esc(l)+'"':' type="button"')+' class="notification" data-index="'+a+'" data-id="'+o.esc(t.id)+'"'+(A?" data-unread":"")+' data-status="'+o.esc(r)+'"'+(t.current?' data-current aria-current="'+(p==="a"?"page":"true")+'"':"")+(n?' data-group aria-expanded="'+!!k[t.id]+'" aria-controls="'+n+'"':"")+'>'+(n?''+B+'"+I+"":B)+(t.description?''+o.esc(t.description)+"":"")+'"}function T(){var t=m.contains(document.activeElement)&&document.activeElement.dataset.id,a=u.reduce(function(n,r){return n+(h(r)?r.entries.filter(function(l){return l.unread}).length:r.unread?1:0)},0);b.setAttribute("aria-label",a>0?d+", "+a+" unread":d),D.hidden=a===0,K.textContent=a+" unread",a===0?g.setAttribute("aria-disabled","true"):g.removeAttribute("aria-disabled"),v&&(u.length===0?v.setAttribute("aria-disabled","true"):v.removeAttribute("aria-disabled")),O.hidden=u.length>0,w.hidden=u.length===0,m.innerHTML=u.map(function(n,r){if(!h(n))return"
    • "+E(n,r)+"
    • ";var l=c+"-g"+r;return"
    • "+E(n,r,l)+'
        "+n.entries.map(function(p,A){return"
      • "+E(p,r+"."+A)+"
      • "}).join("")+"
    • "}).join(""),t&&[].some.call(m.querySelectorAll(".notification"),function(n){return n.dataset.id===t&&(n.focus(),!0)})}return m.addEventListener("click",function(t){var a=t.target.closest(".notification");if(a){var n=a.dataset.index.split(".");if(a.hasAttribute("data-group")){var r=a.getAttribute("aria-expanded")!=="true";k[u[Number(n[0])].id]=r,a.setAttribute("aria-expanded",String(r)),document.getElementById(a.getAttribute("aria-controls")).hidden=!r;return}var l=u[Number(n[0])];i.onSelect&&i.onSelect(n.length>1?l.entries[Number(n[1])]:l),C()}}),g.addEventListener("click",function(){g.getAttribute("aria-disabled")!=="true"&&i.onMarkAllRead&&i.onMarkAllRead()}),v&&v.addEventListener("click",function(){v.getAttribute("aria-disabled")!=="true"&&i.onClearAll()}),W.addEventListener("click",function(){i.onViewAll&&i.onViewAll(),C()}),s.addEventListener("toggle",function(t){t.newState==="open"?y=o.glide(w,w.firstElementChild,{active:".notification[data-hovered]",item:".notification"}):y&&(y(),y=null)}),T(),{element:s,button:b,setEntries:function(t){u=x(t||[]),T()},open:function(){s.showPopover({source:b})},close:C}}S.notifications=P})(window.Basalt); diff --git a/.agent/skills/basalt-html/parts/palette.js b/.agent/skills/basalt-html/parts/palette.js index ad67cecc..b25ccf61 100644 --- a/.agent/skills/basalt-html/parts/palette.js +++ b/.agent/skills/basalt-html/parts/palette.js @@ -1 +1 @@ -(function(A){"use strict";var p=A._,y=p.esc,Y=p.icon,J=p.searchSvg='',L=p.kbd.kbdGroup,V=p.kbd.keyshortcuts,X=p.kbd.keywords,Q=p.kbd.KEY_NAME,W=A.hardwareKeyboard,v=null,Z=0;function ee(e){try{return/^(https?|mailto):$/.test(new URL(String(e),"https://basalt.invalid/").protocol)}catch{return!1}}function N(e){return!!e.isComposing||e.keyCode===229}var E={};function H(e){var r=e.keys;if(!r)return null;if(!Array.isArray(r))return E["a:"+e.label]||(E["a:"+e.label]=1,console.warn('Basalt: "'+e.label+`" has keys that are not an array; write keys: ['⌘', 'S']`)),null;var a=r.filter(function(l){return l==="⌘"||l==="⌃"||l==="⌥"||l==="⇧"}),s=r.filter(function(l){return a.indexOf(l)===-1});if(s.length!==1||!a.some(function(l){return l!=="⇧"})){var h=e.label+r.join(" ");return E[h]||(E[h]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"] that cannot be bound; a shortcut needs ⌘, ⌃ or ⌥ and one more key")),null}var o={cmd:a.indexOf("⌘")!==-1,ctrl:a.indexOf("⌃")!==-1,alt:a.indexOf("⌥")!==-1,shift:a.indexOf("⇧")!==-1,key:String(Q[s[0]]||s[0]).toLowerCase()};if((o.cmd||o.ctrl)&&!o.alt&&!o.shift&&o.key==="k"){var i=e.label+r.join(" ");return E[i]||(E[i]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"], which open the palette; choose another shortcut")),null}return o}function te(e){return!!e&&(/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.isContentEditable)}function re(e){var r=e.composedPath?e.composedPath():[];return r.length||(r=[e.target]),r.some(te)}function ae(e,r){if(e.alt!==r.altKey||e.shift!==r.shiftKey)return!1;var a=e.ctrl?r.ctrlKey&&e.cmd===r.metaKey:e.cmd?r.metaKey!==r.ctrlKey:!r.metaKey&&!r.ctrlKey;return a&&(String(r.key).toLowerCase()===e.key||e.key.length===1&&/^[a-z]$/.test(e.key)&&r.code==="Key"+e.key.toUpperCase())}function T(e,r){e.onSelect&&e.onSelect(e),r.onSelect&&r.onSelect(e),e.href&&(ee(e.href)?location.href=e.href:console.warn("Basalt: a palette link must be relative, http, https or mailto"))}function O(e,r){if(!r)return 0;var a=r.toLowerCase().split(/\s+/).filter(Boolean),s=function(h){return a.every(function(o){return h.indexOf(o)!==-1})};return s(e.label.toLowerCase())?0:s((e.label+" "+(e.keywords||[]).join(" ")+" "+(e.hint||"")+" "+(e.description||"")).toLowerCase())?1:-1}function ne(e,r){return O(e,r)>=0}function R(e,r,a,s){var h=[],o="",i="",l=[];return e.forEach(function(c,u){var C=(c.items||[]).map(function(m,b){return{it:m,t:O(m,a),i:b}}).filter(function(m){return m.t>=0}).sort(function(m,b){return m.t-b.t||m.i-b.i});C.length&&l.push({g:c,gi:u,items:C})}),l.sort(function(c,u){return c.items[0].t-u.items[0].t||c.gi-u.gi}),l.forEach(function(c){var u=c.g,C=c.gi,m=c.items.map(function(n){return n.it}),b=r+"-g"+C;o+='
      ",u.label&&(o+='
      '+y(u.label)+"
      "),m.forEach(function(n){var f=h.length;h.push(n);var g=H(n)?n.keys:null;g&&(i+=''+y(X(g))+""),o+='
      "+(n.icon?Y(n.icon):"")+''+y(n.label)+""+(n.description?''+y(n.description)+"":"")+(n.hint?''+y(n.hint)+"":"")+(g?L(g):"")+(s||"")+"
      "}),o+="
      "}),{html:o,words:i,flat:h}}function q(e){var r=e||{},a=r.groups||[];v&&v.close();var s="bh-palette-"+ ++Z,h=r.label||"Command palette",o=document.activeElement,i=document.createElement("div");i.className="scrim palette-scrim",i.innerHTML='";var l=i.firstElementChild,c=l.querySelector("input"),u=l.querySelector('[role="listbox"]'),C=l.querySelector(".palette-empty"),m=l.querySelector('[role="status"]'),b=l.querySelector("#"+s+"-keys"),n=[],f=0,g="",D;function se(t){clearTimeout(D),t!==g&&(D=setTimeout(function(){m.textContent=g=t},400))}function B(){!matchMedia("(hover: none) and (pointer: coarse)").matches||W()?c.setAttribute("aria-describedby",s+"-hints"):c.removeAttribute("aria-describedby")}function I(){var t=c.value.trim(),d=R(a,s,t);n=d.flat,u.innerHTML=d.html,u.insertBefore(P,u.firstChild),b.innerHTML=d.words,u.hidden=n.length===0,C.hidden=n.length!==0,f=Math.min(f,Math.max(n.length-1,0)),S(n.length?f:-1,!1),se(n.length?n.length+(n.length===1?" result":" results"):"No commands match.")}function S(t,d){var K=u.querySelectorAll('[role="option"]');if(K.forEach(function(F){F.setAttribute("aria-selected","false"),F.removeAttribute("data-active")}),t<0||!K[t]){c.removeAttribute("aria-activedescendant");return}f=t,K[t].setAttribute("aria-selected","true"),K[t].setAttribute("data-active",""),c.setAttribute("aria-activedescendant",K[t].id),d!==!1&&K[t].scrollIntoView({block:"nearest"})}function U(t){var d=n[t];d&&(k(),T(d,r))}var w=o&&o.closest("dialog:modal"),_=[],ce=document.documentElement.style.overflow,x;function G(t){t.newState==="closed"&&k()}var P=document.createElement("span");P.className="plate",P.setAttribute("aria-hidden","true");var j;function $(){clearTimeout(D),j&&j(),document.removeEventListener("keydown",z,!0),x&&x.disconnect(),w&&w.removeEventListener("beforetoggle",G),p.toast&&p.toast.release(i),i.matches(":popover-open")&&i.hidePopover(),i.remove(),_.forEach(function(t){t[1]||t[0].removeAttribute("inert")}),_=[],document.documentElement.style.overflow=ce}function k(){v===M&&(v=null,$(),o&&o.focus&&document.contains(o)&&o.focus(),r.onClose&&r.onClose())}function z(t){if(!(!i.isConnected||!l.contains(t.target)||t.target.closest(".toast-viewport"))&&(B(),!N(t))){if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),k();return}if(t.key==="ArrowDown"){t.preventDefault(),n.length&&S((f+1)%n.length);return}if(t.key==="ArrowUp"){t.preventDefault(),n.length&&S((f-1+n.length)%n.length);return}if(t.key==="Enter"){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;t.preventDefault(),n.length&&U(f);return}t.key==="Tab"&&(t.preventDefault(),c.focus())}}u.addEventListener("pointermove",function(t){var d=t.target.closest('[role="option"]');d&&Number(d.dataset.index)!==f&&S(Number(d.dataset.index),!1)}),u.addEventListener("click",function(t){var d=t.target.closest('[role="option"]');d&&U(Number(d.dataset.index))}),i.addEventListener("pointerdown",function(t){t.target===i&&k()}),i.addEventListener("toggle",function(t){t.newState==="closed"&&k()}),c.addEventListener("input",function(){f=0,I()});var M={close:k,element:l};I(),B();try{[].forEach.call((w||document.body).children,function(t){t.tagName==="DIALOG"||t.tagName==="SCRIPT"||t.id==="basalt-live"||t.classList.contains("toast-viewport")||(_.push([t,t.hasAttribute("inert")]),t.setAttribute("inert",""))}),(w||document.body).appendChild(i),w&&(i.setAttribute("popover","manual"),i.showPopover()),w&&(w.addEventListener("beforetoggle",G),x=new MutationObserver(function(){(!w.open||!w.isConnected)&&k()}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]})),document.documentElement.style.overflow="hidden",j=p.glide(u,P,{active:".row[data-active]",attr:"data-active"}),document.addEventListener("keydown",z,!0),v=M,c.focus()}catch(t){throw v===M&&(v=null),$(),t}return M}function oe(){v&&v.close()}function ie(e){var r=function(a){if(!(a.defaultPrevented||N(a)||!(a.metaKey||a.ctrlKey||a.altKey))){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&String(a.key).toLowerCase()==="k"){a.preventDefault(),v?v.close():q(typeof e=="function"?e():e);return}var s=typeof e=="function"?e():e,h=!(a.metaKey||a.ctrlKey)&&re(a);(s.groups||[]).some(function(o){return(o.items||[]).some(function(i){var l=H(i);return!l||h||!ae(l,a)?!1:(a.preventDefault(),v&&v.close(),T(i,s),!0)})})}};return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}}function le(e){if(!e){var r=document.querySelector('script[type="application/json"][data-palette]');r&&(e=JSON.parse(r.textContent))}!e||document.documentElement.__bhPalette||(document.documentElement.__bhPalette=!0,document.querySelectorAll("[data-open-palette]").forEach(function(a){a.addEventListener("click",function(){q(typeof e=="function"?e():e)}),a.hasAttribute("aria-keyshortcuts")||a.setAttribute("aria-keyshortcuts","Meta+K Control+K"),a.setAttribute("aria-haspopup","dialog")}),ie(e))}p.palette={rows:R,tier:O,matches:ne,activate:T,composing:N},A.openPalette=q,A.closePalette=oe,p.step(110,"wirePalette",function(e){le(e.palette)})})(window.Basalt); +(function(A){"use strict";var v=A._,y=v.esc,$=v.icon,J=v.searchSvg='',L=v.kbd.kbdGroup,V=v.kbd.keyshortcuts,X=v.kbd.keywords,Q=v.kbd.KEY_NAME,W=A.hardwareKeyboard,h=null,Z=0,ee=v.safeHref;function N(e){return!!e.isComposing||e.keyCode===229}var E={};function H(e){var r=e.keys;if(!r)return null;if(!Array.isArray(r))return E["a:"+e.label]||(E["a:"+e.label]=1,console.warn('Basalt: "'+e.label+`" has keys that are not an array; write keys: ['⌘', 'S']`)),null;var a=r.filter(function(l){return l==="⌘"||l==="⌃"||l==="⌥"||l==="⇧"}),s=r.filter(function(l){return a.indexOf(l)===-1});if(s.length!==1||!a.some(function(l){return l!=="⇧"})){var p=e.label+r.join(" ");return E[p]||(E[p]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"] that cannot be bound; a shortcut needs ⌘, ⌃ or ⌥ and one more key")),null}var o={cmd:a.indexOf("⌘")!==-1,ctrl:a.indexOf("⌃")!==-1,alt:a.indexOf("⌥")!==-1,shift:a.indexOf("⇧")!==-1,key:String(Q[s[0]]||s[0]).toLowerCase()};if((o.cmd||o.ctrl)&&!o.alt&&!o.shift&&o.key==="k"){var i=e.label+r.join(" ");return E[i]||(E[i]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"], which open the palette; choose another shortcut")),null}return o}function te(e){return!!e&&(/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.isContentEditable)}function re(e){var r=e.composedPath?e.composedPath():[];return r.length||(r=[e.target]),r.some(te)}function ae(e,r){if(e.alt!==r.altKey||e.shift!==r.shiftKey)return!1;var a=e.ctrl?r.ctrlKey&&e.cmd===r.metaKey:e.cmd?r.metaKey!==r.ctrlKey:!r.metaKey&&!r.ctrlKey;return a&&(String(r.key).toLowerCase()===e.key||e.key.length===1&&/^[a-z]$/.test(e.key)&&r.code==="Key"+e.key.toUpperCase())}function T(e,r){e.onSelect&&e.onSelect(e),r.onSelect&&r.onSelect(e),e.href&&(ee(e.href)?location.href=e.href:console.warn("Basalt: a palette link must be relative, http, https or mailto"))}function O(e,r){if(!r)return 0;var a=r.toLowerCase().split(/\s+/).filter(Boolean),s=function(p){return a.every(function(o){return p.indexOf(o)!==-1})};return s(e.label.toLowerCase())?0:s((e.label+" "+(e.keywords||[]).join(" ")+" "+(e.hint||"")+" "+(e.description||"")).toLowerCase())?1:-1}function ne(e,r){return O(e,r)>=0}function B(e,r,a,s){var p=[],o="",i="",l=[];return e.forEach(function(c,u){var C=(c.items||[]).map(function(m,b){return{it:m,t:O(m,a),i:b}}).filter(function(m){return m.t>=0}).sort(function(m,b){return m.t-b.t||m.i-b.i});C.length&&l.push({g:c,gi:u,items:C})}),l.sort(function(c,u){return c.items[0].t-u.items[0].t||c.gi-u.gi}),l.forEach(function(c){var u=c.g,C=c.gi,m=c.items.map(function(n){return n.it}),b=r+"-g"+C;o+='
      ",u.label&&(o+='
      '+y(u.label)+"
      "),m.forEach(function(n){var f=p.length;p.push(n);var g=H(n)?n.keys:null;g&&(i+=''+y(X(g))+""),o+='
      "+(n.icon?$(n.icon):"")+''+y(n.label)+""+(n.description?''+y(n.description)+"":"")+(n.hint?''+y(n.hint)+"":"")+(g?L(g):"")+(s||"")+"
      "}),o+="
      "}),{html:o,words:i,flat:p}}function q(e){var r=e||{},a=r.groups||[];h&&h.close();var s="bh-palette-"+ ++Z,p=r.label||"Command palette",o=document.activeElement,i=document.createElement("div");i.className="scrim palette-scrim",i.innerHTML='";var l=i.firstElementChild,c=l.querySelector("input"),u=l.querySelector('[role="listbox"]'),C=l.querySelector(".palette-empty"),m=l.querySelector('[role="status"]'),b=l.querySelector("#"+s+"-keys"),n=[],f=0,g="",D;function se(t){clearTimeout(D),t!==g&&(D=setTimeout(function(){m.textContent=g=t},400))}function I(){!matchMedia("(hover: none) and (pointer: coarse)").matches||W()?c.setAttribute("aria-describedby",s+"-hints"):c.removeAttribute("aria-describedby")}function R(){var t=c.value.trim(),d=B(a,s,t);n=d.flat,u.innerHTML=d.html,u.insertBefore(P,u.firstChild),b.innerHTML=d.words,u.hidden=n.length===0,C.hidden=n.length!==0,f=Math.min(f,Math.max(n.length-1,0)),S(n.length?f:-1,!1),se(n.length?n.length+(n.length===1?" result":" results"):"No commands match.")}function S(t,d){var K=u.querySelectorAll('[role="option"]');if(K.forEach(function(Y){Y.setAttribute("aria-selected","false"),Y.removeAttribute("data-active")}),t<0||!K[t]){c.removeAttribute("aria-activedescendant");return}f=t,K[t].setAttribute("aria-selected","true"),K[t].setAttribute("data-active",""),c.setAttribute("aria-activedescendant",K[t].id),d!==!1&&K[t].scrollIntoView({block:"nearest"})}function G(t){var d=n[t];d&&(k(),T(d,r))}var w=o&&o.closest("dialog:modal"),_=[],ce=document.documentElement.style.overflow,x;function U(t){t.newState==="closed"&&k()}var P=document.createElement("span");P.className="plate",P.setAttribute("aria-hidden","true");var j;function z(){clearTimeout(D),j&&j(),document.removeEventListener("keydown",F,!0),x&&x.disconnect(),w&&w.removeEventListener("beforetoggle",U),v.toast&&v.toast.release(i),i.matches(":popover-open")&&i.hidePopover(),i.remove(),_.forEach(function(t){t[1]||t[0].removeAttribute("inert")}),_=[],document.documentElement.style.overflow=ce}function k(){h===M&&(h=null,z(),o&&o.focus&&document.contains(o)&&o.focus(),r.onClose&&r.onClose())}function F(t){if(!(!i.isConnected||!l.contains(t.target)||t.target.closest(".toast-viewport"))&&(I(),!N(t))){if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),k();return}if(t.key==="ArrowDown"){t.preventDefault(),n.length&&S((f+1)%n.length);return}if(t.key==="ArrowUp"){t.preventDefault(),n.length&&S((f-1+n.length)%n.length);return}if(t.key==="Enter"){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;t.preventDefault(),n.length&&G(f);return}t.key==="Tab"&&(t.preventDefault(),c.focus())}}u.addEventListener("pointermove",function(t){var d=t.target.closest('[role="option"]');d&&Number(d.dataset.index)!==f&&S(Number(d.dataset.index),!1)}),u.addEventListener("click",function(t){var d=t.target.closest('[role="option"]');d&&G(Number(d.dataset.index))}),i.addEventListener("pointerdown",function(t){t.target===i&&k()}),i.addEventListener("toggle",function(t){t.newState==="closed"&&k()}),c.addEventListener("input",function(){f=0,R()});var M={close:k,element:l};R(),I();try{[].forEach.call((w||document.body).children,function(t){t.tagName==="DIALOG"||t.tagName==="SCRIPT"||t.id==="basalt-live"||t.classList.contains("toast-viewport")||(_.push([t,t.hasAttribute("inert")]),t.setAttribute("inert",""))}),(w||document.body).appendChild(i),w&&(i.setAttribute("popover","manual"),i.showPopover()),w&&(w.addEventListener("beforetoggle",U),x=new MutationObserver(function(){(!w.open||!w.isConnected)&&k()}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]})),document.documentElement.style.overflow="hidden",j=v.glide(u,P,{active:".row[data-active]",attr:"data-active"}),document.addEventListener("keydown",F,!0),h=M,c.focus()}catch(t){throw h===M&&(h=null),z(),t}return M}function oe(){h&&h.close()}function ie(e){var r=function(a){if(!(a.defaultPrevented||N(a)||!(a.metaKey||a.ctrlKey||a.altKey))){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&String(a.key).toLowerCase()==="k"){a.preventDefault(),h?h.close():q(typeof e=="function"?e():e);return}var s=typeof e=="function"?e():e,p=!(a.metaKey||a.ctrlKey)&&re(a);(s.groups||[]).some(function(o){return(o.items||[]).some(function(i){var l=H(i);return!l||p||!ae(l,a)?!1:(a.preventDefault(),h&&h.close(),T(i,s),!0)})})}};return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}}function le(e){if(!e){var r=document.querySelector('script[type="application/json"][data-palette]');r&&(e=JSON.parse(r.textContent))}!e||document.documentElement.__bhPalette||(document.documentElement.__bhPalette=!0,document.querySelectorAll("[data-open-palette]").forEach(function(a){a.addEventListener("click",function(){q(typeof e=="function"?e():e)}),a.hasAttribute("aria-keyshortcuts")||a.setAttribute("aria-keyshortcuts","Meta+K Control+K"),a.setAttribute("aria-haspopup","dialog")}),ie(e))}v.palette={rows:B,tier:O,matches:ne,activate:T,composing:N},A.openPalette=q,A.closePalette=oe,v.step(110,"wirePalette",function(e){le(e.palette)})})(window.Basalt); diff --git a/.oxlintrc.json b/.oxlintrc.json index b2f10033..660f4e5f 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -49,6 +49,7 @@ "files": ["**/test/**", "**/*.test.*"], "rules": { "no-eval": "off", + "import/namespace": "off", "no-constant-condition": "off", "no-self-assign": "off", "oxc/double-comparisons": "off", diff --git a/packages/react/src/chart.tsx b/packages/react/src/chart.tsx index 27d2196e..9721b80a 100644 --- a/packages/react/src/chart.tsx +++ b/packages/react/src/chart.tsx @@ -182,7 +182,8 @@ const NICE = [1, 2, 2.5, 5]; /** Round steps, smallest first, from a tenth of the span's magnitude up. */ function* niceSteps(span: number) { const magnitude = Math.floor(Math.log10(Math.max(span, 1e-9))); - for (let power = magnitude - 2; power <= magnitude + 2; power++) for (const base of NICE) yield base * 10 ** power; + // Five powers, counted apart from the exponent: a span that overflows to Infinity has an infinite magnitude, and Infinity + 1 never ends a loop. + for (let k = 0; k < 5; k++) for (const base of NICE) yield base * 10 ** (magnitude - 2 + k); } /** 3 to 6 gridlines on round steps. A bar chart starts at zero; a line chart's scale needn't. */ @@ -209,9 +210,12 @@ function scaleOf(values: number[], bar: boolean, fromZero: boolean, given?: numb return fit(span); } +/** The most gridlines a scale has (scaleOf's 3 to 6, with room); a scale that overflowed draws no more than this and never loops without end. */ +const MOST_TICKS = 12; + function ticksOf(scale: Scale) { const out: number[] = []; - for (let k = 0; k <= Math.round((scale.hi - scale.lo) / scale.step); k++) out.push(Math.round((scale.lo + k * scale.step) * 1e9) / 1e9); + for (let k = 0, n = Math.min(Math.round((scale.hi - scale.lo) / scale.step), MOST_TICKS); k <= n; k++) out.push(Math.round((scale.lo + k * scale.step) * 1e9) / 1e9); return out; } @@ -285,7 +289,7 @@ interface Frame { width: number; metrics: Metrics } interface GroupSizes { gutter: number; right: number } interface GroupApi { shared: GroupSizes; report: (id: string, sizes: GroupSizes | null) => void } -const GroupContext = React.createContext(null); +const GroupContext = /* @__PURE__ */ React.createContext(null); export interface ChartGroupProps extends React.ComponentProps<"div"> { /** Names the stack for assistive technology when it is more than a layout. */ diff --git a/packages/react/src/choice.tsx b/packages/react/src/choice.tsx index c9211cb9..abb28141 100644 --- a/packages/react/src/choice.tsx +++ b/packages/react/src/choice.tsx @@ -10,6 +10,7 @@ import { CheckGlyph } from "./glyphs/check"; import { MinusGlyph } from "./glyphs/minus"; import type { ControlSize } from "./button"; import type { ChangeDetails, ChoiceValue, OpenChangeDetails, PartProps, PopupActions } from "./types"; +import { useInRequiredField } from "./field-group"; import { useFieldsetDisabled } from "./fieldset-context"; import { useMirrorRef } from "./mirror"; import { Icon } from "./icon"; @@ -226,7 +227,7 @@ export interface SelectProps { } /** - * One choice from a list too long for radios. Inside a `Field` it takes the field's label. + * One choice from a list too long for radios. Inside a `Field` it takes the field's label, and, in a required field, `required`. * The list opens below the trigger, like a menu. */ export function Select({ options, placeholder = "Select…", controlSize = "md", className, "aria-label": ariaLabel, valuePrefix, numeric, toolbar, inputRef, ...props }: SelectProps) { @@ -235,6 +236,7 @@ export function Select({ options, placeholder = "Select…", controlSize = "md", const layer = useFloatingLayer(); const level = usePopupLevel(); const items = options.map((o) => ({ value: o.value, label: o.label })); + const inRequiredField = useInRequiredField(); // A toolbar select holds the width of its widest label: each option (and the placeholder) stands unseen in the value's one cell, so choosing moves nothing after it. const value = ; const seat = toolbar ? ( @@ -244,7 +246,7 @@ export function Select({ options, placeholder = "Select…", controlSize = "md", ) : null; return ( - + {valuePrefix ? ( @@ -255,7 +257,7 @@ export function Select({ options, placeholder = "Select…", controlSize = "md", seat ) : ( // A numeric select holds the width of its widest option: the value's cell carries it as eights in an attribute that a pseudo-element paints, so choosing moves nothing and the DOM holds the words once. - String(o.label).length))) : undefined} className="basalt-select-value" placeholder={placeholder} /> + String(o.label).length))) : undefined} className="basalt-select-value" placeholder={placeholder} /> )} diff --git a/packages/react/src/command-panel.tsx b/packages/react/src/command-panel.tsx index c9668121..4852e56c 100644 --- a/packages/react/src/command-panel.tsx +++ b/packages/react/src/command-panel.tsx @@ -267,12 +267,11 @@ export function CommandListPanel({ groups, label, placeholder, noun, level, band // A push moves focus to the detail's heading; Back returns it to the field (a keyed push, or a pointer) or to the list's // region (a tap, so a phone's keyboard doesn't spring up). Back keeps the query, the scroll and the active row. - const entered = React.useRef(false); + // Focus moves only when the view really changes from the one last shown: not on mount, and not when Strict Mode runs the effect a second time. + const shownView = React.useRef(view); React.useLayoutEffect(() => { - if (!entered.current) { - entered.current = true; - return; - } + if (shownView.current === view) return; + shownView.current = view; if (view === "detail") { if (pane.current) nameThePane(pane.current, current?.label ?? label, () => ids.heading)?.focus({ preventScroll: true }); } else { diff --git a/packages/react/src/dialog.tsx b/packages/react/src/dialog.tsx index c98f0637..1ded35b1 100644 --- a/packages/react/src/dialog.tsx +++ b/packages/react/src/dialog.tsx @@ -105,7 +105,7 @@ function modalityOf(event: Event | undefined): FormState["opened"] { } /** Whether the dialog above is modal (the default): its content makes what is outside inert only then. */ -export const DialogModal = React.createContext(true); +export const DialogModal = /* @__PURE__ */ React.createContext(true); export interface DialogTriggerProps extends PartProps<"button"> { nativeButton?: boolean; diff --git a/packages/react/src/event-log.tsx b/packages/react/src/event-log.tsx index 110491fd..041f2c0c 100644 --- a/packages/react/src/event-log.tsx +++ b/packages/react/src/event-log.tsx @@ -41,7 +41,7 @@ export function EventText({ verb, object, className, ...props }: EventTextProps) return {verb} {object}; } -const WidestContext = React.createContext("Mmm 00 00:00 PM"); +const WidestContext = /* @__PURE__ */ React.createContext("Mmm 00 00:00 PM"); export interface EventLogProps extends Omit, "children"> { /** Names the list. */ diff --git a/packages/react/src/feedback.tsx b/packages/react/src/feedback.tsx index c1d47701..e92963e6 100644 --- a/packages/react/src/feedback.tsx +++ b/packages/react/src/feedback.tsx @@ -21,6 +21,7 @@ import { inLevel, useFloatingLayer, usePanelLevel, usePopupLevel } from "./layer import type { Align, ChangeDetails, CollisionAvoidance, FocusTarget, OpenChangeDetails, PartProps, PlacementOffset, PlacementProps, PopoverHandle, PopupActions, Side } from "./types"; import { join, withClass } from "./utils"; import { CONFIRM_MS } from "./constants"; +import { useInRequiredField } from "./field-group"; import { useJoinedRef, useWriting } from "./wait"; import type { WritingEmpty } from "./wait"; @@ -41,10 +42,11 @@ export interface TextareaProps extends Omit, "c writingEmpty?: WritingEmpty; } -/** Multi-line text. Inside a `Field` it takes the field's label, description and error. */ +/** Multi-line text. Inside a `Field` it takes the field's label, description and error, and, in a required field, `required`. */ export function Textarea({ className, rows = 4, id, name, value, defaultValue, disabled, autoFocus, required, readOnly, writing = false, writingEmpty, ref, ...props }: TextareaProps) { const own = React.useRef(null); const written = useWriting(writing, value, own, writingEmpty); + const inRequiredField = useInRequiredField(); return ( } diff --git a/packages/react/src/field-group.ts b/packages/react/src/field-group.ts index 88babe78..e0320991 100644 --- a/packages/react/src/field-group.ts +++ b/packages/react/src/field-group.ts @@ -14,3 +14,8 @@ export interface FieldGroup { } export const FieldGroupContext = /* @__PURE__ */ React.createContext(null); + +/** True inside a required `Field`: a control there carries `required` unless it sets its own, since the visible "Required" is hidden from assistive technology. */ +export function useInRequiredField() { + return React.useContext(FieldGroupContext)?.required ?? false; +} diff --git a/packages/react/src/field.tsx b/packages/react/src/field.tsx index 29130088..f5de34b8 100644 --- a/packages/react/src/field.tsx +++ b/packages/react/src/field.tsx @@ -28,7 +28,7 @@ export type InputProps = PartProps<"input"> & { }; // Whether the `Field` an input sits in is required: the input then carries `required`, which is what a screen reader says. -const FieldRequiredContext = React.createContext(false); +const FieldRequiredContext = /* @__PURE__ */ React.createContext(false); /** A text input. Inside a `Field` it takes the field's label, description and error, and, in a required field, `required`. */ export function Input({ controlSize = "md", className, required, writing = false, writingEmpty, value, readOnly, ref, ...props }: InputProps) { diff --git a/packages/react/src/fieldset-context.ts b/packages/react/src/fieldset-context.ts index 4d5e7a7e..0bf338cf 100644 --- a/packages/react/src/fieldset-context.ts +++ b/packages/react/src/fieldset-context.ts @@ -3,7 +3,7 @@ import * as React from "react"; // A disabled Fieldset disables the choices inside it. Base UI shares the flag only with its own // Field, and its context isn't public, so Basalt carries it: Checkbox, Switch and Radio read it // here. A module of its own keeps a choice-only import from loading the form controls. -const FieldsetDisabled = React.createContext(false); +const FieldsetDisabled = /* @__PURE__ */ React.createContext(false); export const FieldsetDisabledProvider = FieldsetDisabled.Provider; diff --git a/packages/react/src/forms.tsx b/packages/react/src/forms.tsx index e480733f..707918ec 100644 --- a/packages/react/src/forms.tsx +++ b/packages/react/src/forms.tsx @@ -10,6 +10,7 @@ import { CheckGlyph } from "./glyphs/check"; import { MinusGlyph } from "./glyphs/minus"; import { PlusGlyph } from "./glyphs/plus"; import { IconButton, type ControlSize } from "./button"; +import { useInRequiredField } from "./field-group"; import { FieldsetDisabledProvider, useFieldsetDisabled } from "./fieldset-context"; import { Icon } from "./icon"; import { GlidePlate } from "./plate"; @@ -149,7 +150,7 @@ export interface ComboboxProps { inputProps?: Omit, "className" | "value" | "defaultValue" | "children">; } -/** A searchable Select. The chosen value must come from the supplied options. Label it with Field. */ +/** A searchable Select. The chosen value must come from the supplied options. Label it with Field; in a required field it carries `required`. */ export function Combobox({ options, placeholder = "Search…", emptyMessage = "No options match.", controlSize = "md", className, inputProps, modal = false, inputRef, "aria-label": label, ...props }: ComboboxProps) { const mirror = useMirrorRef(inputRef); const layer = useFloatingLayer(); @@ -157,6 +158,7 @@ export function Combobox({ options, placeholder = "Search…", emptyMessage = "N const byValue = new Map(options.map((option) => [option.value, option])); // A description is a search keyword: with none given, a typed query also finds the words under a label. const described = options.some((option) => option.description); + const inRequiredField = useInRequiredField(); const describedFilter = (value: string, query: string) => { const needle = query.trim().toLowerCase(); if (!needle) return true; @@ -164,7 +166,7 @@ export function Combobox({ options, placeholder = "Search…", emptyMessage = "N return `${option?.label ?? value}`.toLowerCase().includes(needle) || (option?.description?.toLowerCase().includes(needle) ?? false); }; return ( - option.value)} itemToStringLabel={(value) => byValue.get(value)?.label ?? value}> + option.value)} itemToStringLabel={(value) => byValue.get(value)?.label ?? value}> } className="basalt-combobox-trigger" /> diff --git a/packages/react/src/layers.ts b/packages/react/src/layers.ts index c9217569..f82d7aaf 100644 --- a/packages/react/src/layers.ts +++ b/packages/react/src/layers.ts @@ -4,7 +4,7 @@ import { useScreenKeyboardLayout } from "./screen-keyboard"; // React context crosses portals. Each modal reserves space for its backdrop, content and // floating children; a nested modal then covers the entire preceding level. -export const ModalDepth = React.createContext(0); +export const ModalDepth = /* @__PURE__ */ React.createContext(0); export function useModalLayer() { const parent = React.useContext(ModalDepth); @@ -40,7 +40,7 @@ export function useFloatingLayer() { // panels sit one above it, so a menu opened from a dialog is level 2. export type SurfaceLevel = 0 | 1 | 2 | 3; -export const SurfaceLevelContext = React.createContext(0); +export const SurfaceLevelContext = /* @__PURE__ */ React.createContext(0); const cap = (level: number): SurfaceLevel => Math.min(level, 3) as SurfaceLevel; diff --git a/packages/react/src/link-rows.tsx b/packages/react/src/link-rows.tsx index b2f18d45..a723108d 100644 --- a/packages/react/src/link-rows.tsx +++ b/packages/react/src/link-rows.tsx @@ -14,7 +14,7 @@ const safeRel = (target: string | undefined, rel: string | undefined) => opensNewTab(target) ? [...new Set([...(rel?.split(/\s+/).filter(Boolean) ?? []), "noopener", "noreferrer"])].join(" ") : rel; /** Set by `DirectoryList` around the rows that open in place, so a row knows to draw its own clip, and whether the rest is open. */ -const RestContext = React.createContext<{ open: boolean } | null>(null); +const RestContext = /* @__PURE__ */ React.createContext<{ open: boolean } | null>(null); export interface DirectoryRowProps extends Omit, "children" | "title"> { /** The name, in the first column, in 600. The arrow follows it. */ diff --git a/packages/react/src/link-tabs.tsx b/packages/react/src/link-tabs.tsx index 641317a3..db598547 100644 --- a/packages/react/src/link-tabs.tsx +++ b/packages/react/src/link-tabs.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { ChosenLabel } from "./chosen"; import { Select } from "./choice"; -import { join } from "./utils"; +import { join, safeHref } from "./utils"; export interface LinkTabsProps extends Omit, "aria-label"> { /** Names the navigation ("What it is"). Required: a page can hold several. The `Select` under 720px wide has the same name. */ @@ -70,7 +70,9 @@ export function LinkTabs({ size = "lg", onNavigate, goToLabel = "Go to", classNa if (details.reason !== "item-press") return; if (value === null || value === current?.value) return; if (onNavigate) onNavigate(value); - else window.location.assign(value); + // React refuses a script URL in the row's anchor; the same string from the Select is checked here, before the page is sent anywhere. + else if (safeHref(value)) window.location.assign(value); + else console.error(`Basalt: LinkTabs will not navigate to ${JSON.stringify(value)}: a link must be relative, http, https or mailto`); }} /> diff --git a/packages/react/src/listbox.tsx b/packages/react/src/listbox.tsx index ce3f6513..6fb46aee 100644 --- a/packages/react/src/listbox.tsx +++ b/packages/react/src/listbox.tsx @@ -17,7 +17,7 @@ interface ListboxContext { /** An option's id: the list's, then the option's value, so `aria-activedescendant` can name the chosen one in the same render. */ idOf: (value: string) => string; } -const ListboxState = React.createContext(null); +const ListboxState = /* @__PURE__ */ React.createContext(null); export interface ListboxProps extends Omit, "onChange" | "defaultValue"> { /** Names the list. Required: it is the listbox's accessible name. */ diff --git a/packages/react/src/menu.tsx b/packages/react/src/menu.tsx index fe212c03..44966262 100644 --- a/packages/react/src/menu.tsx +++ b/packages/react/src/menu.tsx @@ -11,7 +11,7 @@ import { ariaShortcut, shortcutKeys, spokenShortcut } from "./shortcut"; import type { Align, ChangeDetails, ChoiceValue, FocusTarget, HighlightDetails, IconComponent, OpenChangeDetails, PartProps, PlacementOffset, PlacementProps, PopupActions, Side } from "./types"; import { join, withClass } from "./utils"; import { inLevel, useFloatingLayer, usePopupLevel } from "./layers"; -import { WaitContext, isThenable, waitFor } from "./wait"; +import { WaitContext, isThenable, takeClick, waitFor } from "./wait"; export interface MenuProps { open?: boolean; @@ -157,7 +157,9 @@ export interface MenuItemProps extends MenuRowProps { waitForAnswer?: boolean; } -export function MenuItem({ icon, shortcut, danger, description, className, children, label, waitForAnswer = true, onClick, "aria-describedby": describedBy, ...props }: MenuItemProps) { +export function MenuItem({ icon, shortcut, danger, description, className, children, label, waitForAnswer = true, onClick: ownClick, render: given, "aria-describedby": describedBy, ...props }: MenuItemProps) { + // A `render` element's own click is taken into the item's, so the menu's wait guards it too (Base UI would call it before the guard). + const [render, onClick] = takeClick(given, ownClick); const spoken = React.useId(); const apple = useApplePlatform(); const keys = shortcut ? shortcutKeys(shortcut, apple) : []; @@ -165,6 +167,7 @@ export function MenuItem({ icon, shortcut, danger, description, className, child return ( { if (waitForAnswer && wait?.pending()) { (event as { preventBaseUIHandler?: () => void }).preventBaseUIHandler?.(); diff --git a/packages/react/src/modal-outside.ts b/packages/react/src/modal-outside.ts index bf9d9c38..853118ef 100644 --- a/packages/react/src/modal-outside.ts +++ b/packages/react/src/modal-outside.ts @@ -29,6 +29,16 @@ export function inertOutside(popup: Element): () => void { return () => { for (const control of made) control.removeAttribute("inert"); }; } +/** `inertOutside`, kept true while the modal is open: a control that mounts outside it later (a live region's new button) is made inert too. Returns the undo. */ +function guardOutside(popup: Element): () => void { + const undos = [inertOutside(popup)]; + const added = new MutationObserver((records) => { + if (records.some((record) => record.addedNodes.length > 0 && !popup.contains(record.target))) undos.push(inertOutside(popup)); + }); + added.observe(popup.ownerDocument.body, { childList: true, subtree: true }); + return () => { added.disconnect(); for (const undo of undos) undo(); }; +} + /** * A callback ref for a modal's popup (Dialog, AlertDialog, Sheet, CommandMenu): while the popup is mounted and `modal` is true, the controls * outside it that Base UI left exposed are inert. Pass the ref the caller gave the popup as `forwarded`, so it still receives the element. @@ -36,21 +46,29 @@ export function inertOutside(popup: Element): () => void { export function useModalOutside(forwarded?: React.Ref | undefined, modal = true) { const [popup, setPopup] = React.useState(null); const undo = React.useRef<(() => void) | null>(null); + // The popup whose guard the ref's cleanup just lifted. When the caller's ref changes, React detaches the old callback and attaches the new one to the same + // popup in one commit: `popup` ends where it was, so the effect does not run again, and the new callback puts the guard back itself. + const lifted = React.useRef(null); + const modalNow = React.useRef(modal); + modalNow.current = modal; // After the commit that mounts the popup, so Base UI has done its own marking first. React.useEffect(() => { // A dialog that is not modal (`modal={false}` or `"trap-focus"`) leaves the page usable, so there is nothing to make inert. if (!popup || !modal) return undefined; - undo.current = inertOutside(popup); + undo.current = guardOutside(popup); return () => { undo.current?.(); undo.current = null; }; }, [popup, modal]); return React.useCallback((node: T | null) => { if (!node) return undefined; + if (lifted.current === node && modalNow.current && !undo.current) undo.current = guardOutside(node); + lifted.current = null; setPopup(node); let cleanup: void | (() => void); if (typeof forwarded === "function") cleanup = forwarded(node); else if (forwarded) (forwarded as React.MutableRefObject).current = node; return () => { // Lifted as the popup leaves, not a render later: the trigger gets focus back as it goes, and an inert one cannot take it. + if (undo.current) lifted.current = node; undo.current?.(); undo.current = null; setPopup(null); diff --git a/packages/react/src/nav.tsx b/packages/react/src/nav.tsx index 5c7f76e6..d2e88dc8 100644 --- a/packages/react/src/nav.tsx +++ b/packages/react/src/nav.tsx @@ -11,9 +11,9 @@ import { join } from "./utils"; // between hovered items (plate.tsx), over each item painting its own pill, which is the whole story with no script. /** Whether the list is the collapsed rail. Set by `Nav`, read by its items. */ -const NavContext = React.createContext(false); +const NavContext = /* @__PURE__ */ React.createContext(false); /** The list's size. Set by `Nav`, read by its items for their glyph's size. */ -const NavSizeContext = React.createContext("md"); +const NavSizeContext = /* @__PURE__ */ React.createContext("md"); /** * `md`: the app's navigation, a 48px pill at 20/28 with a 24 glyph. `sm`: a second, quieter list under it (recent items, @@ -25,7 +25,7 @@ export type NavSize = "md" | "sm"; * Whether the app shell is showing the rail. `AppShell` sets it, so the `Nav`s it holds collapse by the width of the page * without the app measuring anything; a `collapsed` prop on a `Nav` still wins. */ -export const NavRailContext = React.createContext(false); +export const NavRailContext = /* @__PURE__ */ React.createContext(false); export interface NavProps extends Omit, "aria-label" | "aria-labelledby"> { /** The landmark's name, e.g. "Primary" or the product's. Required: an app may have several navigations. */ diff --git a/packages/react/src/open-list.tsx b/packages/react/src/open-list.tsx index 51ea32cf..31d169ed 100644 --- a/packages/react/src/open-list.tsx +++ b/packages/react/src/open-list.tsx @@ -15,7 +15,7 @@ interface OpenListContext { cursor: string | undefined; setCursor: (id: string) => void; } -const OpenListState = React.createContext(null); +const OpenListState = /* @__PURE__ */ React.createContext(null); export interface OpenListProps extends React.ComponentProps<"div"> { /** Names the list as a group ("Work"). */ diff --git a/packages/react/src/reflow.tsx b/packages/react/src/reflow.tsx index a15b3f17..ae16e2f5 100644 --- a/packages/react/src/reflow.tsx +++ b/packages/react/src/reflow.tsx @@ -17,7 +17,7 @@ interface Seat { register: (key: string, element: HTMLElement | null) => void; phase: (key: string) => Phase; } -const SeatContext = React.createContext(null); +const SeatContext = /* @__PURE__ */ React.createContext(null); export interface ReflowReport { /** The ids shown after the change, in the order drawn. */ diff --git a/packages/react/src/scroll-stop.ts b/packages/react/src/scroll-stop.ts index d419c52a..595ebc06 100644 --- a/packages/react/src/scroll-stop.ts +++ b/packages/react/src/scroll-stop.ts @@ -6,9 +6,14 @@ import * as React from "react"; const FOCUSABLE = 'a[href], area[href], button, input:not([type="hidden"]), select, textarea, summary, iframe, [tabindex], [contenteditable]:not([contenteditable="false"])'; +/** Drawn, so Tab can reach it: not under `display: none` or `hidden`, and not `visibility: hidden`. */ +function rendered(element: HTMLElement): boolean { + return typeof element.checkVisibility === "function" ? element.checkVisibility({ visibilityProperty: true }) : element.getClientRects().length > 0; +} + function holdsFocusable(box: HTMLElement): boolean { for (const element of box.querySelectorAll(FOCUSABLE)) { - if (element.matches(":disabled") || element.closest("[inert]") || element.tabIndex < 0) continue; + if (element.matches(":disabled") || element.closest("[inert]") || element.tabIndex < 0 || !rendered(element)) continue; return true; } return false; @@ -45,7 +50,7 @@ export function useScrollStop(options: ScrollStopOptions, measure(); // A name that lives elsewhere (a sheet's title registers with its dialog after this effect) is read once more when the frame is drawn. const frame = requestAnimationFrame(measure); - mutation.observe(box, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ["tabindex", "disabled", "href", "inert", "hidden"] }); + mutation.observe(box, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ["tabindex", "disabled", "href", "inert", "hidden", "class", "style", "open"] }); return () => { cancelAnimationFrame(frame); resize.disconnect(); mutation.disconnect(); }; }, []); const ref = React.useCallback((element: T | null) => { diff --git a/packages/react/src/selectable-list.tsx b/packages/react/src/selectable-list.tsx index f4c24e45..1d91effd 100644 --- a/packages/react/src/selectable-list.tsx +++ b/packages/react/src/selectable-list.tsx @@ -46,7 +46,7 @@ const handOn = (to: HTMLElement[], focused: React.RefObject) focused.current = box?.closest(".basalt-selectable-item") ?? null; }; -const SelectionContext = React.createContext(null); +const SelectionContext = /* @__PURE__ */ React.createContext(null); function useSelection(part: string): Selection { const selection = React.useContext(SelectionContext); diff --git a/packages/react/src/site-brand.tsx b/packages/react/src/site-brand.tsx index f1d69abe..1116c718 100644 --- a/packages/react/src/site-brand.tsx +++ b/packages/react/src/site-brand.tsx @@ -22,7 +22,7 @@ export interface SiteLockup { interface Ids { x1: string; x2: string } /** The symbols a landmark has already defined, so its brand links (the bar's, the menu's) draw them and define nothing. */ -const SpriteContext = React.createContext(null); +const SpriteContext = /* @__PURE__ */ React.createContext(null); function ids(base: string): Ids { return { x1: `${base}-1x`, x2: `${base}-2x` }; diff --git a/packages/react/src/social-links.tsx b/packages/react/src/social-links.tsx index 29124c4a..cdd0e995 100644 --- a/packages/react/src/social-links.tsx +++ b/packages/react/src/social-links.tsx @@ -35,7 +35,7 @@ interface RowState { size: SocialSize; iconOnly: boolean; } -const RowContext = React.createContext({ size: 16, iconOnly: false }); +const RowContext = /* @__PURE__ */ React.createContext({ size: 16, iconOnly: false }); export interface SocialLinksProps extends React.ComponentProps<"ul"> { /** The glyph beside the name: 16 beside 12 to 16px text (default), 20 beside 18 to 24px. */ diff --git a/packages/react/src/status-size.ts b/packages/react/src/status-size.ts index 685af110..ef7b9036 100644 --- a/packages/react/src/status-size.ts +++ b/packages/react/src/status-size.ts @@ -7,4 +7,4 @@ export type StatusSize = 16 | 20 | 24; * A plain `Badge` provides its `size`, and a braille `Spinner` inside it takes it, so the mark and the seat cannot disagree. * Undefined outside a plain Badge, where a Spinner uses its own `size`. */ -export const StatusSizeContext = React.createContext(undefined); +export const StatusSizeContext = /* @__PURE__ */ React.createContext(undefined); diff --git a/packages/react/src/tabs.tsx b/packages/react/src/tabs.tsx index 1278441a..24a9c725 100644 --- a/packages/react/src/tabs.tsx +++ b/packages/react/src/tabs.tsx @@ -9,12 +9,12 @@ import { Pill } from "./pill"; import type { ChangeDetails, ChoiceValue, Orientation, PartProps } from "./types"; import { join, withClass } from "./utils"; -const TabsMotion = React.createContext<{ +const TabsMotion = /* @__PURE__ */ React.createContext<{ order: React.MutableRefObject; previous: React.MutableRefObject; } | null>(null); -const TabsOrientation = React.createContext(undefined); +const TabsOrientation = /* @__PURE__ */ React.createContext(undefined); // The chosen tab's value as text, or null when none is known: a panel that is not it is being left, and is not drawn while Base UI finishes its exit. const TabsChosen = /* @__PURE__ */ React.createContext(null); @@ -149,7 +149,7 @@ export interface TabsPanelProps extends PartProps<"div", "value"> { keepMounted?: boolean; } -const PanelsStacked = React.createContext(false); +const PanelsStacked = /* @__PURE__ */ React.createContext(false); export interface TabsPanelsProps extends React.ComponentProps<"div"> { /** diff --git a/packages/react/src/toast.tsx b/packages/react/src/toast.tsx index a3048c52..72e9f500 100644 --- a/packages/react/src/toast.tsx +++ b/packages/react/src/toast.tsx @@ -146,7 +146,7 @@ interface Controller { early: Array<[string, boolean]>; } -const ControllerContext = React.createContext(null); +const ControllerContext = /* @__PURE__ */ React.createContext(null); const defaultActionWords = (label: string) => `${label} is available. Press F6 to reach it.`; @@ -374,7 +374,7 @@ function ToastAnnouncer({ controller }: { controller: Controller }) { } /** Whether the stack is hovered or focused (Base UI's `expanded`), which holds every clock. */ -const ExpandedContext = React.createContext(false); +const ExpandedContext = /* @__PURE__ */ React.createContext(false); function ToastStack() { const away = useAway(); @@ -399,7 +399,7 @@ function ToastStack() { ); } -const AwayContext = React.createContext(false); +const AwayContext = /* @__PURE__ */ React.createContext(false); /** * Whether nobody can be looking: the window is not focused, or the tab is hidden. Base UI holds its own clocks for a blurred diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts index 5b35dfcd..698476a8 100644 --- a/packages/react/src/utils.ts +++ b/packages/react/src/utils.ts @@ -19,3 +19,12 @@ export function join(...parts: Array): string export function withStyle(base: React.CSSProperties, style?: PartStyle): React.CSSProperties | ((state: any) => React.CSSProperties) { return typeof style === "function" ? (state: any) => ({ ...base, ...style(state as PartState) }) : { ...base, ...style }; } + +/** A destination Basalt itself may send the page to: relative, http, https or mailto, read the way the browser reads it. javascript:, data: and the rest are refused. */ +export function safeHref(href: string): boolean { + try { + return /^(https?|mailto):$/.test(new URL(href, typeof location === "undefined" ? "https://basalt.invalid/" : location.href).protocol); + } catch { + return false; + } +} diff --git a/packages/react/src/wait.ts b/packages/react/src/wait.ts index 5d9dc9e0..8fc0dbee 100644 --- a/packages/react/src/wait.ts +++ b/packages/react/src/wait.ts @@ -93,7 +93,8 @@ type Press = (event: E) => unknown; /** * The press handler of an element given as `render` (`{shown ?

      {c.label}

      } /> : null}; } + ${render("")}`); + try { + await page.locator("#held").focus(); + await page.evaluate(() => window.show()); + await page.locator(".basalt-command-split, .basalt-command").first().waitFor(); + await settle(page); + assert.equal(await page.evaluate(() => document.activeElement?.id), "held"); + } finally { await page.close(); } + }); +}); + +describe("scroll stops", () => { + test("a drawer body whose only button is hidden is still a keyboard stop, and becomes one again when the button is hidden later", async () => { + const LONG = `Array.from({ length: 40 }, (_, i) =>

      Log line {i}

      )`; + const { page } = await fixturePage(browser, render(`
      + +
      {[...${LONG}, ]}
      +
      {[...${LONG}, ]}
      +
      `), { viewport: { width: 1440, height: 900 } }); + try { + await page.locator(".basalt-drawer-body").first().waitFor(); + await settle(page); + assert.deepEqual(await page.locator(".basalt-drawer-body").evaluateAll((els) => els.map((el) => el.getAttribute("tabindex"))), ["0", null]); + await page.evaluate(() => { document.getElementById("shown").style.visibility = "hidden"; }); + await page.waitForFunction(() => document.querySelectorAll(".basalt-drawer-body")[1].getAttribute("tabindex") === "0"); + } finally { await page.close(); } + }); +}); + +describe("DialogContent", () => { + test("a control a live region holds outside the dialog stays inert when the dialog's ref changes, and one that mounts there later is made inert too", async () => { + const { page } = await fixturePage(browser, `function App() { + const [n, setN] = React.useState(0); const [more, setMore] = React.useState(false); + window.bump = () => setN((x) => x + 1); window.more = () => setMore(true); + const ref = React.useCallback((el) => { window.popup = el; }, [n]); + return <>
      {more ? : null}
      + Settings; } + ${render("")}`); + try { + await page.locator("#inside").waitFor(); + await page.waitForFunction(() => document.getElementById("live").hasAttribute("inert")); + await page.evaluate(() => window.bump()); + await settle(page); + assert.equal(await page.evaluate(() => document.getElementById("live").hasAttribute("inert")), true, "a new ref keeps the guard"); + assert.equal(await page.evaluate(() => window.popup?.isConnected), true, "the new ref has the popup"); + await page.evaluate(() => window.more()); + await page.waitForFunction(() => document.getElementById("later")?.hasAttribute("inert")); + assert.equal(await page.evaluate(() => document.getElementById("inside").hasAttribute("inert")), false); + } finally { await page.close(); } + }); +}); diff --git a/sites/build.mjs b/sites/build.mjs index df7088e6..4c0c8564 100644 --- a/sites/build.mjs +++ b/sites/build.mjs @@ -32,7 +32,7 @@ const NOT_SITES = new Set(["shared", "test", "dist", "node_modules"]); const MIME = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp", ".gif": "image/gif", ".svg": "image/svg+xml", ".ico": "image/x-icon", ".avif": "image/avif" }; const DIRECTIVE = //g; -const within = (parent, file) => { const rel = path.relative(parent, file); return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel); }; +const within = (parent, file) => { const rel = path.relative(parent, file); return rel !== "" && rel !== ".." && !rel.startsWith(`..${path.sep}`) && !path.isAbsolute(rel); }; /** The file an include names, or an Error that says which page and which include. */ function locate(name, { bodyFile, siteDir, sharedDir, brandDir }) { @@ -45,6 +45,8 @@ function locate(name, { bodyFile, siteDir, sharedDir, brandDir }) { else { parent = siteDir; file = path.resolve(path.dirname(bodyFile), name); } if (!within(parent, file)) throw fail("reaches outside its folder"); if (!fs.existsSync(file) || !fs.statSync(file).isFile()) throw fail(`is missing (looked for ${file})`); + // The spelled path is inside; so must the file it reaches be, since reading follows a link (compose.mjs checks a diagram's mark the same way). + if (!within(fs.realpathSync(parent), fs.realpathSync(file))) throw fail("links outside its folder; put the file itself there"); return file; } @@ -87,7 +89,8 @@ export function buildPage(bodyFile, { outFile, siteDir = path.dirname(bodyFile), const { body, includes } = resolveIncludes(finishHeaders(source, bodyFile), { bodyFile, siteDir, sharedDir, brandDir }); let composed; try { - composed = compose(body, { fonts }); + // A diagram's own mark is read from beside the body, wherever the build was started. + composed = compose(body, { fonts, baseDir: path.dirname(path.resolve(bodyFile)) }); } catch (error) { throw new Error(`${bodyFile}: ${error.message}`); } @@ -95,7 +98,7 @@ export function buildPage(bodyFile, { outFile, siteDir = path.dirname(bodyFile), fs.mkdirSync(path.dirname(outFile), { recursive: true }); fs.writeFileSync(outFile, composed.html); } - return { bodyFile, outFile, html: composed.html, includes, modules: composed.modules, icons: composed.icons, bytes: composed.bytes }; + return { bodyFile, outFile, html: composed.html, includes, modules: composed.modules, icons: composed.icons, external: composed.external, bytes: composed.bytes }; } /** Every SITE/PAGE.body.html under `root` (a site is a folder of root that is not shared/, test/ or dist/), as { site, page, bodyFile }. */ diff --git a/sites/test/build.test.mjs b/sites/test/build.test.mjs index 381e2ba4..b2ba73cf 100644 --- a/sites/test/build.test.mjs +++ b/sites/test/build.test.mjs @@ -87,6 +87,21 @@ describe("the includes", () => { assert.throws(() => build(""), /inlines \.css, \.js, \.svg and \.html/); assert.throws(() => build(""), /not an image/); }); + + test("an include whose path is inside but which links outside is not read (the file it reaches is checked, as a diagram's mark is)", () => { + const root = makeRoot({ "a/index.body.html": `x`, "secret.css": `.secret {}`, "secret.png": "png" }); + fs.symlinkSync(path.join(root, "secret.css"), path.join(root, "a", "linked.css")); + fs.symlinkSync(path.join(root, "secret.png"), path.join(root, "a", "linked.png")); + const build = (body) => { fs.writeFileSync(path.join(root, "a", "index.body.html"), `A\n${body}\n`); return buildSites({ root, outDir: path.join(root, "out") }); }; + assert.throws(() => build(""), /links outside its folder/); + assert.throws(() => build(''), /links outside its folder/); + }); + + test("a page's result carries the references that leave the file, for the caller to report", () => { + const root = makeRoot({ "a/index.body.html": `A\n

      A

      \n\n` }); + const page = buildPage(path.join(root, "a", "index.body.html"), { fonts: false }); + assert.deepEqual(page.external, ['']); + }); }); describe("pages are found and built per site", () => { diff --git a/tools/html-skill/src/compose.mjs b/tools/html-skill/src/compose.mjs index d1cf730f..97622962 100644 --- a/tools/html-skill/src/compose.mjs +++ b/tools/html-skill/src/compose.mjs @@ -472,6 +472,26 @@ const staysInFile = (url) => /^(?:#|(?:data|blob|about|javascript|mailto|tel):)/ */ function externalReferences(held, markup) { const found = new Set(); + // The URLs of a srcset, read the way HTML reads one: a URL runs to whitespace (a data: URL's own commas included; trailing commas end the + // candidate), then its descriptors run to the next comma outside parentheses. + const srcsetUrls = (value) => { + const out = []; + let at = 0; + while (at < value.length) { + while (at < value.length && /[\s,]/.test(value[at])) at++; + let end = at; + while (end < value.length && !/\s/.test(value[end])) end++; + let url = value.slice(at, end); + const bare = url.replace(/,+$/, ""); + at = end; + if (bare.length === url.length) { + for (let depth = 0; at < value.length && (depth > 0 || value[at] !== ","); at++) depth += value[at] === "(" ? 1 : value[at] === ")" ? -1 : 0; + } + url = bare; + if (url) out.push(url); + } + return out; + }; const tags = (text) => { for (let at = text.indexOf("<"); at !== -1; at = text.indexOf("<", at + 1)) { if (!isAlpha(text[at + 1] ?? "")) continue; @@ -482,7 +502,7 @@ function externalReferences(held, markup) { if (tag.name === "link" && rel === "canonical" && key === "href") continue; if (key === "style") for (const url of cssUrls(value)) found.add(`<${tag.name} style> url(${url})`); if (!["src", "href", "xlink:href", "data", "poster", "srcset"].includes(key)) continue; - const urls = key === "srcset" ? value.split(",").map((candidate) => candidate.trim().split(/\s+/)[0]) : [value]; + const urls = key === "srcset" ? srcsetUrls(value) : [value]; for (const url of urls) if (url && !staysInFile(url)) found.add(`<${tag.name} ${key}="${url}">${tag.name === "a" || tag.name === "area" ? " (a link)" : ""}`); } at = tag.end - 1; diff --git a/tools/html-skill/src/core.js b/tools/html-skill/src/core.js index 1cd5d4bc..0fe2c972 100644 --- a/tools/html-skill/src/core.js +++ b/tools/html-skill/src/core.js @@ -25,6 +25,11 @@ return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); } + /** A link the script writes or follows from data may be relative, http, https or mailto. javascript:, data: and the rest are refused. Parsed the way a browser parses it. */ + function safeHref(href) { + try { return /^(https?|mailto):$/.test(new URL(String(href), 'https://basalt.invalid/').protocol); } catch (e) { return false; } + } + /* ------------------------------------------------------------------ icons */ var warned = {}; @@ -185,6 +190,6 @@ init: init, icon: icon, hydrateIcons: hydrateIcons, announce: announce, getTheme: getTheme, setTheme: setTheme, toggleTheme: toggleTheme, // For the modules and compose.mjs; not part of the page API. - _: { esc: esc, reserve: reserve, icon: icon, announce: announce, getTheme: getTheme, setTheme: setTheme, step: step, onTheme: onTheme, addIcons: function (data) { for (var k in data) ICONS[k] = data[k]; } } + _: { esc: esc, safeHref: safeHref, reserve: reserve, icon: icon, announce: announce, getTheme: getTheme, setTheme: setTheme, step: step, onTheme: onTheme, addIcons: function (data) { for (var k in data) ICONS[k] = data[k]; } } }; })(); diff --git a/tools/html-skill/src/modules/chart.js b/tools/html-skill/src/modules/chart.js index 1b695a55..8657c0b3 100644 --- a/tools/html-skill/src/modules/chart.js +++ b/tools/html-skill/src/modules/chart.js @@ -73,9 +73,10 @@ } var span = Math.max(hiPad - loPad, hi0 > 0 ? hi0 : 1); var magnitude = Math.floor(Math.log10(Math.max(span, 1e-9))); - for (var power = magnitude - 2; power <= magnitude + 2; power++) { + // Five powers, counted apart from the exponent: a span that overflows to Infinity has an infinite magnitude, and Infinity + 1 never ends a loop. + for (var k = 0; k < 5; k++) { for (var b = 0; b < NICE.length; b++) { - var step = NICE[b] * Math.pow(10, power); + var step = NICE[b] * Math.pow(10, magnitude - 2 + k); scale = fit(step); if (intervals(scale) <= 5) return intervals(scale) < 2 ? { lo: scale.lo, hi: scale.lo + 2 * step, step: step } : scale; } @@ -83,9 +84,11 @@ return fit(span); } + // The most gridlines a scale has (scaleOf's 3 to 6, with room); a scale that overflowed draws no more than this and never loops without end. + var MOST_TICKS = 12; function ticksOf(scale) { var out = []; - for (var k = 0; k <= Math.round((scale.hi - scale.lo) / scale.step); k++) out.push(Math.round((scale.lo + k * scale.step) * 1e9) / 1e9); + for (var k = 0, n = Math.min(Math.round((scale.hi - scale.lo) / scale.step), MOST_TICKS); k <= n; k++) out.push(Math.round((scale.lo + k * scale.step) * 1e9) / 1e9); return out; } diff --git a/tools/html-skill/src/modules/notifications.js b/tools/html-skill/src/modules/notifications.js index 34adb7c1..01d5cf04 100644 --- a/tools/html-skill/src/modules/notifications.js +++ b/tools/html-skill/src/modules/notifications.js @@ -16,6 +16,17 @@ * label?: 'Notifications', onSelect?(entry), onMarkAllRead?(), onClearAll?() (shows Clear all at the foot's start), onViewAll?(), viewAllHref?, side?: 'bottom', align?: 'end' }) */ function isGroup(e) { return !!(e.entries && e.entries.length); } + // The placements the popover module knows; anything else is the default, so an option never reaches the markup as written. + var SIDES = { bottom: 1, top: 1, left: 1, right: 1 }; + var ALIGNS = { start: 1, center: 1, end: 1 }; + // A link from the entries is followed only when it is relative, http, https or mailto (core's check); any other is dropped with a warning, and the row is a button. + var refused = {}; + function href(h) { + if (h == null || h === '') return null; + if (_.safeHref(h)) return h; + if (!refused[h]) { refused[h] = 1; console.warn('Basalt: a notification link must be relative, http, https or mailto'); } + return null; + } // Errors never group: a danger entry in a group is drawn at the top level, right after it, and a group left with none is not drawn. function drawn(list) { var out = []; @@ -36,9 +47,12 @@ var entries = drawn(o.entries || []); // Which groups are open, by entry id, so a new list from setEntries keeps them. var opened = {}; + var side = SIDES[o.side] ? o.side : 'bottom'; + var align = ALIGNS[o.align] ? o.align : 'end'; + var viewAllHref = href(o.viewAllHref); host.innerHTML = '' + - '
      ' + + '
      ' + '

      ' + _.esc(label) + '

      ' + '
      ' + '' + @@ -54,8 +68,8 @@ var scroll = pop.querySelector('.notifications-scroll'); var list = pop.querySelector('.notifications-list'); var foot = pop.querySelector('.notifications-foot'); - foot.innerHTML = (o.onClearAll ? '' : '') + (o.viewAllHref - ? 'View all' + foot.innerHTML = (o.onClearAll ? '' : '') + (viewAllHref + ? 'View all' : ''); var viewAll = foot.lastElementChild; var clear = pop.querySelector('.notifications-clear'); @@ -67,12 +81,13 @@ function isUnread(e) { return isGroup(e) ? e.entries.some(function (c) { return !!c.unread; }) : !!e.unread; } function row(e, index, group) { var st = e.status || 'neutral'; - var tag = group || !e.href ? 'button' : 'a'; + var link = group ? null : href(e.href); + var tag = link ? 'a' : 'button'; var unread = isUnread(e); // The count is the app's only as a whole number above 0, so nothing else reaches the markup. var n = group ? (Number.isInteger(e.count) && e.count > 0 ? e.count : e.entries.length) : 0; var title = '' + (unread ? 'Unread: ' : '') + _.esc(e.title) + (group ? ', ' + n + ' times' : '') + ''; - return '<' + tag + (tag === 'a' ? ' href="' + _.esc(e.href) + '"' : ' type="button"') + ' class="notification" data-index="' + index + '" data-id="' + _.esc(e.id) + '"' + (unread ? ' data-unread' : '') + ' data-status="' + _.esc(st) + '"' + + return '<' + tag + (tag === 'a' ? ' href="' + _.esc(link) + '"' : ' type="button"') + ' class="notification" data-index="' + index + '" data-id="' + _.esc(e.id) + '"' + (unread ? ' data-unread' : '') + ' data-status="' + _.esc(st) + '"' + (e.current ? ' data-current aria-current="' + (tag === 'a' ? 'page' : 'true') + '"' : '') + (group ? ' data-group aria-expanded="' + !!opened[e.id] + '" aria-controls="' + group + '"' : '') + '>' + '' + '' + (group ? '' + title + '' + CARET + '' : title) + diff --git a/tools/html-skill/src/modules/palette.js b/tools/html-skill/src/modules/palette.js index ba8763be..f098d760 100644 --- a/tools/html-skill/src/modules/palette.js +++ b/tools/html-skill/src/modules/palette.js @@ -15,10 +15,8 @@ var activePalette = null; var paletteSeq = 0; - /** A palette link may be relative, http, https or mailto. javascript:, data: and the rest are refused. Parsed the way a browser parses it. */ - function safeHref(href) { - try { return /^(https?|mailto):$/.test(new URL(String(href), 'https://basalt.invalid/').protocol); } catch (e) { return false; } - } + // A palette link may be relative, http, https or mailto (core's check). + var safeHref = _.safeHref; /** Keys that belong to an input method editor (composition, or the legacy keyCode 229). They are never commands. */ function composing(e) { return !!e.isComposing || e.keyCode === 229; } diff --git a/tools/html-skill/test/audit-fix-c8.test.mjs b/tools/html-skill/test/audit-fix-c8.test.mjs index f88892f7..1aa947eb 100644 --- a/tools/html-skill/test/audit-fix-c8.test.mjs +++ b/tools/html-skill/test/audit-fix-c8.test.mjs @@ -79,7 +79,9 @@ describe("A5-24: a reference that leaves the file is warned of, after the page", assert.deepEqual(external('

      x

      '), [""] : []), ``, ...styles.map((style) => `${style.css}`), diff --git a/.agent/skills/basalt-html/parts/braille.css b/.agent/skills/basalt-html/parts/braille.css index 42fb710b..b8eb082a 100644 --- a/.agent/skills/basalt-html/parts/braille.css +++ b/.agent/skills/basalt-html/parts/braille.css @@ -1 +1 @@ -@layer basalt{braille-spinner{display:inline-block;flex:none;width:var(--basalt-size-dot);height:var(--basalt-space-2-5);line-height:0;color:inherit}braille-spinner>svg{display:block;width:100%;height:100%;overflow:visible}.braille-dot{fill:currentColor;opacity:0;animation:var(--basalt-duration-loop-braille) step-end infinite}.braille-dot[data-hold]{opacity:1}.braille-dot[data-dot="1"]{animation-name:bh-b1}.braille-dot[data-dot="2"]{animation-name:bh-b2}.braille-dot[data-dot="3"]{animation-name:bh-b3}.braille-dot[data-dot="4"]{animation-name:bh-b4}.braille-dot[data-dot="5"]{animation-name:bh-b5}.braille-dot[data-dot="6"]{animation-name:bh-b6}@keyframes bh-b1{0%{opacity:1}30%{opacity:0}70%{opacity:1}}@keyframes bh-b2{0%{opacity:1}10%{opacity:0}60%{opacity:1}}@keyframes bh-b3{0%{opacity:0}40%{opacity:1}}@keyframes bh-b4{0%{opacity:1}50%{opacity:0}90%{opacity:1}}@keyframes bh-b5{0%{opacity:0}10%{opacity:1}60%{opacity:0}}@keyframes bh-b6{0%{opacity:0}20%{opacity:1}80%{opacity:0}}@media(prefers-reduced-motion:reduce){.braille-dot[data-dot]{animation:none}}} +@layer basalt{braille-spinner{display:inline-block;flex:none;width:var(--basalt-size-dot);height:var(--basalt-space-2-5);line-height:0;color:inherit}braille-spinner>svg{display:block;width:100%;height:100%;overflow:visible}.braille-dot{fill:currentColor;opacity:0;animation:var(--basalt-duration-loop-braille) step-end infinite}.braille-dot[data-hold]{opacity:1}.braille-dot[data-dot="1"]{animation-name:bh-b1}.braille-dot[data-dot="2"]{animation-name:bh-b2}.braille-dot[data-dot="3"]{animation-name:bh-b3}.braille-dot[data-dot="4"]{animation-name:bh-b4}.braille-dot[data-dot="5"]{animation-name:bh-b5}.braille-dot[data-dot="6"]{animation-name:bh-b6}@keyframes bh-b1{0%{opacity:1}30%{opacity:0}70%{opacity:1}}@keyframes bh-b2{0%{opacity:1}10%{opacity:0}60%{opacity:1}}@keyframes bh-b3{0%{opacity:0}40%{opacity:1}}@keyframes bh-b4{0%{opacity:1}50%{opacity:0}90%{opacity:1}}@keyframes bh-b5{0%{opacity:0}10%{opacity:1}60%{opacity:0}}@keyframes bh-b6{0%{opacity:0}20%{opacity:1}80%{opacity:0}}@media(prefers-reduced-motion:reduce){.braille-dot[data-dot]{animation:none}}:root[data-loops=held] .braille-dot[data-dot]{animation:none}} diff --git a/.agent/skills/basalt-html/parts/loops.css b/.agent/skills/basalt-html/parts/loops.css index aba47bad..f6c71a87 100644 --- a/.agent/skills/basalt-html/parts/loops.css +++ b/.agent/skills/basalt-html/parts/loops.css @@ -1 +1 @@ -@layer basalt{:root[data-loops=held] .spinner{animation:none;border-top-color:currentColor}:root[data-loops=held] .braille-dot[data-dot]{animation:none}:root[data-loops=held] .btn[aria-busy=true]:after{animation:none;border-top-color:currentColor}} +@layer basalt{:root[data-loops=held] .btn[aria-busy=true]:after{animation:none;border-top-color:currentColor}} diff --git a/.agent/skills/basalt-html/parts/spinner.css b/.agent/skills/basalt-html/parts/spinner.css index 7216a502..2024a4f5 100644 --- a/.agent/skills/basalt-html/parts/spinner.css +++ b/.agent/skills/basalt-html/parts/spinner.css @@ -1 +1 @@ -@layer basalt{.spinner{display:inline-block;flex:none;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);color:var(--basalt-text-secondary);border:1.5px solid color-mix(in oklch,currentColor 25%,transparent);border-top-color:currentColor;border-radius:var(--basalt-radius-full);animation:bh-spin var(--basalt-duration-loop-ring) linear infinite;vertical-align:-.125em}.btn .spinner,.palette .spinner{color:inherit}@media(prefers-reduced-motion:reduce){.spinner{animation:bh-fade var(--basalt-duration-loop-fade) var(--basalt-ease-in-out) infinite;border-top-color:color-mix(in oklch,currentColor 25%,transparent)}}} +@layer basalt{.spinner{display:inline-block;flex:none;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);color:var(--basalt-text-secondary);border:1.5px solid color-mix(in oklch,currentColor 25%,transparent);border-top-color:currentColor;border-radius:var(--basalt-radius-full);animation:bh-spin var(--basalt-duration-loop-ring) linear infinite;vertical-align:-.125em}.btn .spinner,.palette .spinner{color:inherit}:root[data-loops=held] .spinner{animation:none;border-top-color:currentColor}@media(prefers-reduced-motion:reduce){.spinner{animation:bh-fade var(--basalt-duration-loop-fade) var(--basalt-ease-in-out) infinite;border-top-color:color-mix(in oklch,currentColor 25%,transparent)}}} diff --git a/tools/html-skill/src/compose.mjs b/tools/html-skill/src/compose.mjs index 97622962..9716a617 100644 --- a/tools/html-skill/src/compose.mjs +++ b/tools/html-skill/src/compose.mjs @@ -40,6 +40,8 @@ const here = path.dirname(fileURLToPath(import.meta.url)); const THEME_INIT = `(function(){var t,c,r=document.documentElement;try{t=localStorage.getItem("basalt-theme")}catch(e){}c=t==="light"||t==="dark"?t:"system";if(c==="system")t=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";r.setAttribute("data-theme",t);r.setAttribute("data-theme-choice",c);try{if(sessionStorage.getItem("basalt-keyboard")==="hardware")document.documentElement.setAttribute("data-keyboard","hardware")}catch(e){}})();`; // A page with the loops module sets a stored hold before first paint (React's loopsBootstrap), beside the theme's line. +// The modules that draw a loop (their own held rules travel with them), and the toggle's. +const LOOPING = new Set(["loops", "spinner", "braille", "sparkline", "ambient"]); const LOOPS_INIT = `(function(){try{if(localStorage.getItem("basalt-loops")==="held")document.documentElement.setAttribute("data-loops","held")}catch(e){}})();`; const read = (dir, name) => fs.readFileSync(path.join(dir, name), "utf8"); @@ -607,7 +609,8 @@ export function compose(body, { fonts = true, lang = "en", all = false, parts = `${title}`, ...headTags, ``, - ...(chosen.modules.includes("loops") ? [``] : []), + // Any page that draws a loop keeps a hold the reader stored on another page of the origin, not only a page with the toggle. + ...(chosen.modules.some((n) => LOOPING.has(n)) ? [``] : []), ...(fonts ? [""] : []), ``, ...styles.map((style) => `${style.css}`), diff --git a/tools/html-skill/src/modules.json b/tools/html-skill/src/modules.json index 638e5624..5ebf394a 100644 --- a/tools/html-skill/src/modules.json +++ b/tools/html-skill/src/modules.json @@ -1,5 +1,5 @@ { - "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page).", + "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page), spinner 650 to 720 (its held rule moved in from loops, so a ring-only page keeps a stored hold).", "budgets": { "skillMd": 12650, "core": 35400 @@ -914,7 +914,7 @@ "classes": [ "spinner" ], - "budget": 650, + "budget": 720, "usage": 300 }, "braille": { diff --git a/tools/html-skill/src/modules/braille.css b/tools/html-skill/src/modules/braille.css index 6033b92e..8f7274b6 100644 --- a/tools/html-skill/src/modules/braille.css +++ b/tools/html-skill/src/modules/braille.css @@ -26,4 +26,7 @@ @media (prefers-reduced-motion: reduce) { .braille-dot[data-dot] { animation: none; } } + + /* The hold (data-loops="held"): braille holds its first frame, the dots lit at rest. */ + :root[data-loops="held"] .braille-dot[data-dot] { animation: none; } } diff --git a/tools/html-skill/src/modules/loops.css b/tools/html-skill/src/modules/loops.css index 737cb89a..49e97f90 100644 --- a/tools/html-skill/src/modules/loops.css +++ b/tools/html-skill/src/modules/loops.css @@ -4,8 +4,7 @@ The ring, a busy button's ring and braille (so a toast's, a status's and the terminal's). It outranks reduced motion by specificity, so held is one look whatever the OS says, and it stops the ring's fade too. Braille holds its first frame (the base look, the dots that are lit at rest); the ring stands still at its drawing, at full opacity. Nothing is hidden or swapped, and the words still say the work is - running. The toast's drain is a countdown, not a loop, so it is not held. */ - :root[data-loops="held"] .spinner { animation: none; border-top-color: currentColor; } - :root[data-loops="held"] .braille-dot[data-dot] { animation: none; } + running. The toast's drain is a countdown, not a loop, so it is not held. The ring's and braille's own rules are in their modules, so a page with + one of them and no toggle still keeps a stored hold. */ :root[data-loops="held"] .btn[aria-busy="true"]::after { animation: none; border-top-color: currentColor; } } diff --git a/tools/html-skill/src/modules/spinner.css b/tools/html-skill/src/modules/spinner.css index 773360be..7fe01846 100644 --- a/tools/html-skill/src/modules/spinner.css +++ b/tools/html-skill/src/modules/spinner.css @@ -8,6 +8,9 @@ .btn .spinner, .palette .spinner { color: inherit; } + /* The hold (data-loops="held", set before first paint from a stored choice): the ring stands still at its drawing, at full opacity, whatever the OS says. */ + :root[data-loops="held"] .spinner { animation: none; border-top-color: currentColor; } + @media (prefers-reduced-motion: reduce) { .spinner { animation: bh-fade var(--basalt-duration-loop-fade) var(--basalt-ease-in-out) infinite; border-top-color: color-mix(in oklch, currentColor 25%, transparent); } } diff --git a/tools/html-skill/test/compose.test.mjs b/tools/html-skill/test/compose.test.mjs index 1c336567..dfb8c6cc 100644 --- a/tools/html-skill/test/compose.test.mjs +++ b/tools/html-skill/test/compose.test.mjs @@ -108,6 +108,14 @@ describe("what a body gets", () => { assert.ok(!compose("

      x

      ", { fonts: false }).html.includes("basalt-loops")); }); + test("a page that draws a loop without the toggle (a ring, braille, a loading sparkline) keeps a stored hold too, and carries the indicator's own held rule", () => { + for (const [body, rule] of [['', /:root\[data-loops="?held"?\] \.spinner\{animation:none/], ['', /:root\[data-loops="?held"?\] \.braille-dot\[data-dot\]\{animation:none/]]) { + const html = compose(body, { fonts: false }).html; + assert.match(html.split("")[0], /localStorage\.getItem\("basalt-loops"\)/, body); + assert.match(html, rule, body); + } + }); + test("the art tokens come only to a page that names one: art, aspect, stage headroom and chart tokens bring the art module, and a page that names none gets none", () => { for (const name of ["--basalt-art-tone-2", "--basalt-art-quiet-limit", "--basalt-aspect-photo", "--basalt-size-stage-headroom", "--basalt-chart-observed", "--basalt-size-chart-plot"]) { assert.deepEqual(used(`
      `), ["art"], name); From a5e98843a3c82e9d7d3ed43e74268675730fcedb Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:25:19 -0600 Subject: [PATCH 07/13] Review fixes, batch 6: Mod in the HTML skill's palette keys and toast actions The chips drew Mod as the platform's modifier, but the palette's binding refused it (the item got no chip and no key), and a toast action wrote the literal word Mod into aria-keyshortcuts. Both now resolve Mod through the kbd module, as the chips do. The palette opener's Meta-or-Ctrl rule is unchanged (it is the skill's documented rule; DECISIONS 244 differs, which is a ruling, not a fix). Budgets: kbd 2950, palette 11500, toast 16150. Co-Authored-By: Claude Opus 5.5 --- .agent/skills/basalt-html/parts/kbd.js | 2 +- .agent/skills/basalt-html/parts/manifest.json | 10 ++++---- .agent/skills/basalt-html/parts/palette.js | 2 +- .agent/skills/basalt-html/parts/toast.js | 2 +- .../skills/basalt-html/parts/usage/palette.md | 2 +- tools/html-skill/src/modules.json | 8 +++---- tools/html-skill/src/modules/kbd.js | 2 +- tools/html-skill/src/modules/palette.js | 2 ++ tools/html-skill/src/modules/toast.js | 2 +- tools/html-skill/src/usage/palette.md | 2 +- tools/html-skill/test/repo-review.test.mjs | 24 +++++++++++++++++++ 11 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.agent/skills/basalt-html/parts/kbd.js b/.agent/skills/basalt-html/parts/kbd.js index 90a2e3ab..237196ba 100644 --- a/.agent/skills/basalt-html/parts/kbd.js +++ b/.agent/skills/basalt-html/parts/kbd.js @@ -1 +1 @@ -(function(n){"use strict";var e=n._,b=e.esc,p=e.icon,a={"⌘":"Command","⌥":"Option","⌃":"Control"},o={"⌘":"Meta","⌥":"Alt","⌃":"Control","⇧":"Shift","↵":"Enter","↑":"ArrowUp","↓":"ArrowDown","←":"ArrowLeft","→":"ArrowRight",Esc:"Escape",Ctrl:"Control","⌫":"Backspace","⇥":"Tab"},y=/mac|ip(hone|ad|od)/i.test((navigator.userAgentData||navigator).platform||navigator.userAgent)?{Mod:"⌘",Enter:"↵"}:{Mod:"Ctrl"};function d(t){return t.indexOf("Mod")<0?t:t.map(function(r){return y[r]||r})}function f(t){return'"}function i(t){return'"}function m(t){return d(t).map(function(r){return o[r]||(r.length===1?r.toUpperCase():r)}).join("+")}function h(t){return d(t).map(function(r){return a[r]||o[r]||r.toUpperCase()}).join(" ")}function l(){document.querySelectorAll("[data-kbd]").forEach(function(t){t.outerHTML=i(t.dataset.kbd.trim().split(/\s+/)).replace('class="kbd-group"','class="kbd-group"'+(t.hasAttribute("data-doc")?" data-doc":""))})}var u="basalt-keyboard";function s(){return document.documentElement.getAttribute("data-keyboard")==="hardware"}function k(t){return t.isComposing||t.key==="Unidentified"||t.key==="Process"||t.key==="Dead"?!1:t.key==="Tab"||t.key==="Escape"||t.metaKey||t.ctrlKey||t.altKey}function w(){var t=document.documentElement;try{sessionStorage.getItem(u)==="hardware"&&t.setAttribute("data-keyboard","hardware")}catch{}if(!(s()||t.__bhKeys)){t.__bhKeys=!0;var r=function(c){if(k(c)){document.removeEventListener("keydown",r,!0),t.setAttribute("data-keyboard","hardware");try{sessionStorage.setItem(u,"hardware")}catch{}}};document.addEventListener("keydown",r,{capture:!0,passive:!0})}}n.kbdGroup=i,n.hardwareKeyboard=s,e.kbd={MOD_ICON:a,KEY_NAME:o,kbdGroup:i,keyshortcuts:m,keywords:h},e.step(20,"initKeyboard",w),e.step(50,"hydrateKbd",l)})(window.Basalt); +(function(o){"use strict";var e=o._,b=e.esc,p=e.icon,a={"⌘":"Command","⌥":"Option","⌃":"Control"},d={"⌘":"Meta","⌥":"Alt","⌃":"Control","⇧":"Shift","↵":"Enter","↑":"ArrowUp","↓":"ArrowDown","←":"ArrowLeft","→":"ArrowRight",Esc:"Escape",Ctrl:"Control","⌫":"Backspace","⇥":"Tab"},y=/mac|ip(hone|ad|od)/i.test((navigator.userAgentData||navigator).platform||navigator.userAgent)?{Mod:"⌘",Enter:"↵"}:{Mod:"Ctrl"};function n(t){return t.indexOf("Mod")<0?t:t.map(function(r){return y[r]||r})}function f(t){return'"}function i(t){return'"}function m(t){return n(t).map(function(r){return d[r]||(r.length===1?r.toUpperCase():r)}).join("+")}function h(t){return n(t).map(function(r){return a[r]||d[r]||r.toUpperCase()}).join(" ")}function l(){document.querySelectorAll("[data-kbd]").forEach(function(t){t.outerHTML=i(t.dataset.kbd.trim().split(/\s+/)).replace('class="kbd-group"','class="kbd-group"'+(t.hasAttribute("data-doc")?" data-doc":""))})}var u="basalt-keyboard";function s(){return document.documentElement.getAttribute("data-keyboard")==="hardware"}function k(t){return t.isComposing||t.key==="Unidentified"||t.key==="Process"||t.key==="Dead"?!1:t.key==="Tab"||t.key==="Escape"||t.metaKey||t.ctrlKey||t.altKey}function w(){var t=document.documentElement;try{sessionStorage.getItem(u)==="hardware"&&t.setAttribute("data-keyboard","hardware")}catch{}if(!(s()||t.__bhKeys)){t.__bhKeys=!0;var r=function(c){if(k(c)){document.removeEventListener("keydown",r,!0),t.setAttribute("data-keyboard","hardware");try{sessionStorage.setItem(u,"hardware")}catch{}}};document.addEventListener("keydown",r,{capture:!0,passive:!0})}}o.kbdGroup=i,o.hardwareKeyboard=s,e.kbd={MOD_ICON:a,KEY_NAME:d,mod:n,kbdGroup:i,keyshortcuts:m,keywords:h},e.step(20,"initKeyboard",w),e.step(50,"hydrateKbd",l)})(window.Basalt); diff --git a/.agent/skills/basalt-html/parts/manifest.json b/.agent/skills/basalt-html/parts/manifest.json index 638e5624..f0bf1c10 100644 --- a/.agent/skills/basalt-html/parts/manifest.json +++ b/.agent/skills/basalt-html/parts/manifest.json @@ -1,5 +1,5 @@ { - "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page).", + "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page), spinner 650 to 720 (its held rule moved in from loops, so a ring-only page keeps a stored hold), kbd 2900 to 2950, palette 11400 to 11500 and toast 16050 to 16150 (Mod in a palette item's keys is bound as it is drawn, and a toast action's aria-keyshortcuts resolves Mod).", "budgets": { "skillMd": 12650, "core": 35400 @@ -105,7 +105,7 @@ "Option", "Control" ], - "budget": 2900, + "budget": 2950, "usage": 550, "textWords": [ "a call to Basalt.kbdGroup or Basalt.hardwareKeyboard" @@ -855,7 +855,7 @@ "kbd", "glide" ], - "budget": 11400, + "budget": 11500, "budgetReason": "audit-fix-c2 Sol build: 9897 to 10801 bytes (+904); hosted top-layer scrim, logical-host cleanup, scoped keys and the modal depth reset preserve the original page painting and explicit inertness, escape sheet clipping and allow dialogs above the palette. Cap 9900 to 10801. Return 1: 10801 to 10843 bytes (+42) for pointer focus on the panel without a ring and modal-only hosting; cap 10801 to 11000, leaving 157 bytes.", "usage": 1350, "textWords": [ @@ -914,7 +914,7 @@ "classes": [ "spinner" ], - "budget": 650, + "budget": 720, "usage": 300 }, "braille": { @@ -1160,7 +1160,7 @@ "Warning", "XCircle" ], - "budget": 16050, + "budget": 16150, "budgetReason": "audit-fix-c2 Sol build: 14288 to 14780 bytes (+492); observe focus before the first toast, retain the last live modal on blur, release the viewport before modal closure, preserve real keyboard composition state and keep a toast action's Escape from cancelling its native host. Cap 14350 to 14780. Return 1: 14780 to 14866 bytes (+86) for ordinary reverse Tab, clearing stale F6 returns and observing mutations only while hosted; cap 14780 to 15100, leaving 234 bytes. Return 3 and DECISIONS 156: 15031 to 15367 bytes (+336) for distinct pointer/keyboard focus restoration and the front-toast control ring while the region holds focus. Cap 15100 to 15400 (+300), leaving 33 bytes.", "usage": 1100, "builds": [ diff --git a/.agent/skills/basalt-html/parts/palette.js b/.agent/skills/basalt-html/parts/palette.js index ad67cecc..8cd2f247 100644 --- a/.agent/skills/basalt-html/parts/palette.js +++ b/.agent/skills/basalt-html/parts/palette.js @@ -1 +1 @@ -(function(A){"use strict";var p=A._,y=p.esc,Y=p.icon,J=p.searchSvg='',L=p.kbd.kbdGroup,V=p.kbd.keyshortcuts,X=p.kbd.keywords,Q=p.kbd.KEY_NAME,W=A.hardwareKeyboard,v=null,Z=0;function ee(e){try{return/^(https?|mailto):$/.test(new URL(String(e),"https://basalt.invalid/").protocol)}catch{return!1}}function N(e){return!!e.isComposing||e.keyCode===229}var E={};function H(e){var r=e.keys;if(!r)return null;if(!Array.isArray(r))return E["a:"+e.label]||(E["a:"+e.label]=1,console.warn('Basalt: "'+e.label+`" has keys that are not an array; write keys: ['⌘', 'S']`)),null;var a=r.filter(function(l){return l==="⌘"||l==="⌃"||l==="⌥"||l==="⇧"}),s=r.filter(function(l){return a.indexOf(l)===-1});if(s.length!==1||!a.some(function(l){return l!=="⇧"})){var h=e.label+r.join(" ");return E[h]||(E[h]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"] that cannot be bound; a shortcut needs ⌘, ⌃ or ⌥ and one more key")),null}var o={cmd:a.indexOf("⌘")!==-1,ctrl:a.indexOf("⌃")!==-1,alt:a.indexOf("⌥")!==-1,shift:a.indexOf("⇧")!==-1,key:String(Q[s[0]]||s[0]).toLowerCase()};if((o.cmd||o.ctrl)&&!o.alt&&!o.shift&&o.key==="k"){var i=e.label+r.join(" ");return E[i]||(E[i]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"], which open the palette; choose another shortcut")),null}return o}function te(e){return!!e&&(/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.isContentEditable)}function re(e){var r=e.composedPath?e.composedPath():[];return r.length||(r=[e.target]),r.some(te)}function ae(e,r){if(e.alt!==r.altKey||e.shift!==r.shiftKey)return!1;var a=e.ctrl?r.ctrlKey&&e.cmd===r.metaKey:e.cmd?r.metaKey!==r.ctrlKey:!r.metaKey&&!r.ctrlKey;return a&&(String(r.key).toLowerCase()===e.key||e.key.length===1&&/^[a-z]$/.test(e.key)&&r.code==="Key"+e.key.toUpperCase())}function T(e,r){e.onSelect&&e.onSelect(e),r.onSelect&&r.onSelect(e),e.href&&(ee(e.href)?location.href=e.href:console.warn("Basalt: a palette link must be relative, http, https or mailto"))}function O(e,r){if(!r)return 0;var a=r.toLowerCase().split(/\s+/).filter(Boolean),s=function(h){return a.every(function(o){return h.indexOf(o)!==-1})};return s(e.label.toLowerCase())?0:s((e.label+" "+(e.keywords||[]).join(" ")+" "+(e.hint||"")+" "+(e.description||"")).toLowerCase())?1:-1}function ne(e,r){return O(e,r)>=0}function R(e,r,a,s){var h=[],o="",i="",l=[];return e.forEach(function(c,u){var C=(c.items||[]).map(function(m,b){return{it:m,t:O(m,a),i:b}}).filter(function(m){return m.t>=0}).sort(function(m,b){return m.t-b.t||m.i-b.i});C.length&&l.push({g:c,gi:u,items:C})}),l.sort(function(c,u){return c.items[0].t-u.items[0].t||c.gi-u.gi}),l.forEach(function(c){var u=c.g,C=c.gi,m=c.items.map(function(n){return n.it}),b=r+"-g"+C;o+='
      ",u.label&&(o+='
      '+y(u.label)+"
      "),m.forEach(function(n){var f=h.length;h.push(n);var g=H(n)?n.keys:null;g&&(i+=''+y(X(g))+""),o+='
      "+(n.icon?Y(n.icon):"")+''+y(n.label)+""+(n.description?''+y(n.description)+"":"")+(n.hint?''+y(n.hint)+"":"")+(g?L(g):"")+(s||"")+"
      "}),o+="
      "}),{html:o,words:i,flat:h}}function q(e){var r=e||{},a=r.groups||[];v&&v.close();var s="bh-palette-"+ ++Z,h=r.label||"Command palette",o=document.activeElement,i=document.createElement("div");i.className="scrim palette-scrim",i.innerHTML='";var l=i.firstElementChild,c=l.querySelector("input"),u=l.querySelector('[role="listbox"]'),C=l.querySelector(".palette-empty"),m=l.querySelector('[role="status"]'),b=l.querySelector("#"+s+"-keys"),n=[],f=0,g="",D;function se(t){clearTimeout(D),t!==g&&(D=setTimeout(function(){m.textContent=g=t},400))}function B(){!matchMedia("(hover: none) and (pointer: coarse)").matches||W()?c.setAttribute("aria-describedby",s+"-hints"):c.removeAttribute("aria-describedby")}function I(){var t=c.value.trim(),d=R(a,s,t);n=d.flat,u.innerHTML=d.html,u.insertBefore(P,u.firstChild),b.innerHTML=d.words,u.hidden=n.length===0,C.hidden=n.length!==0,f=Math.min(f,Math.max(n.length-1,0)),S(n.length?f:-1,!1),se(n.length?n.length+(n.length===1?" result":" results"):"No commands match.")}function S(t,d){var K=u.querySelectorAll('[role="option"]');if(K.forEach(function(F){F.setAttribute("aria-selected","false"),F.removeAttribute("data-active")}),t<0||!K[t]){c.removeAttribute("aria-activedescendant");return}f=t,K[t].setAttribute("aria-selected","true"),K[t].setAttribute("data-active",""),c.setAttribute("aria-activedescendant",K[t].id),d!==!1&&K[t].scrollIntoView({block:"nearest"})}function U(t){var d=n[t];d&&(k(),T(d,r))}var w=o&&o.closest("dialog:modal"),_=[],ce=document.documentElement.style.overflow,x;function G(t){t.newState==="closed"&&k()}var P=document.createElement("span");P.className="plate",P.setAttribute("aria-hidden","true");var j;function $(){clearTimeout(D),j&&j(),document.removeEventListener("keydown",z,!0),x&&x.disconnect(),w&&w.removeEventListener("beforetoggle",G),p.toast&&p.toast.release(i),i.matches(":popover-open")&&i.hidePopover(),i.remove(),_.forEach(function(t){t[1]||t[0].removeAttribute("inert")}),_=[],document.documentElement.style.overflow=ce}function k(){v===M&&(v=null,$(),o&&o.focus&&document.contains(o)&&o.focus(),r.onClose&&r.onClose())}function z(t){if(!(!i.isConnected||!l.contains(t.target)||t.target.closest(".toast-viewport"))&&(B(),!N(t))){if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),k();return}if(t.key==="ArrowDown"){t.preventDefault(),n.length&&S((f+1)%n.length);return}if(t.key==="ArrowUp"){t.preventDefault(),n.length&&S((f-1+n.length)%n.length);return}if(t.key==="Enter"){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;t.preventDefault(),n.length&&U(f);return}t.key==="Tab"&&(t.preventDefault(),c.focus())}}u.addEventListener("pointermove",function(t){var d=t.target.closest('[role="option"]');d&&Number(d.dataset.index)!==f&&S(Number(d.dataset.index),!1)}),u.addEventListener("click",function(t){var d=t.target.closest('[role="option"]');d&&U(Number(d.dataset.index))}),i.addEventListener("pointerdown",function(t){t.target===i&&k()}),i.addEventListener("toggle",function(t){t.newState==="closed"&&k()}),c.addEventListener("input",function(){f=0,I()});var M={close:k,element:l};I(),B();try{[].forEach.call((w||document.body).children,function(t){t.tagName==="DIALOG"||t.tagName==="SCRIPT"||t.id==="basalt-live"||t.classList.contains("toast-viewport")||(_.push([t,t.hasAttribute("inert")]),t.setAttribute("inert",""))}),(w||document.body).appendChild(i),w&&(i.setAttribute("popover","manual"),i.showPopover()),w&&(w.addEventListener("beforetoggle",G),x=new MutationObserver(function(){(!w.open||!w.isConnected)&&k()}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]})),document.documentElement.style.overflow="hidden",j=p.glide(u,P,{active:".row[data-active]",attr:"data-active"}),document.addEventListener("keydown",z,!0),v=M,c.focus()}catch(t){throw v===M&&(v=null),$(),t}return M}function oe(){v&&v.close()}function ie(e){var r=function(a){if(!(a.defaultPrevented||N(a)||!(a.metaKey||a.ctrlKey||a.altKey))){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&String(a.key).toLowerCase()==="k"){a.preventDefault(),v?v.close():q(typeof e=="function"?e():e);return}var s=typeof e=="function"?e():e,h=!(a.metaKey||a.ctrlKey)&&re(a);(s.groups||[]).some(function(o){return(o.items||[]).some(function(i){var l=H(i);return!l||h||!ae(l,a)?!1:(a.preventDefault(),v&&v.close(),T(i,s),!0)})})}};return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}}function le(e){if(!e){var r=document.querySelector('script[type="application/json"][data-palette]');r&&(e=JSON.parse(r.textContent))}!e||document.documentElement.__bhPalette||(document.documentElement.__bhPalette=!0,document.querySelectorAll("[data-open-palette]").forEach(function(a){a.addEventListener("click",function(){q(typeof e=="function"?e():e)}),a.hasAttribute("aria-keyshortcuts")||a.setAttribute("aria-keyshortcuts","Meta+K Control+K"),a.setAttribute("aria-haspopup","dialog")}),ie(e))}p.palette={rows:R,tier:O,matches:ne,activate:T,composing:N},A.openPalette=q,A.closePalette=oe,p.step(110,"wirePalette",function(e){le(e.palette)})})(window.Basalt); +(function(A){"use strict";var v=A._,y=v.esc,Y=v.icon,J=v.searchSvg='',L=v.kbd.kbdGroup,V=v.kbd.keyshortcuts,X=v.kbd.keywords,Q=v.kbd.KEY_NAME,W=A.hardwareKeyboard,p=null,Z=0;function ee(e){try{return/^(https?|mailto):$/.test(new URL(String(e),"https://basalt.invalid/").protocol)}catch{return!1}}function N(e){return!!e.isComposing||e.keyCode===229}var E={};function H(e){var r=e.keys;if(!r)return null;if(!Array.isArray(r))return E["a:"+e.label]||(E["a:"+e.label]=1,console.warn('Basalt: "'+e.label+`" has keys that are not an array; write keys: ['⌘', 'S']`)),null;r=v.kbd.mod(r).map(function(o){return o==="Ctrl"?"⌃":o});var a=r.filter(function(o){return o==="⌘"||o==="⌃"||o==="⌥"||o==="⇧"}),s=r.filter(function(o){return a.indexOf(o)===-1});if(s.length!==1||!a.some(function(o){return o!=="⇧"})){var h=e.label+r.join(" ");return E[h]||(E[h]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"] that cannot be bound; a shortcut needs ⌘, ⌃ or ⌥ and one more key")),null}var i={cmd:a.indexOf("⌘")!==-1,ctrl:a.indexOf("⌃")!==-1,alt:a.indexOf("⌥")!==-1,shift:a.indexOf("⇧")!==-1,key:String(Q[s[0]]||s[0]).toLowerCase()};if((i.cmd||i.ctrl)&&!i.alt&&!i.shift&&i.key==="k"){var l=e.label+r.join(" ");return E[l]||(E[l]=1,console.warn('Basalt: "'+e.label+'" has keys ['+r.join(" ")+"], which open the palette; choose another shortcut")),null}return i}function te(e){return!!e&&(/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.isContentEditable)}function re(e){var r=e.composedPath?e.composedPath():[];return r.length||(r=[e.target]),r.some(te)}function ae(e,r){if(e.alt!==r.altKey||e.shift!==r.shiftKey)return!1;var a=e.ctrl?r.ctrlKey&&e.cmd===r.metaKey:e.cmd?r.metaKey!==r.ctrlKey:!r.metaKey&&!r.ctrlKey;return a&&(String(r.key).toLowerCase()===e.key||e.key.length===1&&/^[a-z]$/.test(e.key)&&r.code==="Key"+e.key.toUpperCase())}function T(e,r){e.onSelect&&e.onSelect(e),r.onSelect&&r.onSelect(e),e.href&&(ee(e.href)?location.href=e.href:console.warn("Basalt: a palette link must be relative, http, https or mailto"))}function O(e,r){if(!r)return 0;var a=r.toLowerCase().split(/\s+/).filter(Boolean),s=function(h){return a.every(function(i){return h.indexOf(i)!==-1})};return s(e.label.toLowerCase())?0:s((e.label+" "+(e.keywords||[]).join(" ")+" "+(e.hint||"")+" "+(e.description||"")).toLowerCase())?1:-1}function ne(e,r){return O(e,r)>=0}function R(e,r,a,s){var h=[],i="",l="",o=[];return e.forEach(function(c,u){var C=(c.items||[]).map(function(m,b){return{it:m,t:O(m,a),i:b}}).filter(function(m){return m.t>=0}).sort(function(m,b){return m.t-b.t||m.i-b.i});C.length&&o.push({g:c,gi:u,items:C})}),o.sort(function(c,u){return c.items[0].t-u.items[0].t||c.gi-u.gi}),o.forEach(function(c){var u=c.g,C=c.gi,m=c.items.map(function(n){return n.it}),b=r+"-g"+C;i+='
      ",u.label&&(i+='
      '+y(u.label)+"
      "),m.forEach(function(n){var f=h.length;h.push(n);var g=H(n)?n.keys:null;g&&(l+=''+y(X(g))+""),i+='
      "+(n.icon?Y(n.icon):"")+''+y(n.label)+""+(n.description?''+y(n.description)+"":"")+(n.hint?''+y(n.hint)+"":"")+(g?L(g):"")+(s||"")+"
      "}),i+="
      "}),{html:i,words:l,flat:h}}function q(e){var r=e||{},a=r.groups||[];p&&p.close();var s="bh-palette-"+ ++Z,h=r.label||"Command palette",i=document.activeElement,l=document.createElement("div");l.className="scrim palette-scrim",l.innerHTML='";var o=l.firstElementChild,c=o.querySelector("input"),u=o.querySelector('[role="listbox"]'),C=o.querySelector(".palette-empty"),m=o.querySelector('[role="status"]'),b=o.querySelector("#"+s+"-keys"),n=[],f=0,g="",D;function se(t){clearTimeout(D),t!==g&&(D=setTimeout(function(){m.textContent=g=t},400))}function B(){!matchMedia("(hover: none) and (pointer: coarse)").matches||W()?c.setAttribute("aria-describedby",s+"-hints"):c.removeAttribute("aria-describedby")}function I(){var t=c.value.trim(),d=R(a,s,t);n=d.flat,u.innerHTML=d.html,u.insertBefore(P,u.firstChild),b.innerHTML=d.words,u.hidden=n.length===0,C.hidden=n.length!==0,f=Math.min(f,Math.max(n.length-1,0)),S(n.length?f:-1,!1),se(n.length?n.length+(n.length===1?" result":" results"):"No commands match.")}function S(t,d){var K=u.querySelectorAll('[role="option"]');if(K.forEach(function(F){F.setAttribute("aria-selected","false"),F.removeAttribute("data-active")}),t<0||!K[t]){c.removeAttribute("aria-activedescendant");return}f=t,K[t].setAttribute("aria-selected","true"),K[t].setAttribute("data-active",""),c.setAttribute("aria-activedescendant",K[t].id),d!==!1&&K[t].scrollIntoView({block:"nearest"})}function U(t){var d=n[t];d&&(k(),T(d,r))}var w=i&&i.closest("dialog:modal"),_=[],ce=document.documentElement.style.overflow,x;function G(t){t.newState==="closed"&&k()}var P=document.createElement("span");P.className="plate",P.setAttribute("aria-hidden","true");var j;function $(){clearTimeout(D),j&&j(),document.removeEventListener("keydown",z,!0),x&&x.disconnect(),w&&w.removeEventListener("beforetoggle",G),v.toast&&v.toast.release(l),l.matches(":popover-open")&&l.hidePopover(),l.remove(),_.forEach(function(t){t[1]||t[0].removeAttribute("inert")}),_=[],document.documentElement.style.overflow=ce}function k(){p===M&&(p=null,$(),i&&i.focus&&document.contains(i)&&i.focus(),r.onClose&&r.onClose())}function z(t){if(!(!l.isConnected||!o.contains(t.target)||t.target.closest(".toast-viewport"))&&(B(),!N(t))){if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),k();return}if(t.key==="ArrowDown"){t.preventDefault(),n.length&&S((f+1)%n.length);return}if(t.key==="ArrowUp"){t.preventDefault(),n.length&&S((f-1+n.length)%n.length);return}if(t.key==="Enter"){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey)return;t.preventDefault(),n.length&&U(f);return}t.key==="Tab"&&(t.preventDefault(),c.focus())}}u.addEventListener("pointermove",function(t){var d=t.target.closest('[role="option"]');d&&Number(d.dataset.index)!==f&&S(Number(d.dataset.index),!1)}),u.addEventListener("click",function(t){var d=t.target.closest('[role="option"]');d&&U(Number(d.dataset.index))}),l.addEventListener("pointerdown",function(t){t.target===l&&k()}),l.addEventListener("toggle",function(t){t.newState==="closed"&&k()}),c.addEventListener("input",function(){f=0,I()});var M={close:k,element:o};I(),B();try{[].forEach.call((w||document.body).children,function(t){t.tagName==="DIALOG"||t.tagName==="SCRIPT"||t.id==="basalt-live"||t.classList.contains("toast-viewport")||(_.push([t,t.hasAttribute("inert")]),t.setAttribute("inert",""))}),(w||document.body).appendChild(l),w&&(l.setAttribute("popover","manual"),l.showPopover()),w&&(w.addEventListener("beforetoggle",G),x=new MutationObserver(function(){(!w.open||!w.isConnected)&&k()}),x.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]})),document.documentElement.style.overflow="hidden",j=v.glide(u,P,{active:".row[data-active]",attr:"data-active"}),document.addEventListener("keydown",z,!0),p=M,c.focus()}catch(t){throw p===M&&(p=null),$(),t}return M}function oe(){p&&p.close()}function ie(e){var r=function(a){if(!(a.defaultPrevented||N(a)||!(a.metaKey||a.ctrlKey||a.altKey))){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&String(a.key).toLowerCase()==="k"){a.preventDefault(),p?p.close():q(typeof e=="function"?e():e);return}var s=typeof e=="function"?e():e,h=!(a.metaKey||a.ctrlKey)&&re(a);(s.groups||[]).some(function(i){return(i.items||[]).some(function(l){var o=H(l);return!o||h||!ae(o,a)?!1:(a.preventDefault(),p&&p.close(),T(l,s),!0)})})}};return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}}function le(e){if(!e){var r=document.querySelector('script[type="application/json"][data-palette]');r&&(e=JSON.parse(r.textContent))}!e||document.documentElement.__bhPalette||(document.documentElement.__bhPalette=!0,document.querySelectorAll("[data-open-palette]").forEach(function(a){a.addEventListener("click",function(){q(typeof e=="function"?e():e)}),a.hasAttribute("aria-keyshortcuts")||a.setAttribute("aria-keyshortcuts","Meta+K Control+K"),a.setAttribute("aria-haspopup","dialog")}),ie(e))}v.palette={rows:R,tier:O,matches:ne,activate:T,composing:N},A.openPalette=q,A.closePalette=oe,v.step(110,"wirePalette",function(e){le(e.palette)})})(window.Basalt); diff --git a/.agent/skills/basalt-html/parts/toast.js b/.agent/skills/basalt-html/parts/toast.js index 1e400b54..8428d9b5 100644 --- a/.agent/skills/basalt-html/parts/toast.js +++ b/.agent/skills/basalt-html/parts/toast.js @@ -1 +1 @@ -(function(x){"use strict";var v=x._,C=3,B=5e3,u=[],p=[],E=0,r,m,k=!1,T=!1,P=!1,M=!1,S={preventScroll:!0},f=[],O,h=null,d=null;function b(e){return e.status||"neutral"}function G(e){return e.home===void 0?[]:typeof e.home=="string"?[e.home]:e.home}function w(e){if(e.running)return 0;var t=G(e),i=e.action?t.some(function(n){return n!=="page"}):t.length>0;return i?e.timeout==null?B:e.timeout:0}function J(e,t){t?(m.textContent="",setTimeout(function(){m.textContent=e},30)):x.announce(e)}function D(e,t){J(e.title+(t||"")+(e.description?". "+e.description:""),b(e)==="danger")}var j={success:"CheckCircle",warning:"Warning",danger:"XCircle"};function F(){r||(r=document.createElement("div"),r.className="toast-viewport",r.setAttribute("popover","manual"),r.setAttribute("role","region"),r.setAttribute("aria-label","Notifications"),r.setAttribute("aria-live","off"),r.tabIndex=-1,r.addEventListener("keydown",function(e){if(!(e.target!==r&&e.target!==r.firstElementChild||e.key!=="Escape"&&!(e.key==="Tab"&&e.shiftKey))&&!((!d||!d.isConnected)&&(d=null,e.key!=="Escape"))){e.preventDefault(),e.stopPropagation();var t=d;d=null,t&&t.isConnected&&t.focus(S)}}),document.body.appendChild(r),r.addEventListener("pointerenter",function(){k=!0,c()}),r.addEventListener("pointerleave",function(){k=!1,c()}),r.addEventListener("focusin",function(){T=!0,c()}),r.addEventListener("focusout",function(e){document.hasFocus()&&!r.contains(e.relatedTarget)&&(d=null,T=!1,c())}),window.addEventListener("blur",function(e){e.target===window&&(P=!0,c())},!0),window.addEventListener("focus",function(e){e.target===window&&(P=!1,c())},!0),document.addEventListener("visibilitychange",function(){M=document.visibilityState==="hidden",c()}),M=document.visibilityState==="hidden",document.addEventListener("focusin",A),O=new MutationObserver(A),document.addEventListener("beforetoggle",function(e){e.newState==="closed"&&X(e.target)},!0))}function I(){m||(m=document.createElement("div"),m.className="visually-hidden",m.setAttribute("role","alert"),document.body.appendChild(m))}function A(){if(r){f=f.filter(function(i){return i.isConnected&&i.matches("dialog:modal,.palette-scrim")});var e=document.activeElement,t=e&&e.closest?e.closest("dialog:modal,.palette-scrim"):null;t&&(f=f.filter(function(i){return i!==t}),f.push(t)),e!==document.body&&!r.contains(e)&&(h=e),R(f[f.length-1]||document.body)}}function R(e){if(r.parentNode!==e){O.disconnect(),e!==document.body&&O.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]});var t=r.matches(":popover-open");e.appendChild(r),(t||u.length)&&(r.showPopover(),Q())}}function X(e){e!==r&&(r&&e.contains(r)&&R(document.body),f=f.filter(function(t){return t!==e}))}v.toast={release:X};function Q(){u.forEach(function(e){var t=e.el.querySelector(".toast-drain"),i=w(e.o);if(!(!t||i<=0)){var n=e.left-(e.running?Date.now()-e.running:0);t.style.animationDelay=n-i+"ms"}})}function H(){return P||M}function L(){return k||T}function c(){if(r){var e=u.filter(function(n){return!n.leaving}).reverse(),t=0,i=0;r.toggleAttribute("data-away",H()),e.forEach(function(n,a){n.h=n.content.offsetHeight+2*parseFloat(getComputedStyle(n.el).borderTopWidth),a===0&&(i=n.h)}),u.forEach(function(n){var a=e.indexOf(n);if(n.el.toggleAttribute("data-front",a===0),!(a<0)){var s=n.el.style;s.setProperty("--toast-index",a),s.setProperty("--toast-height",n.h+"px"),s.setProperty("--toast-frontmost-height",i+"px"),s.setProperty("--toast-offset-y",t+"px"),t+=n.h,n.el.toggleAttribute("data-expanded",L()),n.content.toggleAttribute("data-expanded",L()),n.content.toggleAttribute("data-behind",a>0&&!L()),n.el.toggleAttribute("data-limited",a>=C)}}),u.forEach(V)}}function V(e){if(clearTimeout(e.timer),!e.leaving){var t=w(e.o);e.lap!==e.stamp+":"+t&&(e.lap=e.stamp+":"+t,e.left=t,e.running=0),e.running&&(e.left=Math.max(0,e.left-(Date.now()-e.running)),e.running=0),!(t<=0||L()||H())&&(e.running=Date.now(),e.timer=setTimeout(function(){g(e.id,!0)},e.left))}}function g(e,t){var i=u.filter(function(s){return s.id===e})[0];if(!(!i||i.leaving)){t=t??i.keyboard!==!1,i.leaving=!0,clearTimeout(i.timer),i.el.setAttribute("data-ending-style",""),c();var n=function(){if(W(i)){var s=t&&u.filter(function(l){return l!==i&&!l.leaving}).pop(),o=s?s.el:d&&d.isConnected?d:h;o&&o.isConnected&&o.focus(S)}i.el.remove(),u=u.filter(function(l){return l!==i}),!u.length&&r.matches(":popover-open")&&r.hidePopover(),Z(),c()},a=i.el.getAnimations?i.el.getAnimations():[];a.length?Promise.all(a.map(function(s){return s.finished.catch(function(){})})).then(n):n()}}function W(e){return e.el.contains(document.activeElement)}function Y(){var e=u.filter(function(i){return!i.leaving});if(e.length0&&!W(e[t]))return g(e[t].id),!0;return!1}function Z(){for(;p.length&&u.filter(function(e){return!e.leaving}).length
      ":"")+'

      '+v.esc(t.title)+(e.count>1?', '+e.count+" times":"")+'

      '+v.esc(t.description||"")+"

      "+(t.action?'":"")+'';var s=e.content.querySelector(".toast-action");s&&s.addEventListener("click",function(){t.action.onClick()}),e.content.querySelector(".toast-close").addEventListener("click",function(){g(e.id)});var o=e.el.querySelector(".toast-drain");o&&o.remove();var l=w(t);l>0&&e.el.insertAdjacentHTML("afterbegin",''),e.el.setAttribute("aria-labelledby",e.id+"-t"),e.el.setAttribute("aria-describedby",e.id+"-d")}function _(e){F(),u.push(e),e.el=document.createElement("div"),e.el.className="toast",e.el.id=e.id,e.el.setAttribute("role","dialog"),e.el.setAttribute("aria-modal","false"),e.el.tabIndex=0,e.content=document.createElement("div"),e.content.className="toast-content",e.el.appendChild(e.content),q(e),e.el.setAttribute("data-starting-style",""),A();var t=document.querySelector("[popover]:popover-open:not(.toast-viewport)");r.matches(":popover-open")&&t&&r.hidePopover(),r.matches(":popover-open")||r.showPopover(),r.insertBefore(e.el,r.firstChild),c(),e.el.offsetWidth,e.el.removeAttribute("data-starting-style"),e.el.addEventListener("keydown",function(i){e.keyboard=!0,i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),g(e.id,!0))}),$(e),e.o.running||D(e.o,e.count>1?", "+e.count+" times":"")}function $(e){var t=null;e.el.addEventListener("pointerdown",function(n){e.keyboard=!1,(n.pointerType!=="mouse"||n.button===0)&&(n.target.closest("button")||(t=n.clientX))}),e.el.addEventListener("pointermove",function(n){if(t!==null){var a=Math.max(0,n.clientX-t);a>4&&(e.el.setAttribute("data-swiping",""),e.el.style.setProperty("--toast-swipe-movement-x",a+"px"))}});var i=function(n){if(t!==null){var a=Math.max(0,n.clientX-t);t=null,e.el.removeAttribute("data-swiping"),a>60?(e.el.setAttribute("data-swipe-direction","right"),g(e.id)):e.el.style.removeProperty("--toast-swipe-movement-x")}};e.el.addEventListener("pointerup",i),e.el.addEventListener("pointercancel",i)}function z(e){return u.filter(function(t){return t.id===e})[0]||p.filter(function(t){return t.id===e})[0]}function y(e){I();var t=b(e);if(e.group&&t!=="danger"&&!e.running){var i=function(s){return s.o.group===e.group&&!s.o.running&&b(s.o)===t&&!s.leaving},n=u.filter(i)[0]||p.filter(i)[0];if(n)return n.count+=1,n.o=e,n.el&&(n.stamp=++E,q(n),c(),D(e,", "+n.count+" times")),n.id}var a={id:"bh-toast-"+ ++E,o:e,seat:!!e.running||t!=="neutral",count:1,stamp:++E};return Y()?_(a):p.push(a),a.id}function N(e,t){var i=z(e);if(i){var n=i.o,a=!!n.running&&!t.running,s=a?{title:n.title,group:n.group,home:n.home,timeout:n.timeout}:n,o={};Object.keys(s).forEach(function(l){o[l]=s[l]}),Object.keys(t).forEach(function(l){o[l]=t[l]}),o.running=t.running||!1,i.o=o,i.seat=i.seat||b(o)!=="neutral",i.el&&(i.stamp=++E,q(i),c(),!o.running&&(a||n.title!==o.title||n.description!==o.description)&&D(o))}}function ee(e){var t=z(e);t&&(t.el?g(e):p=p.filter(function(i){return i!==t}))}function te(e,t){var i=typeof t.running=="string"?{title:t.running}:t.running,n={};Object.keys(i).forEach(function(o){n[o]=i[o]}),n.running=!0;var a=y(n),s=function(o){return typeof o=="string"?{title:o}:o};return e.then(function(o){N(a,s(typeof t.success=="function"?t.success(o):t.success))},function(o){var l=s(typeof t.error=="function"?t.error(o):t.error),K={status:"danger"};Object.keys(l).forEach(function(U){K[U]=l[U]}),N(a,K)}),e}x.toast=y,y.update=N,y.close=ee,y.promise=te,v.step(140,"wireToast",function(){I(),F(),document.addEventListener("keydown",function(e){e.key!=="F6"||!u.length||e.target===r||(e.preventDefault(),A(),r.contains(document.activeElement)||(d=document.activeElement===document.body&&h&&h.isConnected?h:document.activeElement),r.focus(S))},!0)})})(window.Basalt); +(function(L){"use strict";var f=L._,x=3,B=5e3,u=[],p=[],E=0,r,m,C=!1,T=!1,P=!1,S=!1,M={preventScroll:!0},v=[],O,h=null,d=null;function b(e){return e.status||"neutral"}function G(e){return e.home===void 0?[]:typeof e.home=="string"?[e.home]:e.home}function w(e){if(e.running)return 0;var t=G(e),i=e.action?t.some(function(n){return n!=="page"}):t.length>0;return i?e.timeout==null?B:e.timeout:0}function J(e,t){t?(m.textContent="",setTimeout(function(){m.textContent=e},30)):L.announce(e)}function D(e,t){J(e.title+(t||"")+(e.description?". "+e.description:""),b(e)==="danger")}var j={success:"CheckCircle",warning:"Warning",danger:"XCircle"};function F(){r||(r=document.createElement("div"),r.className="toast-viewport",r.setAttribute("popover","manual"),r.setAttribute("role","region"),r.setAttribute("aria-label","Notifications"),r.setAttribute("aria-live","off"),r.tabIndex=-1,r.addEventListener("keydown",function(e){if(!(e.target!==r&&e.target!==r.firstElementChild||e.key!=="Escape"&&!(e.key==="Tab"&&e.shiftKey))&&!((!d||!d.isConnected)&&(d=null,e.key!=="Escape"))){e.preventDefault(),e.stopPropagation();var t=d;d=null,t&&t.isConnected&&t.focus(M)}}),document.body.appendChild(r),r.addEventListener("pointerenter",function(){C=!0,c()}),r.addEventListener("pointerleave",function(){C=!1,c()}),r.addEventListener("focusin",function(){T=!0,c()}),r.addEventListener("focusout",function(e){document.hasFocus()&&!r.contains(e.relatedTarget)&&(d=null,T=!1,c())}),window.addEventListener("blur",function(e){e.target===window&&(P=!0,c())},!0),window.addEventListener("focus",function(e){e.target===window&&(P=!1,c())},!0),document.addEventListener("visibilitychange",function(){S=document.visibilityState==="hidden",c()}),S=document.visibilityState==="hidden",document.addEventListener("focusin",A),O=new MutationObserver(A),document.addEventListener("beforetoggle",function(e){e.newState==="closed"&&X(e.target)},!0))}function I(){m||(m=document.createElement("div"),m.className="visually-hidden",m.setAttribute("role","alert"),document.body.appendChild(m))}function A(){if(r){v=v.filter(function(i){return i.isConnected&&i.matches("dialog:modal,.palette-scrim")});var e=document.activeElement,t=e&&e.closest?e.closest("dialog:modal,.palette-scrim"):null;t&&(v=v.filter(function(i){return i!==t}),v.push(t)),e!==document.body&&!r.contains(e)&&(h=e),R(v[v.length-1]||document.body)}}function R(e){if(r.parentNode!==e){O.disconnect(),e!==document.body&&O.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["open"]});var t=r.matches(":popover-open");e.appendChild(r),(t||u.length)&&(r.showPopover(),Q())}}function X(e){e!==r&&(r&&e.contains(r)&&R(document.body),v=v.filter(function(t){return t!==e}))}f.toast={release:X};function Q(){u.forEach(function(e){var t=e.el.querySelector(".toast-drain"),i=w(e.o);if(!(!t||i<=0)){var n=e.left-(e.running?Date.now()-e.running:0);t.style.animationDelay=n-i+"ms"}})}function H(){return P||S}function k(){return C||T}function c(){if(r){var e=u.filter(function(n){return!n.leaving}).reverse(),t=0,i=0;r.toggleAttribute("data-away",H()),e.forEach(function(n,a){n.h=n.content.offsetHeight+2*parseFloat(getComputedStyle(n.el).borderTopWidth),a===0&&(i=n.h)}),u.forEach(function(n){var a=e.indexOf(n);if(n.el.toggleAttribute("data-front",a===0),!(a<0)){var s=n.el.style;s.setProperty("--toast-index",a),s.setProperty("--toast-height",n.h+"px"),s.setProperty("--toast-frontmost-height",i+"px"),s.setProperty("--toast-offset-y",t+"px"),t+=n.h,n.el.toggleAttribute("data-expanded",k()),n.content.toggleAttribute("data-expanded",k()),n.content.toggleAttribute("data-behind",a>0&&!k()),n.el.toggleAttribute("data-limited",a>=x)}}),u.forEach(V)}}function V(e){if(clearTimeout(e.timer),!e.leaving){var t=w(e.o);e.lap!==e.stamp+":"+t&&(e.lap=e.stamp+":"+t,e.left=t,e.running=0),e.running&&(e.left=Math.max(0,e.left-(Date.now()-e.running)),e.running=0),!(t<=0||k()||H())&&(e.running=Date.now(),e.timer=setTimeout(function(){g(e.id,!0)},e.left))}}function g(e,t){var i=u.filter(function(s){return s.id===e})[0];if(!(!i||i.leaving)){t=t??i.keyboard!==!1,i.leaving=!0,clearTimeout(i.timer),i.el.setAttribute("data-ending-style",""),c();var n=function(){if(W(i)){var s=t&&u.filter(function(l){return l!==i&&!l.leaving}).pop(),o=s?s.el:d&&d.isConnected?d:h;o&&o.isConnected&&o.focus(M)}i.el.remove(),u=u.filter(function(l){return l!==i}),!u.length&&r.matches(":popover-open")&&r.hidePopover(),Z(),c()},a=i.el.getAnimations?i.el.getAnimations():[];a.length?Promise.all(a.map(function(s){return s.finished.catch(function(){})})).then(n):n()}}function W(e){return e.el.contains(document.activeElement)}function Y(){var e=u.filter(function(i){return!i.leaving});if(e.length0&&!W(e[t]))return g(e[t].id),!0;return!1}function Z(){for(;p.length&&u.filter(function(e){return!e.leaving}).length
      diff --git a/packages/react/src/safe-href.ts b/packages/react/src/safe-href.ts new file mode 100644 index 00000000..42a31c82 --- /dev/null +++ b/packages/react/src/safe-href.ts @@ -0,0 +1,8 @@ +/** A destination Basalt itself may send the page to: relative, http, https or mailto, read the way the browser reads it. javascript:, data: and the rest are refused. */ +export function safeHref(href: string): boolean { + try { + return /^(https?|mailto):$/.test(new URL(href, typeof location === "undefined" ? "https://basalt.invalid/" : location.href).protocol); + } catch { + return false; + } +} diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts index 698476a8..5b35dfcd 100644 --- a/packages/react/src/utils.ts +++ b/packages/react/src/utils.ts @@ -19,12 +19,3 @@ export function join(...parts: Array): string export function withStyle(base: React.CSSProperties, style?: PartStyle): React.CSSProperties | ((state: any) => React.CSSProperties) { return typeof style === "function" ? (state: any) => ({ ...base, ...style(state as PartState) }) : { ...base, ...style }; } - -/** A destination Basalt itself may send the page to: relative, http, https or mailto, read the way the browser reads it. javascript:, data: and the rest are refused. */ -export function safeHref(href: string): boolean { - try { - return /^(https?|mailto):$/.test(new URL(href, typeof location === "undefined" ? "https://basalt.invalid/" : location.href).protocol); - } catch { - return false; - } -} diff --git a/packages/react/src/wait.ts b/packages/react/src/wait.ts index 8fc0dbee..c9c05c8b 100644 --- a/packages/react/src/wait.ts +++ b/packages/react/src/wait.ts @@ -104,10 +104,9 @@ export function takeClick(render: R, onClick: Press | undefined): [R, P const second = onClick?.(event); if (!isThenable(first)) return second; if (!isThenable(second)) return first; - return Promise.allSettled([first, second]).then((settled) => { - const failed = settled.find((result): result is PromiseRejectedResult => result.status === "rejected"); - if (failed) throw failed.reason; - return settled.map((result) => (result as PromiseFulfilledResult).value); + return Promise.allSettled([first, second]).then(([a, b]) => { + if (a.status === "rejected") throw a.reason; + if (b.status === "rejected") throw b.reason; }); }]; } diff --git a/packages/react/test/bundle.test.mjs b/packages/react/test/bundle.test.mjs index 0783bd0a..52162986 100644 --- a/packages/react/test/bundle.test.mjs +++ b/packages/react/test/bundle.test.mjs @@ -78,13 +78,18 @@ async function lazyGraph(names, extra = "") { // 58,309 (to 58,350). Review fix (Astra): a handler on the element given as `render` is taken into the press (takeClick, about 250 bytes), so each rose again: // Button 17,631 (to 17,650), CopyButton 18,545 (18,550), DirectoryList 19,991 (20,000), Drawer 18,180 (18,200), NotificationCentre 147,581 (147,600), PeriodStepper 17,923 // (17,950), Reveal 19,587 (19,600), TextButton 10,555 (10,600), the toolbar set 58,604 (58,650). +// The repo review (23 Nov 2026, engineering fixes; limits are soft, the owner's word): takeClick waits for both of two promised handlers to settle before it frees a +// press (Promise.allSettled, about 90 bytes in every button's graph), the modal guard survives a changed ref and watches for outside controls, a required Field reaches +// Select, and LinkTabs checks a destination before it navigates. Measured, each limit rounded up to the next 50: Button 17,741 (17,750), CopyButton 18,655 (18,700), +// DirectoryList 20,118 (20,150), Drawer 18,290 (18,300), NotificationCentre 152,654 (152,700), PeriodStepper 18,033 (18,050), Reveal 19,716 (19,750), TextButton +// 10,665 (10,700), the toolbar set 58,706 (58,750), LinkTabs 142,054 (142,100), SearchDialog 89,168 (89,200). // DECISIONS 221 (the owner: "size limits can be raised yes"): Button 15,600 to 16,150 and Reveal 18,000 to 18,100 (here), the toolbar set 56,050 to 56,350, Terminal 26,600 to 27,000, Pagination // 21,600 to 21,750 and NotificationCentre 141,850 to 142,150 with the plugin (below and icons.test.mjs): the controls now draw a core glyph through the morph, and the part every control carries // (control-icon.tsx, about 780 bytes in Button) is in each one's static graph; the engine itself is lazy, with its own limit. Measured: Button 16,119, Reveal 18,076, the toolbar set 56,336, // Terminal 26,956, Pagination 21,719, NotificationCentre 142,101; each limit is the measurement rounded up to the next 50. // The whole static chunk graph, under splitting, for single imports. CommandMenu's lazy panel must not drag the // keyboard machinery, the icons or anything else into an import that never mentions it. -for (const [name, limit] of [["Spinner", 2_500], ["Sparkline", 6_000], ["Skeleton", 2_500], ["Badge", 3_000], ["NumberTicker", 7_000], ["Button", 17_650], ["Kbd", 11_000], ["AmbientMark", 1_500], ["LoopsToggle", 40_000], ["LoopsToggleIcon", 20_000], ["Reflow", 8_000], ["createTravellers", 1_000], ["entranceVerdict", 2_000], ["Listbox", 3_400], ["OpenList", 2_500], ["NoticeBar", 2_000], ["SearchTrigger", 5_500], ["SearchResult", 2_000], ["Drawer", 18_200]]) { +for (const [name, limit] of [["Spinner", 2_500], ["Sparkline", 6_000], ["Skeleton", 2_500], ["Badge", 3_000], ["NumberTicker", 7_000], ["Button", 17_750], ["Kbd", 11_000], ["AmbientMark", 1_500], ["LoopsToggle", 40_000], ["LoopsToggleIcon", 20_000], ["Reflow", 8_000], ["createTravellers", 1_000], ["entranceVerdict", 2_000], ["Listbox", 3_400], ["OpenList", 2_500], ["NoticeBar", 2_000], ["SearchTrigger", 5_500], ["SearchResult", 2_000], ["Drawer", 18_300]]) { test(`${name} alone, with splitting, loads only its own static graph (${limit} bytes at most)`, async () => { const { bytes, chunks, inputs } = await graph(name); assert.ok(bytes < limit, `${name}: ${bytes} bytes in ${chunks} chunks (limit ${limit})`); @@ -98,7 +103,7 @@ for (const [name, limit] of [["Spinner", 2_500], ["Sparkline", 6_000], ["Skeleto // cimip-gaps-2 B5 (DECISIONS 246: trim first, then the raise a feature needs): every modal lays itself out above an on-screen keyboard (the shared // watcher, screen-keyboard.ts, trimmed to about 2.4 KB), so SearchDialog rose from about 87,300 to 88,162; merged with main (5ad5345a), whose own // changes added about 490 bytes, it measures 88,683, so its limit is 88,700. -for (const [name, limit] of [["SheetHeader", 82_000], ["SearchDialog", 88_700]]) { +for (const [name, limit] of [["SheetHeader", 82_000], ["SearchDialog", 89_200]]) { test(`${name} alone, with splitting, loads Base UI's dialog and the close button and no command panel (${limit} bytes at most)`, async () => { const { bytes, inputs } = await graph(name); assert.ok(bytes < limit, `${name}: ${bytes} bytes (limit ${limit})`); @@ -110,7 +115,7 @@ for (const [name, limit] of [["SheetHeader", 82_000], ["SearchDialog", 88_700]]) // OptionChips 37,699 (Base UI's radio group), LinkTabs 140,720 (it carries the Select under 720, DECISIONS 154 A15: Base UI's select and its popup), LinkTab 649 (3,898 once its label takes ChosenLabel, the selected state a Tab's children take: join 2 in integration-nov15b, DECISIONS 138 A, 145, 149; the limit is the measured bytes rounded up to the next 50), TabsPanels 519, useConfirm 399, CONFIRM_MS 185; the limits sit just above. // cimip-gaps-2 B6 (DECISIONS 246: trim first, then a raise the feature needs): LinkTabs carries the Select, and `Select toolbar` (the unseen labels that hold its width) adds 212 bytes // after a 67-byte trim (no attribute, no class on the labels): measured 141,669, from main's 141,457, so the limit goes from 141,500 to 141,700. -for (const [name, limit, baseUi] of [["TextButton", 10_600, true], ["SwitchRow", 25_500, true], ["SwitchRowGroup", 11_600, true], ["OptionChips", 38_400, true], ["LinkTabs", 141_700, true], ["LinkTab", 3_900, false], ["TabsPanels", 900, false], ["useConfirm", 800, false], ["CONFIRM_MS", 400, false]]) { +for (const [name, limit, baseUi] of [["TextButton", 10_700, true], ["SwitchRow", 25_500, true], ["SwitchRowGroup", 11_600, true], ["OptionChips", 38_400, true], ["LinkTabs", 142_100, true], ["LinkTab", 3_900, false], ["TabsPanels", 900, false], ["useConfirm", 800, false], ["CONFIRM_MS", 400, false]]) { test(`${name} alone, with splitting, loads only its own static graph (${limit} bytes at most)`, async () => { const { bytes, chunks, inputs } = await graph(name); assert.ok(bytes < limit, `${name}: ${bytes} bytes in ${chunks} chunks (limit ${limit})`); @@ -358,7 +363,7 @@ test("command-panel.js keeps Phosphor's full MIT notice as a preserved legal com // page change, and swipes upward under 720 where it hangs from the bar; ToastProvider measures 93,451, so its limit is 93,500. // The full-run fix (DECISIONS 246): a control that is not disabled no longer writes aria-disabled="false" (a toolbar passes its own false through), 4 // bytes in Button and IconButton: NotificationCentre 152,550 measured, so its limit is 152,600. -for (const [name, limit] of [["ToastProvider", 93_500], ["useToast", 4_000], ["NotificationCentre", 152_600]]) { +for (const [name, limit] of [["ToastProvider", 93_500], ["useToast", 4_000], ["NotificationCentre", 152_700]]) { test(`${name} alone stays lean and loads no Shiki, cmdk or grammar`, async () => { // The static graph under splitting: what loads first. A control's glyph engine loads on demand and is not in it (and has a limit of its own, below). const { bytes, inputs } = await graph(name); @@ -369,7 +374,7 @@ for (const [name, limit] of [["ToastProvider", 93_500], ["useToast", 4_000], ["N // The toolbar (DECISIONS 135): Base UI's toolbar and its roving focus, the direction provider, and Basalt's own controls as items, so // the whole set weighs what its Button, Input and Link do plus the toolbar. The root alone is 23,575 bytes; every part, 53,764. Combined in integration-nov15b: the controls batch's Button (DECISIONS 154) and the links batch's Link arrow (DECISIONS 152) both ride in the set, which measures 56,008, over the 56,000 each side kept, so the limit was 56,050 (the measured bytes rounded up to the next 50); DECISIONS 221 raised it to 56,350 for the glyph morphs' shell in Button and IconButton. -for (const [name, limit] of [["Toolbar", 25_000], ["Toolbar, ToolbarButton, ToolbarIconButton, ToolbarLink, ToolbarInput, ToolbarGroup, ToolbarSeparator", 58_650]]) { +for (const [name, limit] of [["Toolbar", 25_000], ["Toolbar, ToolbarButton, ToolbarIconButton, ToolbarLink, ToolbarInput, ToolbarGroup, ToolbarSeparator", 58_750]]) { test(`${name.length > 10 ? "Every toolbar part" : name} stays small and loads no Shiki, cmdk or grammar (${limit} bytes at most)`, async () => { const { bytes, inputs } = await graph(name); assert.ok(bytes < limit, `${name} bundle is ${bytes} bytes (limit ${limit})`); @@ -389,7 +394,7 @@ for (const [name, limit] of [["DescriptionList, DescriptionItem", 1_500], ["Stat // The panels, art and parts (DECISIONS 162): the app tile, the captioned columns and the table call are plain markup, so they load no Base UI, no Phosphor and no Shiki; // the period stepper is two IconButtons, a status line and the core chevrons, so it carries a Button and nothing else of Base UI. -for (const [name, limit, plain] of [["AppTile", 1_500, true], ["CaptionedColumns, CaptionedColumn", 1_000, true], ["TableCall", 800, true], ["PeriodStepper", 17_950, false]]) { +for (const [name, limit, plain] of [["AppTile", 1_500, true], ["CaptionedColumns, CaptionedColumn", 1_000, true], ["TableCall", 800, true], ["PeriodStepper", 18_050, false]]) { test(`${name} alone is small and loads no Shiki or cmdk${plain ? ", no Base UI and no Phosphor" : ""} (${limit} bytes at most)`, async () => { const { bytes, inputs } = await graph(name); assert.ok(bytes < limit, `${name} bundle is ${bytes} bytes (limit ${limit})`); @@ -487,7 +492,7 @@ test("LoopsToggleIcon alone loads the icon button and the hold, and not Switch", // cimip-gaps-2, B7: `useReveal` takes `focusFirst` (a group's entries follow its row, so a keyboard open keeps focus there), 6 and 8 bytes: Reveal // 19,600 to 19,650 (19,606 measured) and DirectoryList 20,000 to 20,050 (20,008). The full-run fix (no aria-disabled="false" on a control that is // not disabled, DECISIONS 246): CopyButton 18,551 measured, 18,550 to 18,600. -for (const [name, limit, base] of [["LinkCard", 6_500, false], ["LinkTile", 6_000, false], ["BackLink", 5_500, false], ["BigLinkList", 1_000, false], ["BigLinkRow", 6_000, false], ["DirectoryRow", 6_500, false], ["DirectoryList", 20_050, true], ["Reveal", 19_650, true], ["CopyButton", 18_600, true]]) { +for (const [name, limit, base] of [["LinkCard", 6_500, false], ["LinkTile", 6_000, false], ["BackLink", 5_500, false], ["BigLinkList", 1_000, false], ["BigLinkRow", 6_000, false], ["DirectoryRow", 6_500, false], ["DirectoryList", 20_150, true], ["Reveal", 19_750, true], ["CopyButton", 18_700, true]]) { test(`${name} alone, with splitting, loads only its own static graph (${limit} bytes at most)`, async () => { const { bytes, chunks, inputs } = await graph(name); assert.ok(bytes < limit, `${name}: ${bytes} bytes in ${chunks} chunks (limit ${limit})`); diff --git a/packages/react/test/export-sizes.json b/packages/react/test/export-sizes.json index 3e1a4eee..9cdc1d6a 100644 --- a/packages/react/test/export-sizes.json +++ b/packages/react/test/export-sizes.json @@ -8,40 +8,40 @@ "ActivityStep": 27436, "AlertDialog": 69694, "AlertDialogAction": 69695, - "AlertDialogActions": 234, + "AlertDialogActions": 208, "AlertDialogCancel": 69719, - "AlertDialogContent": 74263, - "AlertDialogDescription": 69877, - "AlertDialogTitle": 69890, + "AlertDialogContent": 74638, + "AlertDialogDescription": 69849, + "AlertDialogTitle": 69862, "AlertDialogTrigger": 69874, "AmbientMark": 569, "AppHeader": 1285, - "AppShell": 103887, + "AppShell": 103837, "AppTile": 1112, - "ArchitectureDiagram": 67580, + "ArchitectureDiagram": 67566, "ArrowDownGlyph": 2868, "ArrowLeftGlyph": 2869, "ArrowRightGlyph": 2859, "ArrowUpGlyph": 2867, "Avatar": 11505, "BackLink": 3844, - "BackToTop": 20467, + "BackToTop": 20571, "Badge": 556, "BadgePair": 411, - "BigLinkList": 257, - "BigLinkRow": 4708, + "BigLinkList": 229, + "BigLinkRow": 4683, "Bones": 9174, "BrandSvg": 1084, "Breadcrumbs": 5584, - "Button": 17519, + "Button": 17625, "CONFIRM_MS": 31, "COPIED_MS": 35, "CSPProvider": 449, "CalendarGlyph": 2974, - "Callout": 11777, + "Callout": 11751, "CaptionedColumn": 350, "CaptionedColumns": 285, - "Card": 488, + "Card": 463, "CardContent": 247, "CardDescription": 249, "CardFooter": 246, @@ -54,58 +54,58 @@ "ChevronLeftGlyph": 2846, "ChevronRightGlyph": 2836, "ChevronUpGlyph": 2844, - "ChoiceCard": 4424, + "ChoiceCard": 4398, "ChoiceCardGroup": 294, "Clock": 2921, "CloseGlyph": 2836, - "CodeBlock": 23128, + "CodeBlock": 23206, "Columns": 265, "ColumnsItem": 257, - "Combobox": 164582, + "Combobox": 164834, "CommandBlock": 4923, - "CommandList": 33063, - "CommandMenu": 86834, - "Composer": 51970, - "CopyButton": 18441, + "CommandList": 33141, + "CommandMenu": 87313, + "Composer": 52202, + "CopyButton": 18545, "CopyGlyph": 2884, "Countdown": 3016, "CoverageStrip": 1570, - "DataFlowDiagram": 67597, + "DataFlowDiagram": 67583, "DateAge": 2527, "DescriptionColumns": 216, "DescriptionItem": 593, "DescriptionList": 326, "Dialog": 70793, - "DialogActions": 234, - "DialogClose": 69690, - "DialogContent": 76259, - "DialogDescription": 69877, - "DialogTitle": 69890, - "DialogTrigger": 69869, - "DirectoryList": 19902, + "DialogActions": 208, + "DialogClose": 69662, + "DialogContent": 76634, + "DialogDescription": 69849, + "DialogTitle": 69862, + "DialogTrigger": 69841, + "DirectoryList": 20006, "DirectoryRow": 5065, "DisclosureRow": 24902, "DotLine": 584, "DotSep": 337, "DownloadGlyph": 2853, - "Drawer": 18070, - "DrawerSection": 1884, - "DrawerTrigger": 17689, + "Drawer": 18174, + "DrawerSection": 2043, + "DrawerTrigger": 17795, "ENTRANCE_LATE_MS": 26, "EditGlyph": 2915, "Elapsed": 2591, "EmptyState": 942, "EventLine": 1689, "EventLog": 1180, - "EventLogRule": 501, - "EventText": 426, - "EventTime": 756, + "EventLogRule": 460, + "EventText": 385, + "EventTime": 715, "ExternalGlyph": 2830, "Field": 27244, "Fieldset": 6390, "FilterResult": 698, "FilterToolbar": 774, - "FlowchartDiagram": 67546, + "FlowchartDiagram": 67532, "Form": 8730, "FormGrid": 438, "FormGridItem": 628, @@ -115,7 +115,7 @@ "HistoryGlyph": 3004, "HomeGlyph": 2945, "Icon": 384, - "IconButton": 16525, + "IconButton": 16631, "InlineCode": 233, "InlineField": 25894, "InlineFields": 210, @@ -131,20 +131,20 @@ "Link": 5101, "LinkCard": 5040, "LinkTab": 3764, - "LinkTabs": 141116, + "LinkTabs": 141534, "LinkTile": 4463, - "ListBand": 158564, - "Listbox": 3240, - "ListboxGroup": 405, + "ListBand": 158826, + "Listbox": 3215, + "ListboxGroup": 377, "ListboxOption": 4052, - "LivePreview": 46061, + "LivePreview": 46324, "LoadingShape": 11753, "LogFields": 414, "LogLine": 602, "LogSlots": 1588, "LogSummary": 993, - "LoopsToggle": 30286, - "LoopsToggleIcon": 18053, + "LoopsToggle": 30390, + "LoopsToggleIcon": 18159, "MarksRow": 886, "Mention": 342, "MentionPicker": 14028, @@ -154,7 +154,7 @@ "MenuGlyph": 2823, "MenuGroup": 181223, "MenuGroupLabel": 181407, - "MenuItem": 192761, + "MenuItem": 193083, "MenuRadioGroup": 181228, "MenuRadioItem": 181746, "MenuSeparator": 181404, @@ -167,33 +167,33 @@ "MoreGlyph": 2809, "MoreNavGlyph": 2918, "MorphIcon": 6713, - "MultiSelect": 150488, + "MultiSelect": 150592, "Nav": 4774, - "NavGroup": 538, - "NavItem": 110701, - "NoticeBar": 813, - "NotificationCenter": 152005, - "NotificationCentre": 152015, - "NotificationList": 32608, + "NavGroup": 492, + "NavItem": 110677, + "NoticeBar": 788, + "NotificationCenter": 152109, + "NotificationCentre": 152119, + "NotificationList": 32712, "NotificationsGlyph": 3066, - "NumberField": 43934, + "NumberField": 44038, "NumberTicker": 2587, - "OpenList": 2045, - "OpenListGroup": 476, + "OpenList": 2020, + "OpenListGroup": 448, "OpenListRow": 14008, "OptionChips": 37714, "PageRow": 240, "PageSection": 227, "PageSections": 246, "PageWait": 2453, - "Pagination": 21654, + "Pagination": 21758, "PairedArt": 462, "PaneLayout": 1307, - "PanelList": 469, + "PanelList": 444, "PanelRow": 4642, "PauseGlyph": 2819, - "PeriodStepper": 17818, - "PhaseChart": 51249, + "PeriodStepper": 17922, + "PhaseChart": 51250, "PlanGlyph": 2966, "PlayGlyph": 2838, "PlusGlyph": 2825, @@ -206,8 +206,8 @@ "PopoverTrigger": 118936, "Presence": 3623, "ProfileGlyph": 3073, - "ProfileLink": 24979, - "ProfileLinks": 278, + "ProfileLink": 24937, + "ProfileLinks": 233, "Progress": 8727, "Prose": 192, "REFLOW_BOUND": 25, @@ -219,14 +219,14 @@ "ReflowItem": 470, "Refreshing": 1911, "Reserve": 441, - "Reveal": 19500, + "Reveal": 19604, "RoutesGlyph": 3009, "RunsGlyph": 3128, "STATUS_MESSAGE_MS": 26, "SandboxesGlyph": 2963, - "SchemaDiagram": 67494, - "SearchDialog": 88277, - "SearchField": 18301, + "SchemaDiagram": 67480, + "SearchDialog": 88756, + "SearchField": 18405, "SearchGlyph": 3181, "SearchMatch": 248, "SearchPassage": 784, @@ -236,33 +236,33 @@ "SearchTrigger": 3907, "SectionActions": 226, "SectionIntro": 224, - "Segment": 15718, - "SegmentedControl": 19383, - "Select": 140139, + "Segment": 15635, + "SegmentedControl": 19300, + "Select": 140297, "SelectableItem": 26617, "SelectableList": 821, "SelectionBar": 25913, "Separator": 4531, - "SequenceDiagram": 67542, + "SequenceDiagram": 67528, "SettingsGlyph": 3100, "ShareBar": 1411, "Sheet": 70793, - "SheetActions": 234, - "SheetBody": 1682, - "SheetClose": 69690, - "SheetContent": 74552, - "SheetDescription": 69877, + "SheetActions": 208, + "SheetBody": 1841, + "SheetClose": 69662, + "SheetContent": 74927, + "SheetDescription": 69849, "SheetFooter": 234, - "SheetHeader": 79349, - "SheetTitle": 69890, - "SheetTrigger": 69869, + "SheetHeader": 79425, + "SheetTitle": 69862, + "SheetTrigger": 69841, "ShortcutList": 10032, "SingleKeysSwitch": 17082, "SiteBrand": 1302, "SiteFooter": 14780, - "SiteHeader": 178924, + "SiteHeader": 179403, "SiteLockupDefs": 694, - "SiteMenu": 171246, + "SiteMenu": 171725, "SiteNav": 5102, "SiteNavLink": 411, "SiteNavList": 5112, @@ -272,10 +272,10 @@ "SkipLink": 1014, "Slide": 397, "Slider": 38283, - "SocialLink": 38426, + "SocialLink": 38530, "SocialLinks": 434, "SourceStamp": 3895, - "SourceStateWords": 12709, + "SourceStateWords": 12813, "SourcesGlyph": 2938, "Sparkline": 4585, "Spinner": 1509, @@ -284,14 +284,14 @@ "Stats": 314, "StatusBar": 6813, "StatusLine": 504, - "Stepper": 26713, + "Stepper": 27003, "Stream": 283, "StreamArrivedWord": 470, "StreamBlock": 2764, "StreamEntry": 2583, "StreamMessage": 14856, "StreamNote": 2651, - "StreamQuote": 991, + "StreamQuote": 966, "Switch": 16297, "SwitchRow": 24811, "SwitchRowGroup": 10738, @@ -301,15 +301,15 @@ "TRAVEL_MS_PER_PX": 24, "TRAVEL_RUN_LIMIT": 26, "TRAVEL_SHORT_LEG": 26, - "Tab": 40055, + "Tab": 40001, "TabBar": 3501, "TabBarItem": 1859, - "TabBarMore": 91228, - "Table": 8305, + "TabBarMore": 91707, + "Table": 8279, "TableBody": 143, "TableCall": 391, "TableCell": 347, - "TableContainer": 1454, + "TableContainer": 1429, "TableEmpty": 331, "TableHead": 6804, "TableHeadExplainer": 8472, @@ -317,23 +317,23 @@ "TableRow": 215, "TableRowHead": 194, "TableScrollHint": 938, - "Tabs": 37260, - "TabsList": 38844, - "TabsPanel": 36673, - "TabsPanels": 385, - "Terminal": 32267, + "Tabs": 37233, + "TabsList": 38792, + "TabsPanel": 36621, + "TabsPanels": 331, + "Terminal": 32342, "Text": 922, - "TextButton": 10421, - "TextMorph": 4504, - "Textarea": 26941, + "TextButton": 10525, + "TextMorph": 4681, + "Textarea": 27069, "ThemeChoiceControl": 4794, - "ThemeMenu": 206329, - "TimeChart": 48001, + "ThemeMenu": 206433, + "TimeChart": 48002, "ToastProvider": 92989, "Toolbar": 22915, - "ToolbarButton": 31818, + "ToolbarButton": 31922, "ToolbarGroup": 21467, - "ToolbarIconButton": 30830, + "ToolbarIconButton": 30934, "ToolbarInput": 43513, "ToolbarLink": 26715, "ToolbarSeparator": 21471, @@ -341,7 +341,7 @@ "TooltipProvider": 97618, "TrashGlyph": 2906, "TravelSpinner": 2100, - "Tray": 90410, + "Tray": 91050, "TrayRow": 502, "TrendsGlyph": 2924, "VisuallyHidden": 258, @@ -408,12 +408,12 @@ "useSlideDirection": 296, "useStaged": 1042, "useTheme": 1755, - "useToast": 3263, + "useToast": 3211, "useWaitMark": 303 }, "package": { - "bytes": 870189, - "gzip": 288896 + "bytes": 871550, + "gzip": 289491 }, "styles": { "bytes": 382510, diff --git a/packages/react/test/repo-review.test.mjs b/packages/react/test/repo-review.test.mjs index 3aa95f3a..48f8be73 100644 --- a/packages/react/test/repo-review.test.mjs +++ b/packages/react/test/repo-review.test.mjs @@ -113,22 +113,6 @@ describe("LinkTabs", () => { }); }); -describe("CommandList", () => { - test("mounting under Strict Mode leaves focus where it was (the replayed effect is not taken for Back)", async () => { - const { page } = await fixturePage(browser, `const GROUPS = [{ heading: "Go", items: [{ id: "a", label: "Alpha", onSelect: () => {} }, { id: "b", label: "Beta", onSelect: () => {} }] }]; - function App() { const [shown, setShown] = React.useState(false); window.show = () => setShown(true); - return {shown ?

      {c.label}

      } /> : null}
      ; } - ${render("")}`); - try { - await page.locator("#held").focus(); - await page.evaluate(() => window.show()); - await page.locator(".basalt-command-split, .basalt-command").first().waitFor(); - await settle(page); - assert.equal(await page.evaluate(() => document.activeElement?.id), "held"); - } finally { await page.close(); } - }); -}); - describe("scroll stops", () => { test("a drawer body whose only button is hidden is still a keyboard stop, and becomes one again when the button is hidden later", async () => { const LONG = `Array.from({ length: 40 }, (_, i) =>

      Log line {i}

      )`; diff --git a/tools/html-skill/src/modules.json b/tools/html-skill/src/modules.json index f0bf1c10..a75d8c14 100644 --- a/tools/html-skill/src/modules.json +++ b/tools/html-skill/src/modules.json @@ -1,5 +1,5 @@ { - "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page), spinner 650 to 720 (its held rule moved in from loops, so a ring-only page keeps a stored hold), kbd 2900 to 2950, palette 11400 to 11500 and toast 16050 to 16150 (Mod in a palette item's keys is bound as it is drawn, and a toast action's aria-keyshortcuts resolves Mod).", + "$comment": "Which parts of the skill's CSS and JS a page gets. The core is always in. A module is in when the page's body has one of its classes, attributes or tags, matches one of its text patterns, or is named in a comment, and when another module needs it (requires). Modules are added in the order listed here, which is the order of the source files' cascade. classes: every class the module's CSS styles (the test checks them against the CSS and against SKILL.md). budget: the most bytes its minified CSS and JS may reach together. budgets: skillMd (SKILL.md, the context an agent pays: never above what it was), core (the CSS and JS of every page). icons: Phosphor names the module's script draws itself. Raised in the first parity PR (the owner's \"bring up the parity\"): forms (the number-input, search-clear and file-input chrome), disclosure (the native details marker), status (the accent reader and the forced-colours badge border), spinner (a fixed 16px ring), and the new number, range and accent modules. skillMd rose 10555 to 10900 for the new rules (number field, native chrome, the braille rule, the accent). Raised in the second parity PR (popup rows, levels and the segment's pill): segment 1400 to 3700 (the shared sliding pill: its script, 1.5 KB, and its CSS with the pill's two fallbacks), rows 3600 to 4300 (#27's plate-in-a-row geometry, the plate per level, the glide's shared plate and the forced-colours lit row, net of the removed bar), palette 9400 to 11300 (the glide's script, 2.4 KB: it follows the lit row, travels on a pointer, snaps on a key, and fades in place on leaving). The art module (DECISIONS 101 and 104) is the token groups only some pages name, taken out of the core so the core stays under its cap: the chart roles and lengths, the art colours, the aspect ratios and the stage headroom, in both themes (2087 bytes at 2100; it grows only when a token of those groups is added). A page gets it when its body names one of them, a var() in its own style included. The every-module page has no cap of its own (owner, DECISIONS 79): each part is capped, and a page carries only the parts it uses. usage: the most bytes of a module's usage text (src/usage/NAME.md; core.usage for core.md), which compose.mjs --usage prints on demand. It is context an agent pays only for the modules its page uses, so it is capped per part as SKILL.md and the CSS and script are (DECISIONS 79 and 109). Each is set a little above what its text was when the usage moved out of SKILL.md (DECISIONS 109); raising one needs a reason in the PR, and a rise of 40 to 50% is the owner's. textWords: each text pattern said in words, which compose.mjs --usage prints instead of the regular expression (one for each entry of text, in order). builds: modules a module requires whose markup its script writes, so --usage prints a line saying so instead of their usage text (the palette builds its own rows and key chips). The council's clarity check of the usage texts (all three: not yet clear) raised eight caps because the texts gained what an agent had to guess: callout 200 to 700 (the icon and one wrapper div around the title and body as markup, the four status icons, the role React's Callout renders), palette 1100 to 1300 (an item shown whole, keys as an array, keywords), stats 450 to 800 (a snippet of the figures and of the dl), tabs 500 to 650 (the unselected panels), code 250 to 450 (the markup and what each token class means), segment 150 to 300 (a click does not switch it), progress 150 to 350 (the empty span that paints the fill), theme 250 to 400 (leave the button empty), and accent 250 to 300. Topbar went down, 700 to 500, as its build detail was cut. Raised in the usage PR (the council's clarity check): palette 11300 to 11450 (the module grew 11283 to 11448, +165, about 1.5%), for the guard that makes a string `keys` warn and draw no chip instead of throwing in `keys.filter`, which the palette's usage already promised. Round 2 of the clarity check: tabs 650 to 750 (the panel's top space shown in the snippet, and that the script selects a tab on click). Raised in the site-icons and status PR (skill-parity part A, DECISIONS 106 and 107): status 1650 to 1900 (the neutral, pending and running marks, the badge's real border, and the forced-colours disc, net of the red danger word it drops) and its usage 400 to 1000 (every status in words, the word alone, running, forced colours); rows 4300 to 4450 (the profile list's seat rule and the status parts on a lit row) and its usage 300 to 600 (the profile list, with the one mistake: never an empty element for the seat). New: the links module (2671 bytes: the social row, the new-tab arrow's CSS and the script that draws it; budget 2750) and its usage (1746 bytes; cap 1850), which carries the social link, the glyph set, icon only and the new tab. Dropping Regular halves icons.json. Added in the overlay PR (skill-parity-4, batch 7 step 2, DECISIONS 108): the shared plate leaves palette.js for a glide module (the palette, a menu and the notification centre all call it), so the palette's cap went down, 11450 to 9250, and rows 4450 to 3850 (the plate's CSS moved to glide); and the overlay layer comes in as seven modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: popover (the native popup shell), menu, dialog (the dialog and alert dialog), sheet (on every side, the top one the site header's narrow menu), tooltip, toast and notifications (the centre). skillMd is unchanged in its cap (the eight new index lines fit within it); the core is unchanged in bytes. Added in the figures and charts PR (skill-parity-5, batch 7 step 3, DECISIONS 108): four modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: meter (React's Meter, CSS only, 2581 bytes), dlist (the description list, CSS only, 1265), terminal (the code block's transcript: its CSS, 3242, and the script that draws the gutter, the copy button and the replay, 4824) and chart (React's TimeChart and ChartGroup: 7313 of CSS and 23262 of script, which port chart.tsx's scale, layout, lane, labels, sentences, keyboard and table; it needs the art tokens, the table and the kbd chips, and a page without a chart carries none of it). Stats grew for the source line (budget 700 to 850, 798 bytes; its usage 800 to 950, 675 to 899 bytes, +33%, under the owner's 40 to 50%). skillMd is unchanged in its cap (four index lines fit within it); the core is unchanged in bytes. Added in the forms and selection PR (skill-parity-6, batch 7 step 4, DECISIONS 108): six modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: select (React's Select: the native select's closed trigger in every browser and, where `appearance: base-select` is shipped, the styled list with its two-line rows; a small script that says which input lit a row, 7740 bytes before it, choice (Checkbox, Radio, RadioGroup and Switch as styled native inputs; CSS only, with the first-frame rule), choice-card (ChoiceCard; CSS only), toggle (the pressed toggle's plate and check seat on .btn; CSS only), selection (a table's checkbox column: its fixed width and the script that sets aria-selected, the mixed header box and the count) and loops (the page-level hold on every loop with its switch: the held look and the script that stores it). The select's styles left forms, whose budget fell 3650 to 3250. skillMd rose 8621 to the size of its six new index lines, within its cap; the core is unchanged in bytes; compose adds the stored-hold line to the head of a page that has the loops module. Revised in the same PR (the lead's review of the build): the select gains select.js (one row is lit at a time, by whichever of the pointer and the keys moved last), and choice, toggle, selection and loops carry the first-frame rule, so a state a script sets on load (a mixed header box, the stored hold) paints at once with no crossfade. Added in the navigation and layout PR (skill-parity-7, batch 7 step 5, DECISIONS 108): five modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: glyph (Basalt's core glyphs drawn by name, at rest and selected, from a table the build works out from the drawn set; a page carries only the glyphs it names, and the drawing of a core glyph from data-glyph left the sheet module, which draws none now), nav (React's Nav: the sidebar's, the narrow menu's and More's rows, with the shared hugging pill), topbar-nav (the site header's links, one action and narrow menu, built by script from the bar's markup), app-shell (the shell, its sidebar and rail, and the app header) and tab-bar (the phone tab bar). The topbar module became the site header's bar (React's SiteHeader, DECISIONS 108: 56px with its line inside, the 44 by 44 brand target, the narrow-screen buttons, the derived sticky offset), budget 1600 to 3200 because its rules gained the app header's shared smoke, and its usage 500 to 750 (+50%) for the lockup's markup (the links, action and menu are topbar-nav's usage). Glide 3700 to 3950: the navigation's pill is a shape inside the row that the plate follows (about 200 bytes). The core's usage 2000 to 2100 (+5%): h2 is the Section step, the prose column's measure, and a link already 44px tall needs no margin. skillMd rose 9317 to 9863 for five index lines, under its cap; the core CSS grew 38 bytes (the layout tokens replace raw lengths, the gutter is one derived property, h2, .prose and .lead follow foundations) and the core script is unchanged. A module's media query writes %bp-md%, %bp-lg% or %bp-container% and the build substitutes the breakpoint tokens. Added in the tables and filters PR (skill-parity-8, batch 7 step 6, DECISIONS 108): the existing table module gains React's table additions (DECISIONS 95: the row header, \"Not observed\", the row density and the scroll hint with its small script), budget 1400 to 3000 (it was 1134 bytes of CSS; it is 2168 of CSS and 693 of script) and its usage 700 to 950 (+36%); and two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: still-table (React's Table with `columns`: the fixed layout from a colgroup, the whole header cell as the sort button with its reserved seat, aria-sort, the pinned columns and their divider, the empty row; 4767 of CSS and 3264 of script, budget 8200) and filter (React's MultiSelect and FilterResult: the chips, the trigger and checklist with the search band from ten values, Clear held in place, the one debounced result line, and the narrowing of a table by `data-column`; 8240 of CSS and 7978 of script, budget 16400; it needs the popover, glide, glyph and choice modules). The core is unchanged in bytes. skillMd rose 9863 to 10128 for two index lines and the CaretUpDown icon's name, within its cap. Added in the commands PR (skill-parity-9, batch 7 step 7, DECISIONS 103 and 108): one new module a page carries only when it uses it, command-list (React's CommandList: the command panel set in the page, list plus preview, the push; it extends the palette and needs rows, kbd and glide; 5229 of CSS and 8734 of script, budget 14000, usage 2150). Two-line rows come to the existing modules: rows 3850 to 5350 (the described row's grid and description line, the push's chevron: 1481 bytes of CSS, the same rules React's menu rows carry), palette 9250 to 9900 (its rows are one function the list shares, with the description and the two-tier ranking of title matches over keyword and description matches; +636) and its usage 1300 to 1350, rows' usage 600 to 800, and glide 3950 to 4000 (a host that is idle counts as having no lit row, +54). skillMd rose 10128 to 10259 for one index line, within its cap; the core's CSS grew 24 bytes (.split.aside takes size-list-width in place of its raw 20rem: the same 320px, so no pixel moves) and the core script is unchanged. Added in the art PR (skill-parity-10, batch 7 step 8, DECISIONS 104 and 108): two modules a page carries only when it uses them, each with its own cap and usage cap set a little above its size: stage (React's Stage and PairedArt: full-bleed art under the site header, the pull-up by the sticky offset, the headroom, the paired art that follows the page's theme, and the forced-colours and print rules; CSS only, 1179 bytes) and framed-art (React's FramedArt: the figure, its rim and radius, the reserved box, the placeholder and the failed alt, the caption and credit; 2208 bytes of CSS and the 733-byte script that sets the frame's phase); both need the art tokens. The bar stays smoked over a stage: React clears it only over a stage that passed the headroom test helper, and a page has no test run (DECISIONS 108's note), so the skill builds no clear state. skillMd rose 10259 to 10500 for two index lines, within its cap; the core is unchanged in bytes. The callout gained the status rim in the same PR (DECISIONS 82, D8's status callouts): success, warning and danger draw their border in the status colour at 45% mixed in sRGB over the callout's own level, one solid colour on every side, and CanvasText in forced colours with the icon; the status colour is now one property the icon and the rim read. Its budget rose 900 to 1150 (the module is 1089 bytes, from 792: +297, about 37%); its usage is unchanged. Added in the overlays-and-the-rest PR (skill-parity-11, batch 7 step 9, DECISIONS 90 and 108): the last two parts of D8's part 5, each a module a page carries only when it uses it, with its own cap and usage cap set a little above its size: combobox (React's Combobox: the input with its caret button inside, the popup of the menu's rows with the glide's shared plate and two-line options, the filtering, the keys, the hidden value, the empty message and the check; 4342 of CSS and 6423 of script, budget 10900, usage 2150; it needs forms, popover and glide, and builds the last two) and sparkline (React's Sparkline: the label and latest value, the line, the axis, the empty sentence and the loading line that breathes; 1609 of CSS and 1874 of script, budget 3600, usage 950). The combobox copies the menu's row rules, as the select's list does, because React's Combobox renders MenuItem rows (a 40px hit area, a 36px plate) and the skill's .row is the palette's 44px: it carries no menu script. popover.js gains the combobox popup in the list of popups that keep focus where it is (+21 bytes, within its cap). skillMd rose 10500 to 10724 for two index lines, within its cap; the core is unchanged in bytes. Added in the motion-rules PR (DECISIONS 136 and 139): one module, ambient (a page's one ambient loop: CSS 828 bytes, script 433, budget 1300, usage 800), taken out of loops so the hold's own module grows only by the icon toggle's glyph swap (loops 2000 to 2200, +10%; its usage 1300 to 1650 for the icon form and the new settings-row sentence, +27%); and the chart's entrance (`entrance: true`: the marks' animations, their conditions and the redraw that restarts them at the elapsed time, 23262 to 25299 bytes of script; budget 30700 to 32800, +7%, usage 2500 to 2950, +18%). The core grew by the three tokens (27704 to 27862 bytes of CSS, under its cap). its stage usage gained the ambient art's line (1650 to 1750, +6%). skillMd rose 10724 to the size of the ambient index line, within its cap. Raised again in the motion-rules amendment (DECISIONS 143): chart 32800 to 33800 (script 25299 to 26375 bytes, +4%; +10% over the 30700 it began with) for the glide a new data set makes mid-entrance, print settling it, and `Basalt.pageChange()`; its usage 2950 to 3150 (+26% over the 2500 it began with). Raised in the second motion-rules amendment (DECISIONS 148): chart 33800 to 34400 (script 26375 to 26970 bytes: a line and its markers glide from their drawn geometry, and `beforeprint` settles the entrance; +12% over the 30700 it began with); topbar-nav 6900 to 7500 (+8.7%: the narrow menu's pause row, its CSS and 275 bytes of script, DECISIONS 148 item 2); loops usage 1650 to 1800 (+38% over the 1300 it began with, for the icon form's `title` and the menu row). Raised in the audit-design-b PR (DECISIONS 138 and 139): still-table 8200 to 13400 (+63%: the module was 7927 bytes and is 13311; the cut cell's plate, its focus stops and its dismissal, ported from React's cell-peek.ts, are 4273 bytes of script and 1111 of CSS; a still table that truncates needs them). The same PR: core usage 2100 to 2250 (+7%: the skip link, one bullet), forms usage 350 to 480 (+37%: the required mark), still-table usage 1950 to 2150 (+10%: the cut cell and the width rule), notifications usage 1050 to 1100 (+5%: the 44px entry on touch). The skip link's rim and radius took the core 30457 to 30609 bytes, under its cap (the rules that hang it under the bar are the topbar module's: 3200 to 3600, +12.5%); core 30720 to 31050 (+1.1%, DECISIONS 147: also the bar's links left out of the rule: the pseudo-element that makes a short standalone link a 44 by 44 target), skip-link script in the topbar module (3200 to 4150 over this PR, +30%: the rules that hang the link under the bar, 3600, and the script that reads the bar's real edge, 4150), sparkline 3600 to 4050 (+12.5%: React's ticker structure, so the value copies once on its line, and in forced colours the strips go and the number is plain text), forms budget 3250 to 3500 (+7.7%: the necessity word), notifications 9050 to 9250 (+2.2%: the 44px entry). Raised in the audit-design-b PR's E2 port (DECISIONS 138 and 139: the core set draws check, close, the chevrons, copy, plus, minus and search wherever a component draws them): the modules that drew a Phosphor icon for one of those now carry the core glyph's whole SVG, written in at build time (`%glyph-svg:name%`, the markup the glyph module's `_.glyph(name)` returns, so no module needs the glyph module and a page pays for nothing it does not use), and the Phosphor path of the same icon leaves the page. Each module's own bytes rose by that markup, and a page's total moved by what the Phosphor path it no longer carries saves: menu 8600 to 8900 (+303), combobox 10900 to 11200 (+303), copy 1900 to 2400 (+640), terminal 8100 to 8850 (+761), toast 13850 to 14150 (+325), number 2900 to 3400 (+557), filter 16400 to 17050 (+785), palette 9900 to 10450 (+536); the command list shares the palette's search drawing and fell 20 bytes. Set in integration-nov15, where the type-layout, motion-rules and audit-design-b branches meet: the combined tree measured SKILL.md 10959 bytes (each side's cap was 10900: both added index lines), core 31192 bytes (caps 30720 and 31050: the page-row and display rules, the three motion tokens and the skip link and 44px target rules all land in the core CSS) and core usage 2348 bytes (caps 2300 and 2250: type-layout's line and the skip-link bullet), so each is set to the measured bytes rounded up to the next 50: skillMd 10900 to 11000, core 31050 to 31200, core usage 2300 to 2350. Raised in the audit-design PR (decisions 138 and 139, parts A, D and C11): core 30720 to 31600 (+2.9%: the more-contrast block and its three aliases, and the field boundary token, every page carries as React does; the shadow-pill token is gone; the script gained `reserve`, 240 bytes), segment 3700 to 4100 and tabs 2300 to 2700 (the chosen label is 600 against 400, its width reserved by a span that carries its own copy, drawn unseen at 600; the pill's drop shadow is gone), and the segment's usage 300 to 380 (the weight and the glyph-only button). Raised again in the audit-design-a amendment (decision 145): core 31600 to 32300 (reserve() also reserves a label that is not plain text), segment 4100 to 5100 and tabs 2700 to 3500 (the second copy of such a label, and an icon drawn in both its forms), glyph 1100 to 1300 (a glyph in a segment or tab is drawn in both forms). Raised in the second audit-design-a amendment (decision 149): core 32300 to 32800 (reserve() builds the second copy of a label without any id, name, reference or hidden control, and does not copy a frame or media), segment 5100 to 5400 and its usage 380 to 500 (the 600 is on the label, the one-line rule and the usage text); the still-table cap is back at 8200, as the wash is on every cell again. Return 3 of the audit-design-a build (decision 149): tabs 3500 to 3700 (a tab the script has not reserved is 600 itself when selected, and one it declined is marked; the same two lines are in segment, which stays under 5400). Raised in the audit-fix-c2 PR (engineering, no pixel changes): toast 13850 to 14350 (the module was 13789 bytes and is 14288, +499, 3.6%) for F6, which focuses the Notifications region and Shift+Tab or Escape from it (or from the first toast) leaves it for where focus came from (and keeps a dialog's focus trap from wrapping it), as Base UI's viewport does in React, and for placing the region from focus (in the modal that holds it, or in the body), so a toast is never under a backdrop or in an inert modal whatever order the modals opened in (A3-09); the palette module grew 9864 to 9897 of its 9900 so that a palette opened over a modal sits inside it; topbar 3200 to 3250 (3123 to 3233, +110) for the scroll margin on what the bar holds, so a Tab into the bar from a scrolled page does not scroll the page (React's rule from PR #66); stage usage 1650 to 1750 (1580 to 1713, +8%) for the art's new place in the markup, after the content (A1-09), the stage's own CSS rising 1179 to 1208 within its 1250. skillMd rose 10724 to 10876 for the sentence that says a body may carry head tags, within its 10900. compose.mjs, the tool an agent runs, has no cap here (it is never in a page): it grew 21673 to 38153 bytes for the tokenizer that reads a body as HTML does and the head tags. Raised in the site-parts PR (DECISIONS 146, round 39), which folds each new part into the module it belongs with, so SKILL.md gains no index line (it has 41 bytes under its cap and a new module needs about 100): topbar 4150 to 17600 (+13450: the site footer and its disclosures, the lockup by pixel density, and a bar that arrives or leaves and returns, with its observer; a page that has a .topbar and no footer carries them too: the alternative, a module for each, needs its own index line and so SKILL.md bytes) and its usage 950 to 2900 (the footer's markup, the lockup's and the phase's); theme 650 to 4550 (the three-word theme choice: its CSS 2230 bytes and its script, 2277, with arrows, storage and the system listener) and its usage 400 to 1150 (the choice's markup written in full, so the right word is chosen before any script); segment 3700 to 3800 (a radio group's checked state besides a pressed button); stage 1250 to 2150 (its first script, 768 bytes, for fit and anchor) and its usage 1750 to 2000; framed-art 3000 to 3900 (drawn art in the frame: fit, anchor, no scaling strokes) and its usage 1250 to 1400. SKILL.md rose 10959 to 10992 (the topbar and theme index lines name .site-footer and .theme-choice). The head's theme line also writes data-theme-choice. Raised in site-parts return 2 (DECISIONS 146 B1 and B4): theme 4550 to 5350 (+800: the icon form of the theme choice, [data-theme-menu], whose button shows the theme in use, is named for the choice and opens the page's own .menu of three radio rows, in the theme script's 3073 bytes; the menu and popover modules are the page's, brought by its markup, so no module line was added and SKILL.md is 10993 of 11000) and its usage 1150 to 2200 (+91%: the menu's markup is written in full, and the deprecated toggle is said once); app-shell usage 2000 to 2100 and topbar-nav usage 1900 to 1950 (the theme control leaves the bar's text; the tools and the end cluster come in). The two example bodies still carry the deprecated data-theme-toggle. Return 2, F3 (DECISIONS 146 F): stage 2150 to 2250 (script 842 bytes: slice is the stage's default, as a frame's, and a drawing's own preserveAspectRatio stands unless the stage names data-fit or data-anchor) and its usage 2000 to 2150. framed-art 3900 to 4000 (a drawing's own preserveAspectRatio stands unless the figure names data-fit or data-anchor, +101 bytes). Return 3: theme 5350 to 5900 (script +569 bytes: who wrote data-theme, so System follows the system's change live and a theme the page set by hand, or a .dark or .light root, survives it). Raised in the controls port (DECISIONS 154): skillMd 11000 to 11200 for two index lines (link-tabs and option-chips, 214 bytes together), and core 31200 to 31600 for the nine tokens the port adds to every page's token CSS (the control rungs 44 to 64, two container widths, the confirm hold and the amount's opacity, 311 bytes). New modules (DECISIONS 154): link-tabs 2700 (its sizes, the 640 container step, the forced-colours underline, and the select that replaces the row under 720 with its 590-byte script, A15; it requires the select module), option-chips 5700 (the chip's states each written for a native radio inside a label, which needs :has on every one, plus the 1 KB script that keeps an aria-disabled chip reachable and never chosen). Return 3 (DECISIONS 154 conformance): link-tabs 2700 to 3100 and its usage 1650 to 1850 (the select's height for each row size, and a script that reads aria-current when it is needed and watches it move: 3,048 bytes), option-chips 5700 to 6700 (each state written twice, as a state attribute and as :has(), so no browser needs :has(): 4,975 CSS and 1,623 script). Return 4 (DECISIONS 158, Q2): link-tabs 3100 to 4300 and its usage 1850 to 2400 (the \"Go to\" label drawn at the select's start with its measured clearance, the select's accessible name kept as the words and the chosen page's, and the key hold that keeps a letter or an arrow on the closed select from navigating: 4,174 bytes, CSS 2,951 and script 1,223). Raised in the links-and-rows port (DECISIONS 152; the owner's approval is the lead's to confirm): the new link-rows module (5050 bytes of CSS, 50 of them for Castle's big-row arrow stepping colour over duration-fast, return 1, 1500 of usage: the directory's and the big rows' CSS, whose arrow is a core glyph drawn as a mask, and their tokens, size-row taken out of the core like type-layout's), disclosure 1550 to 3500 (Show all: the track, the clip and the settle, 1.5 KB of script and 1.8 KB of CSS), copy 2400 to 3500 (the form with words: the one cell and its script). SKILL.md rose 10959 to 10997 for one line, within its 11000 cap. Raised in the charts port PR (DECISIONS 153, D7a): chart 34400 to 34650 (script 26970 to 27270 bytes, +1.1% on the 34283 it was: `Basalt.trailingMean`, the trend maths React exports as `trailingMean`, 300 bytes), its usage 3150 to 3350 (+6%: one line for it). The tokens the batch adds (chart-lit-top, -mid and -base in both themes, size-chart-plot-sm, size-chart-row, size-meter-marker and radius-2xs) took the art module 2087 to 2546 bytes (budget 2100 to 2600, +24%: the chart tokens are its group) and the core 31192 to 31250 (cap 31200 to 31300, +0.3%: radius-2xs). Only D7a names a skill module in the charts ballot; the lit marks, the headline frame, the phase chart, the share bar, the coverage strip, the marks row and the range meter are React-only in this batch. Added in the overlays-and-search PR (DECISIONS 155, D10b and D13a): the sheet gains React's head, body and foot (the 44px close, the 20/28 title over a 13px count, the divider and the safe areas; its CSS 3.6 to 5.2 KB, budget 4050 to 5250, +30%) and its usage 1050 to 1450 (+38%: the anatomy and the step's focus, two bullets); and one new module a page carries only when it uses it, search (React's SearchDialog: the form, the field's -2 outline, the count line, the fixed-height results area and the rows with their picture slots and full-bleed hover wash; CSS only, 4368 bytes, budget 4400, usage 2050; it requires the dialog). The dialog's title draws no ring when script focuses it. skillMd rose 10959 to 11079 for the search line (the sheet's line is unchanged: its usage carries the anatomy), so its cap rose 11000 to 11100 (+0.9%). The core's CSS grew 31192 to 31421 bytes for the six new size tokens (the wide dialog, the search trigger and the logo and picture slots of a search result): its cap rose 31200 to 31450 (+0.8%). The two 44px values (the sheet's close and the search field) are local to their modules, with a lint exception that says they join the controls batch's size token (DECISIONS 154). Set in integration-nov15b, where audit-design-a, audit-fix-c2, site-parts, port-controls, port-links-rows, port-charts and port-overlays-search meet: the combined tree measured SKILL.md 11560 bytes (the caps were 11000, 11100 and 11200: each side added index lines), core 34086 bytes (caps 31300 to 33550: every side's rules land in the core CSS and script), topbar 17660 (17600 from site-parts, plus audit-fix-c2's skip-link and focus work), number 3453 (3400), palette 11379 (11000, audit-fix-c2's hosted scrim plus the core search glyph), dialog 5120 (5100), toast 15692 (15400) and stage usage 2248 (2150), each over every side's cap, so each is set to the measured bytes rounded up to the next 50: skillMd 11200 to 11600, core 33550 to 34100, topbar 17600 to 17700, number 3400 to 3500, palette 11000 to 11400, dialog 5100 to 5150, toast 15400 to 15700, stage usage 2150 to 2250. The segment cap is the base's 5400 plus port-controls' 100 (5500), unchanged by the merge. Raised in integration-nov15b, join 2 (a link tab takes the selected state, DECISIONS 138 A, 145, 149 and 154's D12 row): link-tabs 4300 to 5750 (+34%: the module was 4174 bytes and is 5736; the 600 against 400, the reserved width and the second copy of a composed label, an icon drawn in both its forms, the same rules a tab carries, 1,530 bytes of CSS and script) and its usage 2400 to 2550 (+6%: one bullet). The cap is the measured bytes rounded up to the next 50; a module that needs the tab's rules carries them as the segment and tabs modules do, so a page without link tabs pays nothing. Raised in the panels, art and parts port (DECISIONS 162): table 3000 to 3150 and its usage 950 to 1450 (the flat form and the two-line cell), stage 2250 to 2600 and its usage 2250 to 3100 (the closing block: its held art, forced colours and print; its section gap is type-layout's --basalt-section-gap, which a page with data-closing brings), the new app-tile 4300 (a 120-point polygon clip and the hairline's mask of the same outline), captioned 2000 and period 1400; skillMd 11600 to 11950 for one index line each for captioned, app-tile and period (358 bytes; the file is 11918). Raised in the logs, status and forms port (DECISIONS 162): core 34100 to 34200 (the new size-field-label-inline token, 80px, is written into every page's tokens: 25 bytes); dlist 1300 to 1900 and its usage 950 to 1060 (the stacked form, R9 and R10: a title over its text, 20px between entries, no divider; one usage line). Raised in audit-fix-c6 (the owner's cap, raised by the builder and for the owner to confirm): glyph 1300 to 1900, for redrawing a glyph when its ancestor's aria-current or data-current moves (the lists that hold glyphs are watched). Raised in the colour-ink-ladder build (DECISIONS 166): core 34200 to 34350 (the four lifted dark inks are four new primitives, each written into every page's tokens: the core measured 34307). Raised in the audit-2-design build (DECISIONS 167, Q7a): disclosure 3500 to 3800 (the core chevron drawn as a mask in place of two borders: the module measured 3755). Joined in the integration of c7 (#86) and c10 (#91): option-chips 6750 to 6850 (c7's reset resync and c10's data-ready together measure 6839). Raised in table-sort-3 (DECISIONS 257 and 261, the owner's pick: three sort states, the arrow after the label, explainers on column titles): still-table 13400 to 14650 (+9.3%: the module was 13343 bytes and is 14602; the end-aligned label's move by a transform, its right-to-left sign and the indicator that waits for it on a fine pointer, 912 bytes of CSS; the third state, the sort from the table's own order and a .explainer kept out of the button, 347 bytes of script) and its usage 2150 to 2250 (2197: the third state and the own order); the new explainer module 5850 (5842: a manual native popover opened from the sort button on hover, keyboard focus and a long press, placed above the header or beside it, 1752 bytes of CSS and 4090 of script; a page without explainers pays nothing) and its usage 900; skillMd 12250 to 12400 for the explainer's index line (113 bytes; the file is 12352). Each cap is the measured bytes rounded up to the next 50. Raised in table-sort-3's fix pass (Astra's review): explainer 5850 to 6900 (+18%: 5842 to 6864 bytes; the gap between the header and the card kept while a pointer crosses it, the close when its header leaves the view whatever has focus, the dismissal held until pointer and focus have both left, and its page-wide listeners and timers scoped to an open card and stopped when the table leaves the page, 1,022 bytes of script). Raised in cimip-gaps-2 batch B5 (the touch sizes under 720 whatever the pointer: each coarse-pointer target rule also answers a window under 720, about 20 bytes a rule; forms merged its three into one and stays under 3500): select 9000 to 9100 (measured 9064), selection 1480 to 1500 (1486), filter 17450 to 17500 (17473), option-chips 6850 to 6900 (6853), menu 8900 to 8950 (8902). B5 fix pass 1 (Astra): core 34550 to 34950 (measured 34911: 30762 CSS and 4149 JS) for stacked links in a column, each giving up the side of its 44px box that meets a neighbour, so a tap on a link's words is always that link's; core had 12 bytes free. DECISIONS 274 (the owner's pick: under 720 the toast stack hangs from the bar): toast 15700 to 16050 (measured 16035; 8 bytes were free; the stack's direction became one sign variable, trimming 585 of the 920 bytes the phone form first took). B5 merged with main (5ad5345a): main's own core measured 34930 against its 34550 cap before B5; with B5 (the touch sizes under 720 and stacked links in a column) it is 35331, so core is 35350; nav 5350 to 5400 (measured 5364: B4's nav plus the touch size under 720). The full run after the stream (DECISIONS 246): the site footer's links keep their own flex column under 720, as React's, out of the bare-link touch rule (26 bytes), so core is 35400 (measured 35357); sheet 5250 to 5400 (measured 5368: React's B5 ring room, ported: the held actions reach space-1-5 above their band, clipped, and the body keeps space-1-5 at each end). Raised for diagram motion and service marks (DECISIONS 292): skillMd 12550 to 12650 for the diagram-motion module's one line; diagram 87200 to 91000 for what a still diagram now carries (a card's mark and its seat, the pending frame, the comparison that writes a drawing only when it changed, and the print rule), and its usage 2600 to 4300 for the decision's four lines and the list of mark ids; the new diagram-motion module (the motion engine, its stylesheet and the motion tokens, in a page only when a diagram is animated) at 26200. Raised when the diagram tests were first run (DECISIONS 298): diagram 91000 to 91250 and diagram-motion 26200 to 26850. Raised in batch A of the diagrams backlog (DECISIONS 301): diagram 91250 to 92400, for the engine fixes it bundles (a decision kept no taller than it is wide, labels on whole pixels, slots beside a straight line, a one-column schema's turn-back); the skill keeps the development checks a production React build now drops. Raised again in that batch's review fixes: diagram 92400 to 92650, for the drawn layout refusing two lines laid on one another (Neon's blocking finding 1 on #126). Fix round 1 of #124 had already taken them to 91205 and 26621 with the tests unrun; this round added 1 byte (every focal node prints its fill; a one-form mark's dark form falls back to its light one) and 180 (the entrance keeps its own clock when it is drawn again while paused). Raised in the repo review (23 Nov 2026; budgets are soft, the owner's word): notifications 12450 to 12700 (a link is written only when relative, http, https or mailto, and side and align are checked before they reach the markup), combobox 11200 to 11350 (a disabled field's hidden input is disabled too, now and later), tooltip 3200 to 3550 (the gap to the opener is the tooltip's own, and hover and keyboard focus each hold it open; WCAG 1.4.13), chart 34750 to 34800 (the scale's step search and gridlines are bounded, so extreme values cannot hang the page), spinner 650 to 720 (its held rule moved in from loops, so a ring-only page keeps a stored hold), kbd 2900 to 2950, palette 11400 to 11500 (and its usage text 1350 to 1400, for the Mod line) and toast 16050 to 16200 (Mod in a palette item's keys is bound as it is drawn, and a toast action's aria-keyshortcuts resolves Mod).", "budgets": { "skillMd": 12650, "core": 35400 @@ -857,7 +857,7 @@ ], "budget": 11500, "budgetReason": "audit-fix-c2 Sol build: 9897 to 10801 bytes (+904); hosted top-layer scrim, logical-host cleanup, scoped keys and the modal depth reset preserve the original page painting and explicit inertness, escape sheet clipping and allow dialogs above the palette. Cap 9900 to 10801. Return 1: 10801 to 10843 bytes (+42) for pointer focus on the panel without a ring and modal-only hosting; cap 10801 to 11000, leaving 157 bytes.", - "usage": 1350, + "usage": 1400, "textWords": [ "a call to Basalt.openPalette or Basalt.closePalette", "palette: inside a Basalt.init call" @@ -1160,7 +1160,7 @@ "Warning", "XCircle" ], - "budget": 16150, + "budget": 16200, "budgetReason": "audit-fix-c2 Sol build: 14288 to 14780 bytes (+492); observe focus before the first toast, retain the last live modal on blur, release the viewport before modal closure, preserve real keyboard composition state and keep a toast action's Escape from cancelling its native host. Cap 14350 to 14780. Return 1: 14780 to 14866 bytes (+86) for ordinary reverse Tab, clearing stale F6 returns and observing mutations only while hosted; cap 14780 to 15100, leaving 234 bytes. Return 3 and DECISIONS 156: 15031 to 15367 bytes (+336) for distinct pointer/keyboard focus restoration and the front-toast control ring while the region holds focus. Cap 15100 to 15400 (+300), leaving 33 bytes.", "usage": 1100, "builds": [ diff --git a/tools/html-skill/src/modules/toast.js b/tools/html-skill/src/modules/toast.js index 4623fc1c..1db217dd 100644 --- a/tools/html-skill/src/modules/toast.js +++ b/tools/html-skill/src/modules/toast.js @@ -223,7 +223,7 @@ '

      ' + _.esc(o.title) + (t.count > 1 ? ', ' + t.count + ' times' : '') + '

      ' + '

      ' + _.esc(o.description || '') + '

      ' + - (o.action ? '' : '') + + (o.action ? '' : '') + ''; var action = t.content.querySelector('.toast-action'); if (action) action.addEventListener('click', function () { o.action.onClick(); }); diff --git a/tools/html-skill/src/modules/tooltip.css b/tools/html-skill/src/modules/tooltip.css index d5d4f9f4..7b4d47bd 100644 --- a/tools/html-skill/src/modules/tooltip.css +++ b/tools/html-skill/src/modules/tooltip.css @@ -20,8 +20,9 @@ overflow: visible; } .tooltip:popover-open { display: flex; } - /* The 6px between the opener and the tooltip is the tooltip's own, unseen: a pointer moving slowly onto it never crosses the page on the way (WCAG 1.4.13). */ - .tooltip::before { content: ""; position: absolute; inset: calc(-1 * var(--basalt-space-1-5)); z-index: -1; } + /* The 6px between the opener and the tooltip is the tooltip's own, unseen: a pointer moving slowly onto it never crosses the page on the way (WCAG 1.4.13). + 8px from the padding box: the gap, the 1px rim and the entrance's .98 scale. */ + .tooltip::before { content: ""; position: absolute; inset: calc(-1 * var(--basalt-space-2)); z-index: -1; } /* stylelint-disable-next-line unit-disallowed-list -- a zero duration that duration-instant would write: the token takes this module 16 bytes over its own cap (3,200, modules.json), and raising a cap is the owner's */ .tooltip[data-instant] { transition-duration: 0ms; } .tooltip .kbd-group { margin-inline-start: var(--basalt-space-2); } From fb80deffb818a2f02cde1727a90a12e3a9e2d858 Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:05:56 -0600 Subject: [PATCH 13/13] The safe-sinks rule: data is drawn as text, and a destination is checked Decided by the owner with Fable and Astra (two rounds) and Muse Wonder Full as tie-breaker, 23 Nov 2026: a syntax-tree check, a per-file ledger for the HTML skill, a fixed base for safeHref, tel allowed, tools/review in scope, composed page bodies not linted. - AGENTS.md rule and Checks row; SKILL.md line; core usage; React README. - safeHref (relative, http, https, mailto, tel; the string or null; a fixed base) exported from the React package and published as Basalt.safeHref, with _.pick; esc escapes the apostrophe. Palette and notifications use core's; LinkTabs (React and skill) checks before onNavigate or the navigate event hears of a link. - Diagram marks are a relative path, https or a data: image; cssUrl escapes \r and \f. compose lists a javascript: link in a body. - scripts/check-sinks.mjs (oxc-parser, a new dev dependency the owner chose): HTML sinks, unchecked navigation and postMessage to any origin; reasons in sink: comments or tools/html-skill/src/sinks.allowed.json. A lint step. - oxlint: no-new-func, no-script-url, react/jsx-no-script-url, react/no-danger, react/jsx-no-target-blank, react/iframe-missing-sandbox, unicorn/require-post-message-target-origin; every hit reasoned or fixed. - The modal guard looks only at nodes added later and never at a portal or the toasts (it had made a second modal's controls inert). - Tests: one URL table for both runtimes, planted failures and passing twins for every sink kind and oxlint rule, the ledger's data-taking files in the hostile probe (a diagram added to it), both LinkTabs refusing. - Budgets (soft, recorded): skillMd 12900, core 35650, core usage 3200, link-tabs 5900, diagram 93000; React limits LinkTabs 142150, SearchDialog 89550; size table regenerated. Co-Authored-By: Claude Opus 5.5 --- .agent/skills/basalt-html/SKILL.md | 2 + .agent/skills/basalt-html/compose.mjs | 6 +- .agent/skills/basalt-html/parts/core.js | 2 +- .agent/skills/basalt-html/parts/diagram.js | 4 +- .agent/skills/basalt-html/parts/link-tabs.js | 2 +- .agent/skills/basalt-html/parts/manifest.json | 12 +- .../skills/basalt-html/parts/notifications.js | 2 +- .agent/skills/basalt-html/parts/palette.js | 2 +- .agent/skills/basalt-html/parts/usage/core.md | 2 +- .oxlintrc.json | 9 + AGENTS.md | 13 +- package-lock.json | 395 ++++++++++++++++++ package.json | 1 + packages/react/README.md | 8 + packages/react/src/brand-svg.tsx | 2 + packages/react/src/diagram-core.ts | 27 +- packages/react/src/diagram-figure.tsx | 1 + packages/react/src/index.ts | 1 + packages/react/src/link-tabs.tsx | 10 +- packages/react/src/modal-outside.ts | 20 +- packages/react/src/safe-href.ts | 15 +- packages/react/test/bundle.test.mjs | 7 +- packages/react/test/export-sizes.json | 35 +- packages/react/test/repo-review.test.mjs | 31 ++ scripts/check-sinks.mjs | 258 ++++++++++++ scripts/lint.mjs | 3 +- sites/shared/site-header.js | 3 + tools/html-skill/src/compose.mjs | 6 +- tools/html-skill/src/core.js | 14 +- tools/html-skill/src/modules.json | 12 +- tools/html-skill/src/modules/link-tabs.js | 4 +- tools/html-skill/src/modules/notifications.js | 13 +- tools/html-skill/src/modules/palette.js | 8 +- tools/html-skill/src/sinks.allowed.json | 27 ++ tools/html-skill/src/usage/core.md | 2 +- tools/html-skill/test/html-skill.test.mjs | 4 +- tools/html-skill/test/sinks.test.mjs | 135 ++++++ tools/html-skill/test/support-hostile.mjs | 5 + tools/review/round20.tsx | 8 +- tools/review/round28.tsx | 1 + tools/review/round32.tsx | 2 + tools/review/round34.tsx | 3 + tools/review/round35.tsx | 3 + tools/review/round36.tsx | 2 + tools/review/round39.tsx | 6 + tools/review/round47.tsx | 2 + 46 files changed, 1043 insertions(+), 87 deletions(-) create mode 100644 scripts/check-sinks.mjs create mode 100644 tools/html-skill/src/sinks.allowed.json create mode 100644 tools/html-skill/test/sinks.test.mjs diff --git a/.agent/skills/basalt-html/SKILL.md b/.agent/skills/basalt-html/SKILL.md index 6f9b321a..5adfe216 100644 --- a/.agent/skills/basalt-html/SKILL.md +++ b/.agent/skills/basalt-html/SKILL.md @@ -14,6 +14,8 @@ Standalone HTML that looks and behaves like Basalt: one file, no network, dark a 3. Run `node .agent/skills/basalt-html/compose.mjs report.body.html` (writes `report.html`; `--out ` names it). It wraps the body in the doctype, meta and theme bootstrap, inlines Geist, and adds the core CSS and script plus only the modules your classes, attributes and tags use, and the icons you name in quotes. It prints what it added, and one warning line for each module added. `--no-fonts` skips Geist (only for a file a tool reads, never a file a person opens), `--lang fr` sets the language, `--all` adds every module. 4. Open the page in both themes at 1440 and 390 wide before you hand it over. It follows the system theme; the toggle or `Basalt.toggleTheme()` switches it. +**Data you did not write** (a file, an API, a user) goes in as `textContent`; a link from it passes `Basalt.safeHref` (relative, http, https, mailto, tel); an option comes from a fixed list. Never into markup, a `", "vbscript:x", "file:///etc/hosts"]; for (const href of hrefs) { @@ -368,7 +368,7 @@ describe("the palette", () => { assert.equal(page.url(), "https://basalt.test/", href); } assert.equal(errors.length, hrefs.length); - assert.ok(errors.every((e) => /palette link must be relative, http, https or mailto/.test(e)), errors.join("\n")); + assert.ok(errors.every((e) => /palette link must be relative, http, https, mailto or tel/.test(e)), errors.join("\n")); await context.close(); // Each allowed link gets its own page, and the test waits for the navigation that link starts. One shared page went // back with goto while a relative link's navigation could still be in flight, which a slow runner turned into an diff --git a/tools/html-skill/test/sinks.test.mjs b/tools/html-skill/test/sinks.test.mjs new file mode 100644 index 00000000..782e8f30 --- /dev/null +++ b/tools/html-skill/test/sinks.test.mjs @@ -0,0 +1,135 @@ +// The safe-sinks rule (AGENTS.md, "Data is drawn as text, and a destination is checked"; decided 23 Nov 2026 by the owner, Fable, Astra and Muse): one URL +// table run against both safeHrefs, the sink check's planted failures and passing twins, oxlint's sink rules on planted files, the ledger's data-taking +// files in the hostile probe, and LinkTabs refusing before anything hears of a link. Synthetic data only. +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import fs from "node:fs"; +import path from "node:path"; +import { after, before, describe, test } from "node:test"; +import { pathToFileURL } from "node:url"; + +import { compose } from "../../../.agent/skills/basalt-html/compose.mjs"; +import { checkAll, checkLedger, checkSource } from "../../../scripts/check-sinks.mjs"; +import { hostileBody } from "./support-hostile.mjs"; +import { launch, openHtml, repoRoot } from "./support.mjs"; + +let browser; +before(async () => { browser = await launch(); }); +after(async () => { await browser?.close(); }); + +// [input, passes]: a passing value comes back unchanged, a refused one is null. +const URLS = [ + ["javascript:alert(1)", false], ["JavaScript:alert(1)", false], [" javascript:alert(1)", false], ["java\tscript:alert(1)", false], ["data:text/html,x", false], + ["vbscript:msgbox(1)", false], ["blob:https://x.test/1", false], ["file:///etc/hosts", false], ["sms:+15550100", false], ["", false], [" ", false], [null, false], [42, false], + ["//other.example/x", true], ["/x", true], ["?q=1", true], ["#id", true], ["page.html", true], ["mailto:a@b.test", true], ["tel:+1-555-0100", true], ["TEL:+15550100", true], + ["https://x.test/a", true], ["http://x.test/a", true], +]; + +describe("safeHref, one table for both runtimes", () => { + test("React's: the string back for relative, http, https, mailto and tel; null for anything else", async () => { + const { safeHref } = await import(pathToFileURL(path.join(repoRoot, "packages", "react", "dist", "safe-href.js")).href); + for (const [input, passes] of URLS) assert.equal(safeHref(input), passes ? input : null, JSON.stringify(input)); + }); + test("the skill's Basalt.safeHref, in a page: the same answers", async () => { + const { page, context } = await openHtml(browser, compose("t

      x

      ", { fonts: false }).html); + const got = await page.evaluate((urls) => urls.map(([input]) => window.Basalt.safeHref(input)), URLS); + URLS.forEach(([input, passes], i) => assert.equal(got[i], passes ? input : null, JSON.stringify(input))); + assert.equal(await page.evaluate(() => window.Basalt._.esc(`&`)), "<a href="x" title='y'>&</a>"); + assert.deepEqual(await page.evaluate(() => [window.Basalt._.pick("top", ["top", "end"], "end"), window.Basalt._.pick('top" onclick="x', ["top", "end"], "end"), window.Basalt._.pick(undefined, ["a"], "a")]), ["top", "end", "a"]); + await context.close(); + }); +}); + +describe("the sink check", () => { + const file = "packages/react/src/planted.tsx"; + const fails = (text, why) => assert.ok(checkSource(file, text).some((p) => why.test(p)), `${why} for:\n${text}\n${checkSource(file, text).join("\n")}`); + const passes = (text) => assert.deepEqual(checkSource(file, text), [], text); + + test("every kind of sink fails without a reason, and passes with one", () => { + const sinks = [ + "el.innerHTML = value;", 'el["outerHTML"] = value;', "el.srcdoc = page;", "el.insertAdjacentHTML('beforeend', value);", "document.write(value);", "document.writeln(value);", + "range.createContextualFragment(value);", "el.setHTMLUnsafe(value);", "el.setAttribute('srcdoc', page);", "const p = { dangerouslySetInnerHTML: { __html: value } };", + "props.dangerouslySetInnerHTML = value;", "const a =
      ;", "const f =