Repository navigation
refactor(ui): ban bare ease keywords, enforce var(--ease-*) tokens - #431
Merged
Merged
Conversation
Astro-Han
added a commit
that referenced
this pull request
Jul 2, 2026
Codex review findings on #431: - [P2] BARE_EASE skipped hyphenated values, so bare `ease-in` slipped through the contract. Add BARE_EASE_IN. - [P2] linear whitelist skipped the whole line when both `linear` and `infinite` appeared, letting a `linear` in a same-line `transition` pass. Whitelist per match, not per line.
Astro-Han
added a commit
that referenced
this pull request
Jul 2, 2026
…whitelist Address code review on PR #431: P1: the five separate regexes let bare `linear` bypass the contract. `ease-linear` (Tailwind class → `transition-timing-function: linear`) fell between `ease` and `linear` regexes (both rejected by the hyphen lookbehind/lookahead). A same-line `transition ... linear; animation ... infinite` was shielded entirely because the whitelist skipped the whole line on any `infinite` match. Replace with one longest-match-first matcher using matchAll: `ease-in-out | ease-linear | ease-in | ease-out | ease | linear`. Split each line into `;`-delimited declaration segments and scan each independently — `linear` is whitelisted only when its own segment contains `infinite`, so a transition `linear` on the same line as an infinite animation is still flagged. P3: `ease-in-out` was reported twice (as `ease-in` AND `ease-in-out`) because the separate `ease-in` regex matched the prefix. The single ordered matcher resolves this — longest token wins. Add a fixture `it` locking the four review cases: ease-linear catch, same-line transition/animation linear, ease-in-out single report, infinite-loop linear whitelist.
Astro-Han
added a commit
that referenced
this pull request
Jul 2, 2026
…tors Address code review round 2 on PR #431: P1: the segment-scoped `linear` whitelist (split on `;`) still had bypass vectors. A TSX inline style `style={{ transition: "opacity 100ms linear", animation: "spin 1s linear infinite" }}` was not split (no `;`), so the transition `linear` was shielded by the animation `infinite`. A comma-separated `animation: spin 1s linear infinite, fade 100ms linear 1;` kept both `linear` in one segment, so the non-infinite second item was exempted. Replace the whitelist with a token: `--ease-linear: linear`. Convert the two real infinite-loop animation sites (maka-status-spin spinner, maka-shimmer) to `var(--ease-linear)`. The contract now bans ALL bare ease/linear uniformly — no split, no per-line/per-segment exemption, no bypass vector. The `--ease-linear: linear;` declaration itself is stripped before scanning (same pattern as `--ease-out-strong`). Update fixture `it` with the two review negative cases: TSX same-line transition+animation linear, and comma-separated animation with a non-infinite second item.
Add a new invariant to motion-token-converge-contract.test.ts banning bare ease/ease-out/ease-in-out/linear timing keywords in renderer CSS and @maka/ui TSX. Replace all bare keywords with var(--ease-out-strong) or var(--ease-in-out-strong). linear in infinite-loop animations (spinners/shimmer) is whitelisted. - Fix dead --ease-maka reference in ui.tsx (→ --ease-out-strong) - Update chat-tool-card-cascade-contract assertion to match token usage Part of #430.
Codex review findings on #431: - [P2] BARE_EASE skipped hyphenated values, so bare `ease-in` slipped through the contract. Add BARE_EASE_IN. - [P2] linear whitelist skipped the whole line when both `linear` and `infinite` appeared, letting a `linear` in a same-line `transition` pass. Whitelist per match, not per line.
…whitelist Address code review on PR #431: P1: the five separate regexes let bare `linear` bypass the contract. `ease-linear` (Tailwind class → `transition-timing-function: linear`) fell between `ease` and `linear` regexes (both rejected by the hyphen lookbehind/lookahead). A same-line `transition ... linear; animation ... infinite` was shielded entirely because the whitelist skipped the whole line on any `infinite` match. Replace with one longest-match-first matcher using matchAll: `ease-in-out | ease-linear | ease-in | ease-out | ease | linear`. Split each line into `;`-delimited declaration segments and scan each independently — `linear` is whitelisted only when its own segment contains `infinite`, so a transition `linear` on the same line as an infinite animation is still flagged. P3: `ease-in-out` was reported twice (as `ease-in` AND `ease-in-out`) because the separate `ease-in` regex matched the prefix. The single ordered matcher resolves this — longest token wins. Add a fixture `it` locking the four review cases: ease-linear catch, same-line transition/animation linear, ease-in-out single report, infinite-loop linear whitelist.
…tors Address code review round 2 on PR #431: P1: the segment-scoped `linear` whitelist (split on `;`) still had bypass vectors. A TSX inline style `style={{ transition: "opacity 100ms linear", animation: "spin 1s linear infinite" }}` was not split (no `;`), so the transition `linear` was shielded by the animation `infinite`. A comma-separated `animation: spin 1s linear infinite, fade 100ms linear 1;` kept both `linear` in one segment, so the non-infinite second item was exempted. Replace the whitelist with a token: `--ease-linear: linear`. Convert the two real infinite-loop animation sites (maka-status-spin spinner, maka-shimmer) to `var(--ease-linear)`. The contract now bans ALL bare ease/linear uniformly — no split, no per-line/per-segment exemption, no bypass vector. The `--ease-linear: linear;` declaration itself is stripped before scanning (same pattern as `--ease-out-strong`). Update fixture `it` with the two review negative cases: TSX same-line transition+animation linear, and comma-separated animation with a non-infinite second item.
jackwener
force-pushed
the
opencode/motion-token-governance
branch
from
July 2, 2026 15:57
a23f11c to
974e9e9
Compare
Member
|
Thanks, merged! 🎉 Verified locally: the contract scanner reports 0 offenders after the change and all 1667 desktop tests pass. Nice catch on the dead |
Astro-Han
added a commit
that referenced
this pull request
Jul 2, 2026
Follow-up to #431: the merged PR tokenized shimmer but left the status pulse as bare `ease-in-out` and the Easing Scale story without the new `--ease-linear` entry. Finish the catalog so all developer-facing easing examples use `var(--ease-*)`.
jackwener
added a commit
that referenced
this pull request
Jul 3, 2026
Closes out every remaining item from the 2026-07-03 three-way code review instead of leaving them as suggestions: - Search modal focus yank (P0): selecting a result navigated to the chat turn but useModalA11y unconditionally restored focus to the sidebar search trigger on unmount, defeating the call site's restoreFocus:false intent. The hook now takes an optional suppressFocusRestoreRef; SearchModal sets it when navigation owns focus. Lifecycle contract updated to the new signature/structure (StrictMode still-mounted guard unchanged, one line later). - Skills view switcher ARIA (P0): role=tablist/tab promised the ARIA tabs keyboard contract (roving tabindex, arrow keys, linked panels) that plain buttons never implemented. Now honest aria-pressed segmented buttons. - Bot platform nav freeze (P0, amended per existing contract): the contract intentionally locks platform switching while a provider action runs, but all seven rows froze with NO explanation. Kept the lock, added the missing title (当前操作进行中,完成后可切换平台). - Dead filter pills (P2): 全部 / 排序:热门 were disabled buttons visually promising interactivity; now static spans (CSS gains explicit inline-flex so the span keeps the 28px pill geometry). - Motion contract TSX scanner (#431 review P2): strip //-line and /*-block comments before scanning so prose "ease"/"linear" in doc comments cannot false-positive — closes the CSS/TSX asymmetry. Desktop suite 1696/1696.
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.
Summary
Extend
motion-token-converge-contract.test.tsto ban bareease/ease-in/ease-out/ease-in-out/ease-linear/lineartiming keywords, enforcingvar(--ease-*)tokens. Fix the dead--ease-makareference.Why
Closes #430 (PR1 motion)
maka's motion governance already had a half contract (locking the cubic-bezier curve +
transition: all), but bare ease keywords kept slipping through. This PR closes that gap so all easing goes through the four tokens (--ease-out-strong/--ease-in-out-strong/--ease-drawer/--ease-linear), converging the same way radius did.Scope
Changed:
it: scan renderer CSS + maka-tokens.css + @maka/ui TSX, ban bareease/ease-in/ease-out/ease-in-out/ease-linear/linear— no whitelist, no exemptions--ease-linear: lineartoken (for infinite-loop functional animations: spinners, shimmer)var(--ease-out-strong)orvar(--ease-in-out-strong)linearuses (spinner/shimmer) →var(--ease-linear)packages/ui/src/ui.tsx:30--ease-maka→--ease-out-strongchat-tool-card-cascade-contract.test.tsassertion to match token usageanimation-catalog.stories.tsx: status pulse →var(--ease-in-out-strong), Easing Scale adds--ease-linearentryNot included:
Verification
npm run -w @maka/desktop test: 1663/1663 passnpm run typecheck: cleanitlocking the review cases:ease-linearcatch, same-line transition/animationlinear, comma-separated animation item,ease-in-outsingle report)Reviewer notes
ease-in-out | ease-linear | ease-in | ease-out | ease | linear) viamatchAll, soease-in-outis reported once (not also asease-in), and the Tailwindease-linearclass is caught explicitly.--ease-linear: linearis a token so infinite-loop animations don't need a whitelist. The declaration line is stripped before scanning (same pattern as--ease-out-strong).--ease-lineartoken replaced the per-line/per-segmentinfinitewhitelist.