Rebuild layout per Codex's design review: sidebar nav, shared results panel

Codex (independent /codex consult) reviewed the prior card-grid layout
and called it an unstructured "starter dashboard" look: too much chrome
before the data, duplicated card containers competing for attention,
community size outweighing actual draw results, and a real bug —
CardHeader's base class is `grid`, so the `flex-row` override on
LotteryCard never applied.

Rebuilds around a shared data panel instead of isolated cards:
- CountryNav: 200px sidebar (desktop) / horizontal scroller (mobile),
  replacing pill-tab filters that read as tags rather than navigation
- LotteryResultsPanel + LotteryRow: one table-like panel with column
  headers (Loterie / Résultat / Choix / Score / Historique), not N
  separate bordered cards — makes draws directly comparable
- LotteryMobileCard: dedicated compact mobile layout, not a shrunk
  desktop row
- NumberSequence: shared ball component used by both layouts
- --success token, independent of --accent: a winning number is always
  green, never the country's accent color (previously a win in France
  would render in France's red, which reads as a loss)
- --primary now stays neutral, decoupled from --accent, so generic
  shadcn control states don't inherit a country's color as if it meant
  something semantically
- New surface/text palette (page/header/panel/divider tiers) replacing
  the flat near-black scale
- Redrawn LokiMark: clearer two-ear fox silhouette, legible at 20-24px

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-29 22:34:16 -04:00
co-authored by Claude Sonnet 5
parent 8621284cab
commit fc69d4a668
11 changed files with 352 additions and 283 deletions
+79
View File
@@ -0,0 +1,79 @@
"use client"
import Link from "next/link"
import { usePathname, useSearchParams } from "next/navigation"
import { COUNTRIES } from "@/lib/countries"
import { cn } from "@/lib/utils"
export function CountryNav({ active }: { active: string }) {
const pathname = usePathname()
const searchParams = useSearchParams()
function hrefFor(code: string) {
const params = new URLSearchParams(searchParams.toString())
params.set("country", code)
return `${pathname}?${params.toString()}`
}
return (
<nav aria-label="Sélection du pays" className="space-y-0.5">
{COUNTRIES.map((c) => {
const isActive = c.code === active
return (
<Link
key={c.code}
href={hrefFor(c.code)}
aria-current={isActive ? "page" : undefined}
className={cn(
"flex items-center gap-2.5 rounded-md border-l-[3px] py-2 pr-3 pl-2.5 text-[13px] font-medium transition-colors",
isActive
? "border-l-accent bg-panel-hover text-foreground"
: "border-l-transparent text-muted-foreground hover:bg-panel-hover/60 hover:text-foreground"
)}
>
<span aria-hidden className="w-5 shrink-0 text-center text-base leading-none">
{c.flagEmoji}
</span>
{c.name}
</Link>
)
})}
</nav>
)
}
export function CountryNavMobile({ active }: { active: string }) {
const pathname = usePathname()
const searchParams = useSearchParams()
function hrefFor(code: string) {
const params = new URLSearchParams(searchParams.toString())
params.set("country", code)
return `${pathname}?${params.toString()}`
}
return (
<nav
aria-label="Sélection du pays"
className="flex gap-1.5 overflow-x-auto pb-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
>
{COUNTRIES.map((c) => {
const isActive = c.code === active
return (
<Link
key={c.code}
href={hrefFor(c.code)}
aria-current={isActive ? "page" : undefined}
className={cn(
"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[13px] font-medium",
isActive ? "bg-accent-soft text-foreground" : "text-muted-foreground"
)}
>
<span aria-hidden>{c.flagEmoji}</span>
{c.name}
</Link>
)
})}
</nav>
)
}