Skip to content

test(deps): pin the vaul patch and fail on any unpinned patch - #443

Merged
sydevs-bot merged 4 commits into
mainfrom
test/pin-vaul-patch
Nov 19, 2026
Merged

sydevs-bot merged 4 commits into
mainfrom
test/pin-vaul-patch

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

patches/[email protected] was the only dependency patch with no pin in src/lib/shadow-patches.test.ts. Upstream vaul is unmaintained: its README says so, and 1.1.2 (2024-12-14) is still the newest release as of 2026-11-19 (re-checked that day with npm view vaul version time.modified). So the patch stays, and this PR pins it the same way as the other three. Pins now fail the unit lane if either hunk stops having its effect. They also fail if pnpm.patchedDependencies ever gains a patch that nothing pins. Editing a patch file, or the Drawer atom, now runs the pins per edit.

The branch is rebased onto main at a1ce36b6 (#436), so it already sits on top of #434, #436, #437 and #438. main has since gained #439 (payload types only), which this branch does not touch.

What changed and why it matters

The vaul patch has three hunks:

  • fix(ui): scope widget css so it cannot restyle the host page #91, in dist/index.js and dist/index.mjs: disables __insertCSS. Upstream appends an unscoped <style> to the host's <head> at module scope. Its bare @keyframes fadeIn/fadeOut/slideFrom* are document-global and overrode the host page's own animations. src/styles/vaul.css already vendors that CSS through the scoping pass.
  • feat(ui): rework UI into a nested-drawer navigation system #30, in dist/index.mjs only: forwards modal to Radix Dialog.Root. Without it Radix defaults to modal, so even modal={false} aria-hid the page behind the drawer and trapped focus. Upstream main still does not forward it.

Which build each consumer loads. vaul's exports map sends import to dist/index.mjs and require to dist/index.js. A marker build showed that only index.mjs loads, in every consumer: the Vite bundle, the dev-server pre-bundle, Ladle, and the unit lane in node and jsdom. Nothing requires vaul (pnpm why vaul shows only our direct dependency, and Drawer.tsx is still the only file in src/ that imports it). So the CJS build's missing modal hunk is a latent limit, not a live bug. It is recorded as a shortcut: in the spec and a ⚠ in the register. The patch itself is unchanged.

src/lib/shadow-patches.test.ts:

  • New [VAUL] entry in PATCHES. The drift pin checks that head.appendChild(style) is gone from both builds and that modal: modal, is present in index.mjs. The latter uses a new optional onlyIn field for a hunk that lives in one file only. expectPatched also fails if an onlyIn key names a file not listed in files. Without that check, a mistyped key passed without being checked.
  • Behaviour specs:
    • 'adds no stylesheet to the page it loads into' loads vaul fresh, so it is checked against this document.
    • 'leaves the page behind a non-modal drawer reachable' renders our Drawer atom, vaul's only caller, and checks both no aria-hidden and no focus trap.
    • A modal control spec shows that jsdom sees both effects, so the non-modal spec cannot pass vacuously.
  • 'the patch register' fails if pnpm.patchedDependencies applies a patch that PATCHES does not pin. Every entry gained a patch path field for this check.
  • Lint exception: one narrow, commented react/no-children-prop disable. A .ts spec has no JSX, and the atom's types require children as a prop.

scripts/select-unit-specs.mjs treats patches/*.patch as a lane source. The spec that names a patch by its quoted repo-relative path selects it, which is the same form brand.test.ts already uses. Drawer.tsx reaches the pin through the existing reference index. Fixture and real-repo assertions in scripts/select-unit-specs.test.ts cover both.

src/components/AGENTS.md (patch register): every row is now pinned. vaul is marked unmaintained, with the date and how to re-check (npm view vaul version time.modified, plus the note at the top of the upstream README). The ESM-only modal hunk is flagged.

docs/testing.md: one sentence on how a patch file is selected. It carries a ⚠: the pins read the INSTALLED package, which a patch edit reaches only at the next pnpm install.

No CHANGELOG or docs/embedding.md entry: a host cannot observe any of this.

Verification

Run on the rebased head unless a line says otherwise.

  • Rebase: git rebase origin/main applied all four commits with no conflicts. git range-diff shows each commit's diff unchanged. package.json, pnpm-lock.yaml and patches/ are byte-identical to main, and pnpm install --frozen-lockfile passes.
  • Before the rebase, on the original head:
    • Pristine vaul 1.1.2 (registry tarball; sha512 matches npm's dist.integrity) swapped in for the installed copy: 3 failed, 12 passed. The failures were the stylesheet spec (2 vaul <style> elements found), the non-modal spec (aria-hidden was 'true'), and the drift pin. The modal control passed, as intended. After restoring the patched install: 15/15.
    • Each hunk reverted alone: each behaviour spec fails on its own hunk. The focus half of the non-modal spec also fails on its own. Forcing Drawer.tsx to modal: false fails the control spec. An extra patchedDependencies entry fails the register spec.
    • onlyIn guard: with the vaul key mistyped and the hunk absent, the drift pin passed before the guard and fails after it.
    • Selector: the new selector assertions fail with scripts/select-unit-specs.mjs reverted to main.
  • Selector, re-measured: all four patch files select the pin. Drawer.tsx selects 5 specs including it (3 on main). The widest selection is still 22 (src/test-support/repo-source.ts). The per-edit hook, timed end to end, medians of three on 4 cores: 2.2s for Drawer.tsx, 1.7s for patches/[email protected], 1.7s for patches/[email protected], and 4.2s for the widest, all against the 12s budget.
  • .claude/skills/pr-prep/check.sh --full: exit 0.
    • Lint and typecheck passed.
    • Unit lane: 176 files, 2134 tests passed. src/lib/shadow-patches.test.ts alone: 15/15.
    • Build passed (assert-css-scoped, assert-no-sourcemaps, assert-classic-bridge).
    • pnpm size, main (a1ce36b6) → this branch, measured / shipped: standalone 333.5 / 334.7 → 333.5 / 334.7 KiB, embed 334.6 / 335.8 → 334.6 / 335.8 KiB, loader 2.8 / 3.3 → 2.8 / 3.3 KiB (budgets 336 / 336 / 3.6). The two dist/ trees are byte-identical, since the branch adds no runtime code.
  • pnpm ladle:build: exit 0 (no source maps across 168 files).
  • pnpm check:wrangler: exit 0, both configs.

Not done / not verified

  • The patch is unchanged. The CJS dist/index.js still lacks the modal hunk, and no behaviour spec runs against that build because nothing loads it. Only the drift pin checks its CSS hunk.
  • The pristine-vaul and per-hunk runs above were not repeated after the rebase. The spec, the patch and the installed vaul are the same files as before. The installed files are hard links into the shared pnpm store, so swapping them in place would also change every other checkout that uses that store. The one input in their path that main changed is Drawer.tsx, whose tv import moved to @/styles/tv in chore(deps): tailwind-variants 4.0.2 on its lite runtime #438. Its modal pass-through is untouched, and the modal control spec still passes on the rebased head, so the non-modal spec is still not vacuous.
  • The current state of the upstream issues vaul#497 and vaul#192 was not re-checked: the GitHub API was not available here. Upstream status comes from the npm registry and the README instead.
  • Dated per-edit figures in docs/testing.md were not refreshed. Its '7 of 420 lane sources' and '116 of those 420 select nothing' were already stale on main, which measures 467 lane sources with 104 selecting nothing. This branch adds the four patch files, so 471 with 104 selecting nothing, and translations.test.ts is still selected for 7.
  • The stylesheet spec loads vaul fresh by adding a query string to import.meta.resolve('vaul'). That works because Vitest loads vaul through Node's own import today. If vaul is ever bundled into the test run, the spec needs re-checking.

Follow-ups for the maintainer

  • .claude/ edit (wording only, not made here): the comment near line 30 of .claude/hooks/unit-test.mjs ('Empty for a Ladle story, a path outside src/, or a tree with no specs in it') could mention that patches/*.patch is now covered. The hook's code needs no change.
  • If anything ever require()s vaul: add the same one-line modal: modal, hunk to dist/index.js in the patch and update the lockfile. The spec's shortcut: line says so.
  • Merge order with the toolchain PR. This branch has no lockfile coordination with the other open branches. However, the toolchain PR (Node 24, pnpm 12) moves pnpm.patchedDependencies out of package.json into pnpm-workspace.yaml, and the new register spec reads it from package.json. Whichever of the two lands second must point that spec at pnpm-workspace.yaml. The toolchain PR is meant to land last, so in practice it carries the change.
  • Per-edit cost: editing Drawer.tsx now runs 5 specs instead of 3.

Generated by Claude Code

[email protected] was the one patched package with no pin in
src/lib/shadow-patches.test.ts. Upstream is unmaintained (its README
says so, and 1.1.2 from 2024-12-14 is still the newest release), so
the patch is staying, and now it is pinned like the other three:

- the CSS hunk (#91): a fresh evaluation of the build this lane
  resolves adds no vaul stylesheet to the document;
- the modal hunk (#30): through our Drawer atom, its only caller, a
  non-modal drawer leaves the page behind it neither aria-hidden nor
  focus-trapped, with a modal control showing jsdom sees both effects;
- a drift pin on both built files.

Each spec was run against pristine vaul 1.1.2 from the registry tarball
and against each hunk reverted alone, and fails on its own hunk.

The modal hunk exists only in dist/index.mjs. Measured with a marker
build: the Vite bundle, the dev server's pre-bundle, Ladle, and this
lane in node and jsdom all load index.mjs, and nothing loads index.js,
the `require` build. The pin records that limit as a shortcut rather
than widening the patch.

A register check now fails if pnpm.patchedDependencies applies a patch
that PATCHES does not pin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
The per-edit hook only acted on src/ and scripts/ sources, so an edit to
patches/*.patch selected nothing. A dependency patch is now a lane
source, reached the way brand.test.ts reaches its copy files: by the
quoted repo-relative path src/lib/shadow-patches.test.ts names it by in
PATCHES. Editing any of the four patches now runs that spec.

Drawer.tsx reaches the vaul pin through the existing reference index,
since the pin renders the Drawer atom. That selection measured ~3.1s
here (from ~1.5s), well inside the 12s budget, and the widest selection
is unchanged at 22.

The pins read the INSTALLED package, which a patch edit reaches only at
the next pnpm install. The selector and docs/testing.md say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
expectPatched reads only the files a patch lists, so an onlyIn key
naming any other file (a typo, or a renamed build file) left its hunks
unchecked and the drift pin green. With the vaul key mistyped and the
modal hunk absent, 'keeps every hunk in our own pinned copy' passed;
it now fails on the unlisted key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
The vaul pin's comment said every drawer in the app is non-modal, but
DrawerStack's filter overlay passes `modal`. The defect #30 describes is
the page behind a non-modal drawer, so the comment now says that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVeNzer8ue5c7JRsZk
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 19, 2026
@sydevs-bot

sydevs-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 19, 2026
Merged via the queue into main with commit 620930b Nov 19, 2026
16 checks passed
@sydevs-bot
sydevs-bot deleted the test/pin-vaul-patch branch November 19, 2026 23:29
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants