fix(chrome): tokenize bare z-index sites + add allowlist contract - #215
Merged
Conversation
Kenji aesthetic-audit reminder 9 (msg `bacde601` 2026-06-24, finding #4): four bare integer z-index sites in styles.css (line 407 z-4, 3858 z-2, 7193 z-35, 14463 z-5) sidestep the `--z-*` token scale defined in maka-tokens.css. PR #214 already took out the gradual-blur-layer site (z-5). This PR closes the remaining three. ## Changes 1. `maka-tokens.css`: add two new tokens preserving the previous raw values exactly: - `--z-panel-action: 4` - `--z-settings-fullpage: 35` 2. `styles.css` line 407 (`.maka-workspace-top-actions`): `z-index: 4` → `var(--z-panel-action)`. Identical stacking. 3. `styles.css` line 7193 (`.settingsModal.settingsPage`): `z-index: 35` → `var(--z-settings-fullpage)`. 35 sits between `--z-titlebar` (40) and `--z-sticky` (20) so the OS titlebar still owns top of the stack. Preserved visual behavior exactly. 4. `styles.css` line 3858 (`.maka-skill-featured-art span:nth-child(2)`): bare `z-index: 2` kept. This is local stacking among 3 decorative sticker spans inside a fixed-size container — they never escape the parent and don't need a global token. Added explicit allowlist comment. 5. New `apps/desktop/src/main/__tests__/z-index-contract.test.ts` enforces: - every bare `z-index: <integer>;` must be tokenized or allowlisted (with a documented reason) - allowlist entries must be present in styles.css (no stale entries) - the 10 semantic `--z-*` tokens stay defined in maka-tokens.css Future PRs that re-introduce a bare z-index will fail this test unless they explicitly bump the allowlist. ## Diff 3 files: maka-tokens.css +7, styles.css +17/-2, new test +~110 lines. No visual change. Far from PR #202 (transition sweep), PR #210 (main.tsx debounce), PR #214 (footer/gradual-blur). No conflict. ## Verification Disk still ~100%, couldn't run `pnpm install && pnpm test`. Contract test is greenfield — first run will validate the 4 sites in this same PR.
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-9 picking up kenji's aesthetic-audit reminder 9 finding #4 (final remaining audit item).
Bug
Four bare integer z-index sites in styles.css sidestep the `--z-*` token scale already defined in maka-tokens.css:
PR #214 already removed the gradual-blur site. This PR closes the remaining three.
Fix
Two new tokens preserving previous raw values exactly:
Tokenize line 407 and line 7193 to reference the new tokens. Identical visual stacking.
Allowlist line 3858 — bare `z-index: 2` is local stacking among 3 decorative sticker spans inside a fixed-size container. They never escape the parent and don't need a global token. Added explicit allowlist comment + contract entry.
New contract test (`z-index-contract.test.ts`):
Future PRs that re-introduce a bare z-index will fail this test unless they explicitly bump the allowlist.
Diff
3 files: maka-tokens.css +7, styles.css +17/-2, new test +~110 lines. No visual change.
Conflict check
Far from PR #202 (transition sweep), PR #210 (main.tsx debounce), PR #214 (footer/gradual-blur). No conflict.
Verification
Disk still ~100%, couldn't run `pnpm install && pnpm test`. Contract test is greenfield — first run will validate the 4 sites here itself.