Skip to content

B0: CSP-safe head files and CSPProvider, CommandMenu search, cut links in th, experimental split-import plugin (DECISIONS 265) - #112

Merged
bmjcoding merged 3 commits into
mainfrom
claude/gaps-b0-engineering
Nov 22, 2026
Merged

bmjcoding merged 3 commits into
mainfrom
claude/gaps-b0-engineering

Conversation

@bmjcoding

Copy link
Copy Markdown
Owner

What

Batch B0 of the CIMIP gaps stream (cimip-gaps-2, DECISIONS 265). It is engineering only. The one pixel change puts back a documented rule: a cut link in a pinned th keeps its ellipsis, and a new-tab link keeps its arrow.

  1. Head scripts as files: @srasyndicate/basalt/head/theme.js and /head/loops.js, byte for byte the exported strings, for apps under script-src 'self'.
  2. CSPProvider({ nonce?, disableStyleElements?, children? }): a layered .base-ui-disable-scrollbar rule replaces Base UI's inline style when it is off.
  3. CommandMenu: new search and onSearchChange props. The search state now lives in the shell and is cleared once the close finishes.
  4. Cut links in header cells: :is(td, th) > a, in React and in the HTML skill's still table.
  5. Docs: a Menu trigger that is off for now; the loops toggle's two forms in an app.
  6. @srasyndicate/basalt/imports (experimental, esbuild only):
    • basaltImportsEsbuild() gives each app file a barrel of only the names it imports, so lazy routes no longer leak into the first screen's chunk.
    • It reads files through esbuild's own transform and falls back to the whole root when it can't read one.
    • It never rewrites a dependency that resolves another copy of Basalt.
    • Measured: the test fixture's first screen drops from 341 KB to 160 KB, and CIMIP's from 712 KB to 660 KB.

Review

  • Astra (code): 6/10 with three blocking findings, all fixed in a53f669e:

    • the plugin lost an import in semicolon-free TypeScript;
    • the plugin could swap a dependency's copy of Basalt;
    • the head files were one byte longer than the exported strings.

    Its three polish findings are fixed too. The lead checked each finding and fix.

  • Pixels: the lead checked the pinned-link shots at 390.

  • No council round (DECISIONS 226).

Checks

CI is paused (owner, 2026-11-21). On the merged tree (with origin/main 684a7416):

  • bundle, content-policy, engineering-b0, rail-and-bell and commands: 194 passed, 0 failed.
  • Lint, and the react and review typechecks: passed.
  • export-sizes.json: re-recorded.

Review round 56.

🤖 Generated with Claude Code

bmjcoding and others added 3 commits November 22, 2026 16:37
…h, a pinned th link's ellipsis, the imports plugin (DECISIONS 265)

Engineering inside the decided design, no new look (cimip-gaps-2, batch B0):

- The head scripts under script-src 'self': dist/head/theme.js and dist/head/loops.js, each the
  exported string character for character, as package exports; docs for the file and nonce forms.
- CSPProvider: Base UI's provider with Basalt's types (nonce, disableStyleElements), and the
  .base-ui-disable-scrollbar rule in @layer basalt, so turning Base UI's style element off draws
  the same thing. Tested under a real policy: no style element, nothing refused, same popup box.
- CommandMenu search / onSearchChange: the shell holds the search (typed while loading included);
  uncontrolled clears after the close transition and reports "".
- A link in a still table's row head (th) is its own truncating box, as in a td, in React and the
  HTML skill: a cut new-tab link keeps its label's ellipsis and its arrow.
- First-load chunking: measured. esbuild's splitting places modules by reachability before tree
  shaking, so the root barrel drags a later route's modules up front (341 KB vs 160 KB on a
  shell + Nav + Table first screen). @srasyndicate/basalt/imports (basaltImportsEsbuild) gives each
  file a small barrel of what it imports; map generated from the barrel's source at build.
- Docs: Menu's trigger that is off for now (focusableWhenDisabled + controlled open); foundations
  names both forms of the loops toggle for an app's head band (fact fix).
- Review round 56; size table re-recorded (CSPProvider new, CommandMenu +173 bytes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1. rootImports reads esbuild's printed form: the file goes through esbuild.transform (the build's
   own loader for its extension), then static import/export clauses are read by grammar; any
   mention of the root it cannot place (namespace, star, default, a string) means the whole root.
   A semicolon-free module (parts.ts) and a comment holding an import now go through the split build.
2. The plugin resolves each root import as esbuild would for that file (build.resolve, guarded)
   and rewrites only when it reaches the root beside the plugin; a dependency with a nested copy
   keeps its own (tested with a nested node_modules).
3. dist/head/*.js are the exported strings exactly, with no added newline.
4. The map generator fails the build on any export in the barrel it cannot read, naming the line.
5. The Select comparison's test name, README and round 56 claim only what is measured.
6. The side-effect test excludes dist/head/theme.js and loops.js by name.
README: the imports plugin is marked experimental (esbuild only), with its two rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ering

# Conflicts:
#	packages/react/test/export-sizes.json
@bmjcoding
bmjcoding merged commit 2fda6c1 into main Nov 22, 2026
1 of 2 checks passed
@bmjcoding
bmjcoding deleted the claude/gaps-b0-engineering branch November 22, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant