batchCooking/apps/web/src/pages/HomePage.scss
Nicolas ac7f8d9685 Web: HomePage becomes the weekly planning view (step 4/5)
- ApiClient.getCurrentPlanning() — GET /planning/current.
- HomePage.tsx: replaces the old greeting card (now redundant with
  AppLayout's sidebar) with the household's current planning — loading /
  error / empty ("aucun planning pour cette semaine") / loaded (table of
  weekDay/meal/recipe) states, modeled as a discriminated union so an
  impossible combination (e.g. loading with data) can't be represented.
  No invented weekday/meal grid — the API's `weekDay`/`meal` are free-form
  strings (no enum exists yet in the schema), so this renders the items
  as returned rather than assuming a specific vocabulary.
- locales/fr/translation.json: home.* replaced (title/loading/error/
  empty/table.*), old greeting/logout keys removed (superseded by
  layout.greeting/layout.logout from the AppLayout commit).
- cypress/e2e/auth.cy.ts: updated the now-stale "Bonjour Alice Martin"
  assertions (greeting moved to the sidebar, first name only) and added
  GET /planning/current intercepts so these specs don't depend on a real
  backend. Manually verified end-to-end against a real API in the browser
  preview (empty state + a seeded planning) — Cypress itself can't run
  headless Chromium in this sandboxed dev environment (confirmed
  pre-existing on main, unrelated to this change); CI runs the real
  suite.

Verified with `pnpm --filter web build` after each of steps 2-4 to keep
every commit in this sequence independently buildable.
2026-08-16 21:06:15 +02:00

56 lines
1.7 KiB
SCSS

// =============================================================================
// Styles specific to HomePage — colocated next to HomePage.tsx since nothing
// else uses these classes.
// =============================================================================
// No `@use` of the theme partial needed here: every design token below is a
// CSS custom property (--color-*, --space-*...) declared once on :root in
// styles/global.scss and available globally at runtime — not a Sass-level
// variable/mixin that would require an explicit compile-time import.
// No outer centering wrapper here (unlike the old version of this file):
// AppLayout's `.app-content` already owns the page background/padding —
// this is just the page's own content.
.home-page {
&__status {
color: var(--color-text-muted);
font-size: var(--font-size-md);
}
&__status--error {
color: var(--color-error);
}
}
// The current planning, one row per meal slot. Raised on its own surface,
// same card treatment used elsewhere in the app, so it reads as a distinct
// piece of content rather than bare text on the page background.
.planning-table {
width: 100%;
max-width: 40rem;
margin-top: var(--space-md);
border-collapse: collapse;
background: var(--color-surface);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--shadow-sm);
th,
td {
padding: var(--space-sm) var(--space-md);
text-align: left;
border-bottom: 1px solid var(--color-border);
}
th {
background: var(--color-surface-alt);
color: var(--color-text-muted);
font-size: var(--font-size-xs);
text-transform: uppercase;
letter-spacing: 0.04em;
}
tr:last-child td {
border-bottom: none;
}
}