test(contract): lock ui.tsx design-system escape hatches (kenji audit #1) - #218
Merged
Conversation
… reminder 4-6 #1) Kenji's aesthetic audit reminder 4-6 finding #1 (msg `6cc0e04d` 2026-06-24): `packages/ui/src/ui.tsx` is a motion / design contract blind spot. The PR-MOTION-TOKEN-CONVERGE-0 contract scans `packages/ui/src/primitives/` and `apps/desktop/src/renderer/` but NOT the aggregate UI re-export layer at ui.tsx. That file inlines Tailwind utilities that would otherwise be caught: - `z-40` (×2): dialog + sheet backdrop scrim - `z-50` (×5): dialog popup, sheet popup, tooltip, select popup, popover - `backdrop-blur-sm` (×2): dialog + sheet backdrop - `transition-[height]` (×1): accordion content panel Without a contract, future primitive PRs can quietly add a sixth or seventh escape hatch without going through design-system review. ## Approach Greenfield contract test pinning the EXACT set + count of escape hatches. Three checks: 1. Each allowlisted pattern appears exactly the expected number of times — adding new sites OR removing old ones (stale allowlist) both fail. 2. No other bare Tailwind z-index utilities (z-0 / z-10 / z-20 / z-30) have crept in. 3. No other bare backdrop-blur intensity variants beyond `sm` have crept in (md / lg / xl / 2xl / 3xl / none). ## Intentionally NOT removing the escape hatches in this PR Removing them would touch Base UI primitive wrappers (Dialog, Sheet, Tooltip, Select, Popover, Accordion) and risk visual breakage. Each removal needs WAWQAQ / kenji review on what to tokenize to. The contract locks the perimeter; future PRs can replace one at a time. The accordion `transition-[height]` is documented as intentional — content panels are variable-height; transform-based scaling would distort children. That one stays even after full tokenization. ## Diff 1 new file: ~110 lines test. No source change, no visual change. No overlap with any open PR. ## Verification Disk still ~100%, couldn't run `pnpm install && pnpm test`. The contract is greenfield and self-validating — first run will confirm all four allowlist counts match the file as it stands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR-FE-BUG-HUNT-12 closing kenji's audit reminder 4-6 finding #1 (msg `6cc0e04d` 2026-06-24).
Bug
`packages/ui/src/ui.tsx` is a motion / design-contract blind spot. The PR-MOTION-TOKEN-CONVERGE-0 contract scans `packages/ui/src/primitives/` and `apps/desktop/src/renderer/` but NOT the aggregate re-export layer at ui.tsx. That file inlines Tailwind utilities that would otherwise be caught by existing contracts:
Without a contract, future primitive PRs can quietly add a sixth or seventh escape hatch without design-system review.
Approach
Greenfield contract test pinning the EXACT set + count. Three checks:
Why I'm NOT removing the escape hatches in this PR
Touches Base UI primitive wrappers (Dialog, Sheet, Tooltip, Select, Popover, Accordion) and risks visual breakage. Each removal needs kenji / WAWQAQ review on what to tokenize to. Contract locks the perimeter; future PRs replace one at a time.
The accordion `transition-[height]` is documented as intentional — content panels are variable-height; transform scaling would distort children. That one stays even after full tokenization.
Diff
1 new file, ~110 lines test. No source change, no visual change. No overlap with any open PR.
Verification
Disk still ~100%, couldn't run `pnpm install && pnpm test`. The contract is self-validating — first run will confirm all four allowlist counts match the file as it stands.