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
+56
View File
@@ -0,0 +1,56 @@
import { NumberSequence } from "@/components/number-sequence"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
export function LotteryMobileCard({ entry }: { entry: LotteryFeedEntry }) {
const { lifetime, lastDraw } = entry
const resultSet = new Set(lastDraw?.result ?? [])
return (
<div className="space-y-2.5 border-b border-border/60 p-3 last:border-b-0">
<div className="flex items-center justify-between">
<p className="font-semibold">{entry.name}</p>
{lifetime.picksTracked > 0 ? (
<p className="text-xs text-muted-foreground">
<span className="font-semibold text-foreground tabular-nums">
{(lifetime.winRate * 100).toFixed(0)}%
</span>{" "}
sur {lifetime.picksTracked}
</p>
) : (
<p className="text-xs text-muted-foreground">Nouveau</p>
)}
</div>
{lastDraw ? (
<>
<div>
<p className="mb-1 text-xs text-muted-foreground">
Résultat du {formatDate(lastDraw.date)}
</p>
<NumberSequence numbers={lastDraw.result} />
</div>
{lastDraw.pick ? (
<div>
<p className="mb-1 text-xs text-muted-foreground">
Choix pour ce tirage —{" "}
<span className={lastDraw.won ? "font-semibold text-success" : ""}>
{lastDraw.matched} / {lastDraw.result.length}
</span>
</p>
<NumberSequence numbers={lastDraw.pick} hitSet={resultSet} />
</div>
) : (
<p className="text-xs text-muted-foreground">Aucun choix pour ce tirage.</p>
)}
</>
) : (
<p className="text-xs text-muted-foreground">Aucun tirage disponible.</p>
)}
</div>
)
}
function formatDate(iso: string): string {
const d = new Date(iso + "T00:00:00")
return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" })
}