Skip to content

fix(chrome): tokenize bare z-index sites + add allowlist contract - #215

Merged
jackwener merged 1 commit into
mainfrom
yuejing/fe-bug-hunt-9
Jun 24, 2026
Merged

fix(chrome): tokenize bare z-index sites + add allowlist contract#215
jackwener merged 1 commit into
mainfrom
yuejing/fe-bug-hunt-9

Conversation

@jackwener

Copy link
Copy Markdown
Member

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:

Line Selector Value
407 `.maka-workspace-top-actions` `z-index: 4`
3858 `.maka-skill-featured-art span:nth-child(2)` `z-index: 2`
7193 `.settingsModal.settingsPage` `z-index: 35`
~14463 (gradual-blur-layer, removed in PR #214) `z-index: 5`

PR #214 already removed the gradual-blur site. This PR closes the remaining three.

Fix

  1. Two new tokens preserving previous raw values exactly:

    • `--z-panel-action: 4`
    • `--z-settings-fullpage: 35`
  2. Tokenize line 407 and line 7193 to reference the new tokens. Identical visual stacking.

  3. 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.

  4. New contract test (`z-index-contract.test.ts`):

    • every bare `z-index: ;` must be tokenized OR allowlisted with a justification
    • allowlist entries must still be present in styles.css (no stale entries)
    • all 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.

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.

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.
@jackwener
jackwener merged commit 7cdb0bf into main Jun 24, 2026
@jackwener
jackwener deleted the yuejing/fe-bug-hunt-9 branch June 24, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant