feat(nav): Mode row in the sheet becomes icon-only with the bar's sun/moon

- Extract SunIcon/MoonIcon from the bar theme control into src/components/ui/icons.tsx
  (exact geometry and attributes, so the bar renders identically)
- MobileMenu Mode row: Dark option draws MoonIcon, Light draws SunIcon in the
  .mobile-menu-icon-option square the Language and Theme color rows use,
  aria-pressed + translated aria-label/title
- Delete .mobile-menu-segment-option (3 rule groups) from App.css — last user gone
- AGENTS.md picker paragraph, spec-v3-mobile-navigation.md (Q18 + progress row),
  spec-v3-i18n.md cross-reference updated
This commit is contained in:
dong.nguyen committed 2026-10-20 19:56:08 +07:00
1 parent 4d4fd066cc
commit 609067c6c9
7 files changed
+43 -42

No files matched your search

+12 -4
View File
@@ -9,6 +9,7 @@ import { strings } from '@/i18n/strings'
import { RollingTextLink } from '@/components/ui/RollingTextLink'
import { SocialLinks } from '@/components/ui/SocialLinks'
import { LanguageIcon } from '@/components/ui/LanguageIcon'
import { MoonIcon, SunIcon } from '@/components/ui/icons'
interface MobileMenuProps {
open: boolean
@@ -102,21 +103,28 @@ export function MobileMenu({ open, onClose }: MobileMenuProps) {
<div className="mobile-menu-segment">
<span className="mobile-menu-segment-label">{strings.nav.themeGroup[lang]}</span>
<div className="mobile-menu-segment-options" role="group" aria-label={strings.nav.themeGroup[lang]}>
{/* Icons, not words — the bar's own line art: moon for dark, sun for light.
An icon alone cannot name a mode, so each option carries the translated
mode name in aria-label and title. */}
<button
type="button"
className={resolvedTheme === 'dark' ? 'mobile-menu-segment-option active' : 'mobile-menu-segment-option'}
className={resolvedTheme === 'dark' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
aria-pressed={resolvedTheme === 'dark'}
aria-label={strings.nav.themeDark[lang]}
title={strings.nav.themeDark[lang]}
onClick={() => setTheme('dark')}
>
{strings.nav.themeDark[lang]}
<MoonIcon />
</button>
<button
type="button"
className={resolvedTheme === 'light' ? 'mobile-menu-segment-option active' : 'mobile-menu-segment-option'}
className={resolvedTheme === 'light' ? 'mobile-menu-icon-option active' : 'mobile-menu-icon-option'}
aria-pressed={resolvedTheme === 'light'}
aria-label={strings.nav.themeLight[lang]}
title={strings.nav.themeLight[lang]}
onClick={() => setTheme('light')}
>
{strings.nav.themeLight[lang]}
<SunIcon />
</button>
</div>
</div>
+2 -10
View File
@@ -8,6 +8,7 @@ import { navPaths } from '@/data/navigation'
import { RollingTextLink } from '@/components/ui/RollingTextLink'
import { ThemePaletteMenu } from '@/components/layout/ThemePaletteMenu'
import { LanguageIcon } from '@/components/ui/LanguageIcon'
import { MoonIcon, SunIcon } from '@/components/ui/icons'
import { MobileMenu } from '@/components/layout/MobileMenu'
import { ResumeNavButton } from '@/components/layout/ResumeNavButton'
@@ -150,16 +151,7 @@ export function Navigation() {
aria-label={`${strings.nav.themeSwitch[lang]} (${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]})`}
title={`${strings.nav.themeMode[lang]}: ${resolvedTheme === 'dark' ? strings.nav.themeDark[lang] : strings.nav.themeLight[lang]}`}
>
{resolvedTheme === 'dark' ? (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="5" />
<path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" />
</svg>
) : (
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</svg>
)}
{resolvedTheme === 'dark' ? <SunIcon /> : <MoonIcon />}
</button>
<ThemePaletteMenu />