Replace the UI with the Organic design handoff (docs/design_handoff_pansy_ui)
Build image / build-and-push (push) Successful in 31s
Gadfly review (reusable) / review (pull_request) Failing after 1s
Adversarial Review (Gadfly) / review (pull_request) Failing after 1s

The frontend is rebuilt screen by screen from the handoff: warm cream ground,
terracotta + sage accents, Caprasimo over Figtree, every control a pill. Same
React/Vite/TanStack stack and the same lib/ data layer; the presentation is new.

- Tokens: web/src/styles/index.css declares the handoff's styles.css variables
  through Tailwind's @theme under the same names; dark mode is those variables
  overridden on <html> by the handoff's pansy-theme.js, inlined in index.html
  so it runs before first paint. Lucide glyphs at stroke 2.75; a small pill kit
  (Button, Dialog, Field, Seg, Toggle, Tag, toast).
- Login / Register: the centered column over soft accent circles; OIDC button
  and signup footer still follow /auth/providers.
- Gardens: cards with a real SVG plot thumbnail (objects + plant-colored dots
  from /full), a `plan` tag for "<name> — <year>" copies, shares line, Open +
  share/copy/edit/delete; New garden / Share / Plan-a-season dialogs.
- Plants: monogram markers derived from the name (collision-resolved across the
  catalog — replaces emoji icons), category chips, expandable lot cards, the
  scan-packet flow as a two-step dialog that never auto-creates.
- Settings: Appearance (theme seg), Who gets in (read-only sign-in config),
  Garden assistant (self-saving toggle + chat/vision model fields), You.
- Editor: a new canvas with the prototype's pointer model (wheel-to-cursor,
  pinch about the centroid, 3″ snap, one PATCH per drop, semantic-zoom
  monograms/labels), plus corner resize handles; desktop three-card workspace
  (toolkit | plan | rail with Plot/Journal/History/Assistant) and, below 760px
  of container width, the phone chrome (header, peek panel, tool strip, mode
  bar). Seasons as a segmented control over the years with data plus plan
  copies; Undo re-reads history before reverting the newest step.
- Public read-only view and the register page restyled to match.
- GET /settings gains a read-only `auth` view (registration mode, local auth,
  OIDC issuer) so the Settings page can show what's in force.
- README / DESIGN.md / CLAUDE.md updated; @use-gesture/react dropped.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-08-22 19:12:29 -04:00
co-authored by Claude Fable 5
parent 18b36870d4
commit 52b2c09a9e
111 changed files with 6621 additions and 7215 deletions
+36
View File
@@ -72,6 +72,42 @@ handler, put it in the service instead.
Frontend: React 19 + Vite + Tailwind 4 + TanStack Router/Query, built into
`internal/webdist/dist` and embedded with `embed.FS`.
## The look comes from a handoff — don't improvise it
The frontend implements `docs/design_handoff_pansy_ui/` (read its README before
touching anything visual; the `.dc.html` files there are references, not code).
Conventions that follow from it:
- **Tokens live in two places, on purpose.** Light values in
`web/src/styles/index.css` (`@theme`, same names as the handoff's
`styles.css`); dark values ONLY in the bootstrap script in `web/index.html`.
A new color goes in both; a raw hex in a component is wrong. Tailwind's shadow
utilities inline their values and can't follow the runtime override — use
`.elev-sm/md/lg` instead.
- **The component classes are in index.css** (`.btn`, `.input`, `.tag`, `.seg`,
`.toggle`, `.chip`, `.panel`, `.dialog`). Use them with Tailwind utilities for
layout rather than restyling a pill from scratch.
- **The editor's breakpoint is container width** (`PHONE_BREAKPOINT` = 760 in
`web/src/editor/shared.ts`, measured with a ResizeObserver), not a media
query. One component tree, two chromes; don't build a second page.
- **Plant markers are monograms** derived from the name (`web/src/lib/monogram.ts`);
the collision set is the whole catalog so the letters match everywhere.
`plant.icon` still exists in the API but nothing renders it.
- **Season plans are a naming convention** (`web/src/lib/plan.ts`): a copy named
`<garden> — <year>` is that garden's plan. The API keeps no link; renaming the
copy quietly makes it a plain garden, which is fine.
- **Tap-to-place makes a one-plant plop** (radius = spacing/2, per the handoff);
"Fill the bed" (rows / clumps) is the bulk tool. Fill geometry still follows
the clump rules below — different tools, not a conflict.
- **Undo in the header re-reads history before reverting.** The cached list
trails the canvas right after a placement, and undoing the step *before* the
one you meant is the worst thing an undo button can do. Keep it that way.
- **Checking a change against the handoff:** run the API on a scratch DB
(`PANSY_PORT=8099 PANSY_DB=/tmp/x.db GOWORK=off go run ./cmd/pansy`) plus
`PANSY_PORT=8099 npx vite` in `web/`, seed through the API, and drive the
Playwright MCP at 1280×800 and 390×844. Its screenshots must be named under
`.playwright-mcp/` (gitignored) or it writes them into the repo root.
## Conventions that bite if you miss them
- **Everything is centimeters**, stored as SQLite `REAL`. Imperial is a display