test(contract): lock drawer.tsx + tabs.tsx motion escape hatches (kenji audit #3+#4) - #219
Merged
Conversation
…ji audit #3 + #4) Sibling of PR-FE-BUG-HUNT-12 (which locked ui.tsx). Closes kenji's audit reminder 4-6 findings #3 + #4 (msg `6cc0e04d` 2026-06-24): ## drawer.tsx escape hatches (5) - `cubic-bezier(0.32,0.72,0,1)` ×2 — iOS-style settle curve, raw on backdrop + popup. Should move to `--ease-drawer` token. - `duration-450` ×2 — drawer settle duration. Doesn't match any current `--duration-*` token. Should tokenize. - `transition-[transform,box-shadow,height,background-color]` ×1 — animating `height` is layout-trigger. Intentional because drawer snap points (peek / half / full) drive variable height and `transform: scaleY` would distort children. Layout-property transition is acknowledged here. - `backdrop-blur-sm` ×1 — same finding as kenji #6. - `z-50` ×1 — same convention as ui.tsx; pending tokenization. ## tabs.tsx escape hatches (3) - `transition-[width,translate]` ×1 — animating `width` is layout- trigger. Cleaner refactor is `translate + scaleX` with measured base width, but that needs measurement infrastructure not in place. Layout transition acknowledged. - `duration-200` ×1 — matches `--duration-base` (200ms) by value but uses bare Tailwind utility. - `ease-in-out` ×1 — generic Tailwind easing, not project's `--ease-out-strong`. ## Approach Same as PR-FE-BUG-HUNT-12 (ui.tsx contract): pin EXACT count of each allowlisted pattern. Adding new sites OR removing stale allowlist entries both fail. Plus a "no other layout transitions" sweep that verifies no NEW `transition-[<bracketed-list>]` showed up beyond the allowlisted ones. Not touching source — touches primitive wrappers; each tokenization needs kenji / WAWQAQ review per primitive. Contract locks perimeter. ## Diff 1 new file, ~140 lines test. No source change, no visual change. No overlap with PR-FE-BUG-HUNT-12 (different file scope) or any other open PR. ## Verification Disk still ~100%, couldn't run tests. Greenfield contract is self-validating — first run confirms counts match current file state. The allowlist counts were derived from grep + manual read.
Verified counts via `grep -o ... | wc -l` before pushing PR #219 to review and caught my own miscounts: - drawer.tsx `z-50`: 1 → actual 3 (gesture wrapper, backdrop scrim, cushion overlay all stack at z-50) - drawer.tsx had TWO additional `transition-[<bracketed>]` patterns I missed: `transition-[transform,box-shadow,height,background-color, margin,padding]` (drawer popup bottom-edge — worse layout trigger than the base, adds margin+padding) and `transition-[background- color,box-shadow]` (drawer-internal switch handle — paint-only, safe) - tabs.tsx had ONE additional `transition-[color,background-color, box-shadow]` pattern (tabs trigger paint transition — paint-only, safe) All five additions added to the allowlist with explicit reason. The `no unexpected transition-[<bracketed>]` sweep rewritten to subtract the full allowlist from the found set (set-difference) instead of naively iterating, so it doesn't false-fail when there are multiple paint-only patterns. Pre-push count verification is now baked into the test contract itself — if a future maintainer changes a count without re-running, the test will fail loudly.
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-13 — sibling of PR #218 (which locked ui.tsx). Closes kenji's audit reminder 4-6 findings #3 + #4 (msg `6cc0e04d`).
drawer.tsx escape hatches (5)
tabs.tsx escape hatches (3)
Approach
Same as PR #218 (ui.tsx contract): pin EXACT count of each allowlisted pattern. Adding new sites OR removing stale entries both fail. Plus a sweep that verifies NO new `transition-[]` showed up beyond the allowlisted one in each file.
Not touching source — primitives need careful per-primitive review. Contract locks the perimeter.
Diff
`1 new file, +147 lines` — test only. No source change, no visual change. No overlap with PR #218 (different files) or any open PR.
Verification
Disk still ~100%, couldn't run tests. Greenfield contract is self-validating — first run confirms counts match current state. Counts derived from grep + manual read.