fix(nav): control order is language -> mode -> theme in bar and sheet (supersedes Q12/Q15)

This commit is contained in:
dong.nguyen committed 2026-10-17 14:51:02 +07:00
1 parent d7ef4a28e4
commit 6cd665960a
7 files changed
+56 -51

No files matched your search

+3 -3
View File
@@ -100,10 +100,10 @@ App
| Property | Value |
|---|---|
| Location | Navigation bar (right side, after the language toggle) at **every** width — the control is not hidden at ≤1024px (Q14) — plus the Theme color row, the last row of the mobile sheet's Appearance group, while the sheet is open |
| Location | Navigation bar (right side, the last of the three appearance controls — after the mode toggle) at **every** width — the control is not hidden at ≤1024px (Q14) — plus the Theme color row, the last of three rows in the mobile sheet's Appearance group (Language → Mode → Theme color), while the sheet is open |
| Control | Bar: `ThemePaletteMenu` (`src/components/layout/ThemePaletteMenu.tsx`), icon-only trigger — a 20px half-circle swatch (active palette's accent left, `--swatch-empty` right), no text and no chevron, name in `aria-label`, hint in `title` — opening the `#palette-menu` panel. Sheet: rendered by `MobileMenu.tsx` from `paletteIds` + `paletteMeta` as `.mobile-menu-swatch-option` buttons — the Mode/Language segmented-row shape, options drawn as colour icons |
| Options | `red` (default) / `blue` — `src/data/palettes.ts` (`paletteIds`, `paletteMeta.label`/`hint`), written to `data-palette` on `<html>`; the sheet lists both, one colour icon each |
| Chrome | The bar's three controls share `.nav-control` (44px bordered box, accent border + text on hover/open, one `:focus-visible`); `.nav-actions` order is mode → language → theme color → hamburger at every width, with a `@media (max-width: 420px)` guard so the row fits 320px |
| Chrome | The bar's three controls share `.nav-control` (44px bordered box, accent border + text on hover/open, one `:focus-visible`); `.nav-actions` order is language → mode → theme color → hamburger at every width (Q16 of `specs/v3/spec-v3-mobile-navigation.md`), with a `@media (max-width: 420px)` guard so the row fits 320px |
Spec: `specs/v3/spec-v3-theme-palette-switch.md`.
@@ -112,7 +112,7 @@ Spec: `specs/v3/spec-v3-theme-palette-switch.md`.
| Property | Value |
|---|---|
| Trigger | Hamburger button in the bar, ≤1024px |
| Groups | Menu (6 routes) → Appearance (Mode, Language, Theme color) → Connect (GitHub, LinkedIn, email) |
| Groups | Menu (6 routes) → Appearance (Language, Mode, Theme color) → Connect (GitHub, LinkedIn, email) |
| Behaviour | `role="dialog"` + `aria-modal="true"`, Escape closes from any focus position, `#main-content` / `.footer` / `.back-to-top` are `inert` while open, body scroll locked |
Spec: `specs/v3/spec-v3-mobile-navigation.md`.
@@ -1,11 +1,11 @@
# Specification — v3 Mobile Navigation Menu (social links + modern sheet)
> **Document:** `spec-v3-mobile-navigation.md`
> **Version:** 0.5.0 (seven owner decisions + three review answers resolved 2026-10-17, then four post-build follow-ups Q11–Q14; the review pass re-measured §3.3, corrected the Escape/focus/`inert` rules, moved the social aria strings, and pinned the nav order)
> **Version:** 0.7.0 (seven owner decisions + three review answers resolved 2026-10-17, then six post-build follow-ups Q11–Q16; the review pass re-measured §3.3, corrected the Escape/focus/`inert` rules, moved the social aria strings, and pinned the nav order — Q16 puts it at Language → Mode → Theme in the bar and in the sheet)
> **Parents:** `specs/ui/spec-ui-layout.md` (navigation layout), `spec-v3-i18n.md` (translated chrome), `spec-v3-theme-palette-switch.md` (palette row, contrast table at `:145-159`), `spec-v3-typography.md` (type tokens, chrome band)
> **Priority:** P1
> **Estimate:** ~2.5 hours including the social-links cutover
> **Status:** DECISIONS CLOSED — §10 records the seven owner answers, the three review answers (Q8–Q10) and the four post-build follow-ups (Q11–Q14). §3.2's contrast measurement was reproduced independently and stands. §3.3's height arithmetic was wrong — drafted 596px, actually 736px as drafted, 643px with the Step 8 tightenings, 647px after Q13 — and is rewritten. Steps 1–9 plus Q12–Q14 are built and gated (§12); the five criteria that can only be observed live all wait on the owner's browser pass (§11)
> **Status:** DECISIONS CLOSED — §10 records the seven owner answers, the three review answers (Q8–Q10) and the six post-build follow-ups (Q11–Q16). §3.2's contrast measurement was reproduced independently and stands. §3.3's height arithmetic was wrong — drafted 596px, actually 736px as drafted, 643px with the Step 8 tightenings, 647px after Q13 — and is rewritten. Steps 1–9 plus Q12–Q16 are built and gated (§12); the five criteria that can only be observed live all wait on the owner's browser pass (§11)
---
@@ -68,8 +68,8 @@ Everything below is the concrete shape of those two sentences in this codebase,
### 3.1 Anatomy
```
┌ bar (64px, four icon controls at every width — Q12–Q14) ──┐
│ {CV} ☼ VI ◐ ✕ │
┌ bar (64px, four icon controls at every width — Q12–Q16) ──┐
│ {CV} VI ☼ ◐ ✕ │
├ sheet (fixed, top:64px → bottom:0, glass panel) ───────────┤
│ MENU ← group label │
│ Home ▌ 2px accent bar + accent text + aria-current
@@ -77,8 +77,8 @@ Everything below is the concrete shape of those two sentences in this codebase,
│ About / Experience / Projects / Contact / Philosophy │
├ ───────────────────────────────────────────────────────────┤
│ APPEARANCE │
│ Mode [ Dark | Light ] ← segmented row │
│ Language [ English | Tiếng Việt ] ← segmented row │
│ Mode [ Dark | Light ] ← segmented row │
│ Theme [ ● ● ] ← colour icons per palette │
├ ───────────────────────────────────────────────────────────┤
│ CONNECT │
@@ -166,7 +166,7 @@ The drafted 596px was wrong. It counted a 15px label as a 15px line box (`:root`
### 3.4 Single column at every width
Per the owner's answer, no 2-column grid. The sheet's only width handling is the 800px content cap (§3.1). The bar gets one guard, at ≤420px (`src/App.css:303-313`: container padding 16px, action gap 12px), because four controls — logo, mode, language, palette, hamburger — share one 64px row at every width since Q14: at 320px that is ~70 + 44×4 + 12×3 = 262px inside 288px of content. The cost of the single column is the 44px overflow on a 375×667 phone (§3.3), which the sheet handles by scrolling.
Per the owner's answer, no 2-column grid. The sheet's only width handling is the 800px content cap (§3.1). The bar gets one guard, at ≤420px (`src/App.css:303-313`: container padding 16px, action gap 12px), because four controls — logo, language, mode, palette, hamburger — share one 64px row at every width since Q14 (order per Q16): at 320px that is ~70 + 44×4 + 12×3 = 262px inside 288px of content. The cost of the single column is the 44px overflow on a 375×667 phone (§3.3), which the sheet handles by scrolling.
### 3.5 Social block: the same tiles as the footer
@@ -766,7 +766,7 @@ Nothing deprecated or aliased: `SocialLinks` keeps its name and barrel export; i
| Dead-rule gate | `grep -n 'slideIn' src/App.css` | 0 matches |
| Glass contrast gate | composite `0.94 × --bg-surface + 0.06 × {--accent, --bg-elevated, --bg-primary, --code-bg}` per palette, then WCAG ratio for `--text-secondary`, `--text-muted`, `--accent`, `--text-primary` | minimum ≥ 4.5 in all four palettes; measured floor **4.58** (red-light, muted over accent). Independently reproduced 2026-10-17 across all 4 palettes × 4 behind colours × 4 text roles. The headroom is **0.08**, and `--text-muted` is the role the sheet heading and the palette trigger use (`src/App.css:202`) — pin the numbers in a CSS comment so a token tweak cannot break the gate silently |
| Bar contrast gate | same composite method at 94% for the bar's own text: `--text-muted` nav links (`src/App.css:54`), `--accent` active link (`:66`), `--text-primary` logo (`:25`) | minimum ≥ 4.5 in all four palettes; measured floor **4.58** (red-light muted over an accent element behind the bar) versus **4.01** at today's 85% |
| SSR smoke | throwaway `vite.ssrLoadModule` + `react-dom/server` render of `<ThemeProvider><LanguageProvider><Navigation /></LanguageProvider></ThemeProvider>` with the sheet force-opened. Three prerequisites the drafted gate hid: the providers throw without their wrappers (`useTheme.tsx:90-92`, `useLanguage.tsx:59-61`); both write `document.documentElement.setAttribute` during render outside any `try/catch` (`useTheme.tsx:56-57`, `useLanguage.tsx:32`), so the script must stub `globalThis.document` before loading the module; and `motion` v14 mounts a projection node **during render**, so a `documentElement.setAttribute`-only stub dies with `target.addEventListener is not a function` — the stub also needs `document.addEventListener`/`removeEventListener` and a `window` with `addEventListener`, `removeEventListener` and `matchMedia` | 6 nav rows, 3 group labels, 2 theme buttons and 2 language buttons with exactly one `aria-pressed="true"` in each pair, 3 social tiles, `aria-modal="true"`, `aria-current="page"` on exactly one row, `mailto:` tile with no `target`; since Q13 also — one swatch option per palette with exactly one `aria-pressed="true"`, and Theme color still the Appearance group's last child; since Q14 also — the bar's controls appear in the order mode → language → theme color → hamburger, and the palette trigger renders no text node while keeping `aria-label="Theme: Red"`, `title="Switch theme color"`, `aria-expanded` and the swatch, with no chevron; then delete the script |
| SSR smoke | throwaway `vite.ssrLoadModule` + `react-dom/server` render of `<ThemeProvider><LanguageProvider><Navigation /></LanguageProvider></ThemeProvider>` with the sheet force-opened. Four prerequisites the drafted gate hid: the providers throw without their wrappers (`useTheme.tsx:90-92`, `useLanguage.tsx:59-61`); both write `document.documentElement.setAttribute` during render outside any `try/catch` (`useTheme.tsx:56-57`, `useLanguage.tsx:32`), so the script must stub `globalThis.document` before loading the module; `motion` v14 mounts a projection node **during render**, so a `documentElement.setAttribute`-only stub dies with `target.addEventListener is not a function` — the stub also needs `document.addEventListener`/`removeEventListener` and a `window` with `addEventListener`, `removeEventListener`, `matchMedia`, `requestAnimationFrame`/`cancelAnimationFrame` and `localStorage`; and `Navigation`/`Button` render `<Link>`, so the render must be wrapped in `MemoryRouter` (`react-router`) or `useContext(NavigationContext)` is null | 6 nav rows, 3 group labels, 2 theme buttons and 2 language buttons with exactly one `aria-pressed="true"` in each pair, 3 social tiles, `aria-modal="true"`, `aria-current="page"` on exactly one row, `mailto:` tile with no `target`; since Q13 also — one swatch option per palette with exactly one `aria-pressed="true"`, and the Theme color row is the Appearance group's last child again (Q16); since Q14 also — the palette trigger renders no text node while keeping `aria-label="Theme: Red"`, `title="Switch theme color"`, `aria-expanded` and the swatch, with no chevron; since Q16 also — the bar's controls appear in the order language → mode → theme color → hamburger; then delete the script |
| Resume | `pnpm build:resume-all` | unchanged — the generator and template reference no nav or theme token |
| Browser | owner's pass (repo rule §5) | 320 / 375 / 768 / 900 / 1024 / 1100px × {dark, light} × {red, blue}; 375px scrolled to the bottom; keyboard-only open / Escape / tab-through |
@@ -787,9 +787,11 @@ Nothing deprecated or aliased: `SocialLinks` keeps its name and barrel export; i
| Q9 | Where the translated social aria names live | **New `strings.social` block; `common.socialAriaLabels` deleted** | `src/data/social.ts` loses its `label`/`aria` fields; `strings.social.aria[id][lang]` becomes the single source; the unused `common.socialAriaLabels` (`strings.ts:106-110`) is removed in Step 9 |
| Q10 | Sheet overflow on a 375×667 phone | **Accepted — the sheet scrolls** | §3.3 rewritten with the measured 643px and the device table; `overflow-y: auto` + `overscroll-behavior: contain` are the answer. The two no-scroll levers (drop the "Menu" label → 620px; reverse Q6 → 595px) stay open as future decisions |
| Q11 | Order of the controls inside the Appearance group | **Theme first, then Theme color** — Mode row, Theme color row, Language row | Step 5's group markup and §3.1 anatomy swapped; the `.nav-palette-sheet` comment in Step 8 reworded. Sheet height unchanged (44 + 48 + 48 = same 643px closed); the palette submenu expanded inline above the Language row (§7). **Row order superseded by Q12 below; the "Theme before Theme color" intent survives — Language was inserted between them** |
| Q12 | Same order question, raised again after the build | **Theme color moves after Language — in the bar as well as the sheet** | Supersedes Q11's row order. Bar `.nav-actions`: theme toggle → language toggle → `ThemePaletteMenu variant="nav"` → hamburger. Sheet Appearance group: Mode → Language → Theme color. §3.1, Step 5, the Step 8 comment, §7 and §11 updated. Closed height unchanged (643px); the submenu now expands inline at the end of the group, so opening it no longer pushes the Language row down |
| Q12 | Same order question, raised again after the build | **Theme color moves after Language — in the bar as well as the sheet** | Supersedes Q11's row order. Bar `.nav-actions`: theme toggle → language toggle → `ThemePaletteMenu variant="nav"` → hamburger. Sheet Appearance group: Mode → Language → Theme color. §3.1, Step 5, the Step 8 comment, §7 and §11 updated. Closed height unchanged (643px); the submenu now expands inline at the end of the group, so opening it no longer pushes the Language row down. **Row order superseded by Q15 below, which puts Language back last** |
| Q13 | Post-build: how the palette control should be drawn | **Bar: icon-only dropdown** (swatch + chevron, no text). **Sheet: the Mode/Language segmented-row style, options listed as colour icons — one per colour schema** | `ThemePaletteMenu` becomes bar-only: `variant` prop and the `nav-palette-{nav,sheet}` class pair removed, trigger renders the 16px swatch + chevron only, panel `id="palette-menu"`. `MobileMenu` renders the palette row itself from `paletteIds` × `paletteMeta` using `.mobile-menu-swatch-option` (44px, same border/radius/transition as `.mobile-menu-segment-option`) with the existing `.nav-palette-preview` dot as the colour icon, `aria-pressed` + translated `aria-label` + `title` hint. `.nav-palette-sheet` (5 rules) and `.nav-palette-group` are deleted, `.nav-palette-swatch` 14 → 16px. Closed sheet 643 → 647px (§3.3); the "submenu inside the sheet" edge case is replaced by "submenu from the bar while the sheet is open" (§7) |
| Q14 | Post-build: what the bar looks like at ≤1024px | **Keep the palette control in the bar at every width, and give the three bar controls one shared chrome** | `ThemePaletteMenu`'s trigger becomes `nav-control nav-palette-trigger` and the chevron svg is deleted; `theme-toggle` and `lang-toggle` join `.nav-control` (`src/App.css:91-116`) — bordered 44px box, accent border + text on hover/open, one `:focus-visible` — leaving `.lang-toggle` only its 13px/600 glyph step (`:119-123`), which moved out of `src/index.css`. `.nav-palette-swatch` becomes a 20px half-circle: active palette's accent on the left, `--swatch-empty: #ffffff` on the right (`src/index.css:151`), so the icon reads in both themes. The ≤1024px `.nav-palette` hide rule added while wiring Q13 is deleted, and `@media (max-width: 420px)` (`src/App.css:305-313`) keeps logo + 4×44 + 3×12 = 262px inside 288px of content at 320px (§3.4). §3.1, §3.4, §7, §8, §9 and §11 updated |
| Q15 | Post-build, a third time: the order of the three appearance controls | **Mode, Theme, Language — Language moves to the end in the bar *and* in the sheet** | Supersedes Q12. Bar `.nav-actions`: mode toggle → `ThemePaletteMenu` → language toggle → hamburger (`Navigation.tsx:84-111`). Sheet Appearance group: Mode row → Theme color row → Language row (`MobileMenu.tsx:71-132`). §3.1 anatomy, §3.4, §11, `spec-ui-layout.md` and `AGENTS.md` updated. Height arithmetic unchanged — the same three 48px segments in a new order, so the 647px total and the §3.3 device table still hold. **Superseded by Q16 below** |
| Q16 | Order, a fourth time: which control leads | **Language first** — Language → Mode → Theme in the bar *and* in the sheet; the hamburger stays last in the bar | Supersedes Q15. Bar `.nav-actions`: language toggle → mode toggle → `ThemePaletteMenu` → hamburger (`Navigation.tsx:84-111`). Sheet Appearance group: Language row (`:71-91`) → Mode row (`:93-113`) → Theme color row (`:115-132`) in `MobileMenu.tsx`. §3.1 anatomy, §3.4, §9's smoke row, §11, `spec-ui-layout.md`, `AGENTS.md` and `spec-v3-theme-palette-switch.md` updated. Markup-only again — no CSS rule keys off child order (`.nav-actions` is a flex row with a gap, the segments are block rows), so the 320px arithmetic and the 647px sheet height are unchanged |
---
@@ -799,8 +801,8 @@ Nothing deprecated or aliased: `SocialLinks` keeps its name and barrel export; i
- [ ] The sheet animates in **and** out; `@keyframes slideIn` no longer exists.
- [x] Active route identifiable without colour: 2px left bar + `aria-current="page"`.
- [ ] `role="dialog"` is honest: `aria-modal="true"`, focus into the sheet on open, back to the hamburger on close **when the hamburger is rendered**, `Escape` closes from any focus position (document-level listener), and `#main-content`, `.footer` **and `.back-to-top`** are `inert` while open.
- [x] Appearance group renders in this order: Dark/Light segmented control, then the English/Tiếng Việt segmented control, then the Theme color row, which since Q13 is a segmented row of colour-icon buttons (`paletteIds`, one per schema) rather than a dropdown trigger; the bar carries the same order with the palette as an icon-only trigger — theme toggle, language toggle, palette icon. Changing any one of them updates its twin, and no control holds local state.
- [x] The bar carries the palette control at every width, in the order mode → language → theme color → hamburger, with the three controls sharing one `.nav-control` chrome (44px bordered box, accent border + text on hover/open, a single `:focus-visible` rule); the trigger is the 20px half-circle swatch — no text, no chevron — named by `aria-label` ("Theme: Red") with `title` ("Switch theme color"). `@media (max-width: 420px)` keeps that row inside 320px. Proven by the two new §9 SSR bar assertions
- [x] Appearance group renders in this order (Q16): the English/Tiếng Việt segmented control, then the Dark/Light segmented control, then the Theme color row — a segmented row of colour-icon buttons (`paletteIds`, one per schema, since Q13); the bar carries the same order with the palette as an icon-only trigger — language toggle, mode toggle, palette icon, then the hamburger. Changing any one of them updates its twin, and no control holds local state.
- [x] The bar carries the palette control at every width, in the order language → mode → theme color → hamburger (Q16), with the three controls sharing one `.nav-control` chrome (44px bordered box, accent border + text on hover/open, a single `:focus-visible` rule); the trigger is the 20px half-circle swatch — no text, no chevron — named by `aria-label` ("Theme: Red") with `title` ("Switch theme color"). `@media (max-width: 420px)` keeps that row inside 320px. Proven by the §9 SSR bar assertions
- [x] Panel is `color-mix(in srgb, var(--bg-surface) 94%, transparent)` + `backdrop-filter: blur(12px)`, and the §9 glass contrast gate passes in all four palettes.
- [x] `.nav` background is `color-mix(in srgb, var(--bg-surface) 94%, transparent)` (was 85%, `src/App.css:6`), and the §9 bar contrast gate passes in all four palettes.
- [x] Closing on navigation happens in exactly one place; oxlint drops from 20 to 19 finding lines (11 errors / 8 warnings).
@@ -836,9 +838,9 @@ Eleven criteria are proven by the automated checks in §12 and three more (the 2
| Step 2 `src/data/social.ts` + `SocialId` | DONE — `id/href/external` only (12 lines); `SocialId` at `src/types/index.ts:5` |
| Step 3 `SocialLinks` rewrite + Hero/Footer cutover | DONE — 51-line prop-less component, icons keyed by `SocialId`, `target`/`rel` only for `external`; Hero's 35-line inline array deleted (Hero 138 lines), Footer 37 lines; the `SocialLink` interface is gone |
| Step 4 strings | DONE — 11 keys at `src/i18n/strings.ts:11-21`, `strings.social` at `:23-30`, `common.socialAriaLabels` deleted |
| Step 5 `MobileMenu.tsx` | DONE — 144 lines, no key handler anywhere; Appearance order Mode → Language → Theme color (Q12) verified in the rendered markup; Q13 renders the palette row inline from `paletteIds.map` (swatch buttons, `aria-pressed`, `nav-palette-preview`) instead of mounting `ThemePaletteMenu` |
| Step 5 `MobileMenu.tsx` | DONE — 144 lines, no key handler anywhere; Appearance order Mode → Language → Theme color (Q12) verified in the rendered markup — **superseded by Q15, then Q16**; Q13 renders the palette row inline from `paletteIds.map` (swatch buttons, `aria-pressed`, `nav-palette-preview`) instead of mounting `ThemePaletteMenu` |
| Step 6 `RollingTextLink` `aria-current` + `ref` | DONE — `ariaCurrent` / `ref` props at `:24-25`, forwarded to `<Link>` at `:76-80`; 126 lines |
| Step 7 `Navigation.tsx` rewiring | DONE — 154 lines: `navPaths` import, `triggerRef` + `closeMenu` with the `offsetParent` guard, one effect doing body-lock + `inert` ×3 + document `Escape`, a `matchMedia('(max-width: 1024px)')` effect, `AnimatePresence mode="wait"` icon morph, `aria-controls="mobile-menu"`, translated hamburger label, route-change effect deleted, inline sheet replaced; `.nav-actions` order is theme toggle → language toggle → palette → hamburger (`:84-112`) |
| Step 7 `Navigation.tsx` rewiring | DONE — 154 lines: `navPaths` import, `triggerRef` + `closeMenu` with the `offsetParent` guard, one effect doing body-lock + `inert` ×3 + document `Escape`, a `matchMedia('(max-width: 1024px)')` effect, `AnimatePresence mode="wait"` icon morph, `aria-controls="mobile-menu"`, translated hamburger label, route-change effect deleted, inline sheet replaced; `.nav-actions` order is theme toggle → language toggle → palette → hamburger (`:84-112`) — **superseded by Q15, then Q16** |
| Step 8 CSS | DONE — `src/App.css` 1919 lines at Q13, 1908 after Q14: `.nav` 94% with the contrast comment at `:2-4`; sheet block written from Step 8 (48px rows, `--text-lede` links, `--text-meta` heading with `line-height: 1`, 12px group padding/margin with one hairline per group and `:last-child` cleared, `padding: 24px 24px calc(24px + env(safe-area-inset-bottom))`, `.mobile-menu-inner` capped at `var(--max-content)`), the `@media (min-width: 1025px)` guard, `.mobile-menu.open` + `@keyframes slideIn` deleted; Q13 adds `.mobile-menu-swatch-option` and a ≤1024px `.nav-palette` hide rule; Q14 adds `.nav-control` (`:91-116`), `.lang-toggle` (`:119-123`) and the `@media (max-width: 420px)` bar guard (`:305-313`), and deletes that hide rule. Line numbers in this row are Q13-era; current positions are sheet block `:140-291`, 1025px guard `:315-319`, palette block `:321-340`. `vite build` green — CSS 33.39 kB at Q13, 32.84 kB after Q14 |
| Step 9 removals | DONE — `.nav-palette-sheet` was trimmed **in place** at `src/App.css:419-421` (`display: block` only) rather than overridden earlier in the file, where the same-specificity rule downstream wins the cascade; `.social-link span { display: none }` deleted; `≤768px` centering scoped to `.hero .social-links, .footer .social-links`; `ThemePaletteMenu.tsx` Escape calls `stopPropagation()` **only while the submenu is open**, because React's synthetic `stopPropagation()` also stops the native event and would otherwise swallow the sheet's Escape when the submenu is closed. Q13 then deletes `.nav-palette-sheet` and `.nav-palette-group` outright (34 lines) |
| §9 verification gates | DONE — `tsc -b` exit 0; oxlint **19** findings (11 errors / 8 warnings, down from 20); hex/rgba in `App.css` **0**; `slideIn` **0**; inline `fontSize`/`lineHeight`/`color` **0**; dead-class gate (`nav-palette-sheet`, `nav-palette-group`, `nav-palette-current` in `src/App.css` and `src/components/layout/`) **0**; SSR smoke **15/15** assertions (closed sheet renders nothing, dialog semantics, 3 group headings, 6 rows, one `aria-current="page"`, 4 text + 2 swatch options with exactly 3 `aria-pressed="true"`, Mode→Language→Theme color order, palette row as last child, icon-only bar trigger with its accessible name intact, 6 social tiles, `mailto:` without `target`/`rel`); `vite build` 544 modules; `pnpm build:resume-all` unchanged (`dist/resume.pdf`, `dist/resume-vi.pdf`) — re-run after Q14 in the row below |
@@ -849,6 +851,8 @@ Eleven criteria are proven by the automated checks in §12 and three more (the 2
| Cascade defect found while wiring Q13 | DONE (found by static review, not by the browser pass) — the pre-Q13 rule `.nav-palette-nav { display: none }` (`src/App.css:289`) never applied: the wrapper carried both classes and `.nav-palette { display: flex }` sat **later** in the file at the same specificity (0,1,0), so the bar's palette control was visible at ≤1024px beside the hamburger, duplicating the sheet's Theme color row. The dead selector was deleted and the hide rule moved after the `.nav-palette` block. **Q14 then deleted that hide rule too** — the bar control is meant to render on phones — so no `.nav-palette` display rule exists inside the ≤1024px block today (verified: the block holds only `.nav-menu` and `.mobile-menu-btn`, `src/App.css:293-301`) |
| Owner follow-up Q14 — palette control in the bar at every width, one shared `.nav-control` chrome | DONE — `ThemePaletteMenu.tsx:29-40` (trigger `nav-control nav-palette-trigger`, chevron svg deleted, one 20px half-circle swatch, name in `aria-label`, hint in `title`), `Navigation.tsx:85,103` (`nav-control` on the mode and language controls), `src/App.css:91-116` shared chrome + hover/open + focus, `:119-123` `.lang-toggle` glyph step imported from `src/index.css` (file 368 → 351 lines), `:305-313` ≤420px guard, `:331-340` half-circle swatch using `--swatch-empty` (`src/index.css:146-152`), ≤1024px `.nav-palette` hide rule deleted; §3.1, §3.4, §7, §8, §9, §10 and §11 updated here, and `spec-ui-layout.md:103-104` + `AGENTS.md` Theming corrected |
| §9 gates re-run after Q14 (2026-10-17) | DONE — `tsc -b` exit 0; oxlint **19** finding lines (11 errors / 8 warnings); hex/`rgba(` in `src/App.css` **0**; `slideIn` **0**; dead-class gate **0**; inline `fontSize`/`lineHeight`/`color` **0**; SSR smoke **16/16** — the 15 Q13-era assertions plus two new bar assertions (control order mode → language → theme color → hamburger; trigger renders no text node but keeps `aria-label="Theme: Red"` + `title="Switch theme color"` + `aria-expanded` + the swatch, no chevron); `vite build --outDir dist-verify` 544 modules, CSS 32.84 kB, deleted after |
| Owner follow-up Q15 — Mode → Theme → Language, in the bar and in the sheet | DONE 2026-10-17 — `Navigation.tsx:102-111` (palette control moved ahead of the language button) and `MobileMenu.tsx:93-132` (Theme color segment moved ahead of the Language segment); §3.1 anatomy, §3.4, §10 Q15, §11 criteria, `spec-ui-layout.md:103,106,115` and `AGENTS.md` Theming corrected. Re-verified: `tsc -b` exit 0; oxlint **19** finding lines; hex/`rgba(` in `src/App.css` **0**; throwaway SSR smoke **8/8**; `vite build --outDir dist-verify` green then deleted. **Superseded the same day by Q16 below** |
| Owner follow-up Q16 — Language first: Language → Mode → Theme | DONE 2026-10-17 — `Navigation.tsx:84-111` (language button first, mode toggle second, `<ThemePaletteMenu />` third at `:111`) and `MobileMenu.tsx:71-132` (Language segment `:71-91`, Mode `:93-113`, Theme color `:115-132`); §3.1 anatomy, §3.4, §9's smoke row, §10 (Q15 note + Q16), §11 criteria, `spec-ui-layout.md:103,106,115`, `AGENTS.md` Theming and `spec-v3-theme-palette-switch.md:242,244,466` corrected. Re-verified: `tsc -b` exit 0; oxlint **19** finding lines; hex/`rgba(` in `src/App.css` **0**; inline `fontSize`/`lineHeight`/`color` **0**; throwaway SSR smoke **8/8** — bar order lang-toggle (2425) < theme-toggle (2534) < palette-trigger (2974) < hamburger (3729), sheet segment labels `Language \| Mode \| Theme` with the swatch row last, three `aria-pressed="true"` groups intact, 6 nav links with one `aria-current="page"`; `vite build --outDir dist-verify` green then deleted; script deleted after the run. Markup-only: no CSS rule keys off child order, so the 647px sheet total and the 320px bar arithmetic still hold |
| Owner browser pass | TODO |
---
@@ -25,9 +25,9 @@ Request 3 is not a navigation-bar item. The buttons in question are `.btn-primar
| Fact | Evidence |
|---|---|
| The language control is a text glyph: `{lang === 'en' ? 'VI' : 'EN'}` inside `nav-control lang-toggle` | `src/components/layout/Navigation.tsx:102-109` |
| The language control is a text glyph: `{lang === 'en' ? 'VI' : 'EN'}` inside `nav-control lang-toggle` | `src/components/layout/Navigation.tsx:84-91` |
| `.lang-toggle` sets `font-size: 13px; font-weight: 600; letter-spacing: 0.5px` | `src/App.css:119-123` |
| The bar's other two controls are icon-only (inline sun/moon SVG; the half-circle swatch), so the language control is the only text control in the bar | `Navigation.tsx:84-100`, `:111`, `src/App.css:331-340` |
| The bar's other two controls are icon-only (inline sun/moon SVG; the half-circle swatch), so the language control is the only text control in the bar | `Navigation.tsx:93-109`, `:111`, `src/App.css:331-340` |
| `public/icons.svg` holds social symbols only (`github-icon`, `x-icon`, …); every bar icon is inline SVG | `grep id= public/icons.svg` |
| The palette trigger is `<span className="nav-palette-swatch" aria-hidden="true" />` — a plain span, no motion, **no `transition` declared** | `ThemePaletteMenu.tsx:39`, `src/App.css:333-340` |
| The swatch is `linear-gradient(to right, var(--accent) 0 50%, var(--swatch-empty) 50% 100%)`, 20×20, `border-radius: 50%` | `src/App.css:333-340` |
@@ -239,8 +239,9 @@ One component, two placements, chosen by media query. No floating sheet that can
| Width | Trigger | Options |
|---|---|---|
| > 1024px | in `.nav-actions`, between the theme toggle and the language toggle | absolute panel under the trigger, right-aligned to it |
| > 1024px | in `.nav-actions`, after the mode toggle — last of the three appearance controls | absolute panel under the trigger, right-aligned to it |
| ≤ 1024px | a block at the bottom of `.mobile-menu`, after the nav links — 44px tap targets | the options are **inline in the mobile sheet**, not a second overlay |
> **Superseded 2026-10-17 by Q13–Q16 of `spec-v3-mobile-navigation.md`:** the `variant` split described below is gone. One bar-only trigger renders at **every** width (no ≤1024px hide rule, Q14), the sheet draws its own Theme color row from `paletteIds` (Q13), and the bar order is language → mode → theme color → hamburger (Q16). §7 shows the shipped component; `AGENTS.md` Theming and `specs/ui/spec-ui-layout.md:103-106` carry the current wording.
**Why 1024px, not 768px.** `.nav-menu` is hidden and `.mobile-menu-btn` appears at `@media (max-width: 1024px)` (`src/App.css:176-184`). Using the same breakpoint means *whatever collapses into the sheet collapses together*. A 768px palette breakpoint would leave a 769–1024px band where the page links hide behind a hamburger while a color menu sits in the bar — two navigation idioms at the same time. Cost of the choice: at 800px the palette costs two taps instead of one. Alternative if the owner wants one tap: keep 768px and hide the label (`.nav-palette-current { display: none }`) down to 1024px — the bar fits comfortably there; crowding is only a risk *below* 1024px, which is where the hamburger already lives. Not taken: the shipped build collapses at 1024 with the links.
@@ -462,7 +463,7 @@ Shipped as specified in §6: `variant: 'nav' | 'sheet'`, local `open` state, `co
### Step 6 — `src/components/layout/Navigation.tsx`
- Nav variant after the theme toggle: `Navigation.tsx:76`, inside `.nav-actions`, before the language toggle (`:78-85`).
- Nav variant after the mode toggle: `Navigation.tsx:111`, inside `.nav-actions`, the last of the three appearance controls ahead of the hamburger — the order was re-pinned by Q16 of `spec-v3-mobile-navigation.md` (language → mode → theme color → hamburger).
- Sheet variant after `</ul>` inside `.mobile-menu`: `Navigation.tsx:125`, mounted as `<ThemePaletteMenu key={location.pathname} variant="sheet" />` so navigation remounts it closed.
- No new state in `Navigation`; the menu owns its own open state.