Commit Graph

6 Commits

Author SHA1 Message Date
Matthew Meszaros 337d823703 merge: bring main into branch, reconcile email service constructor 2026-05-24 04:09:16 +00:00
Matthew Meszaros 45f48ba93b feat: redesign email account onboarding flow 2026-05-24 04:01:16 +00:00
Matthew Meszaros abf73d168b fix: dropdowns + folder/tag create (server-side + client-side)
Two real bugs surfaced from "All folders / Newest dropdowns don't open"
and "hex color must be a valid string":

1) Dropdowns silently no-op (broken across the whole dashboard)
   PopoverMenuTrigger asChild uses React.cloneElement to inject
   onClick / ref / aria-expanded onto the trigger child. SelectButton
   was a plain function component that destructured a fixed prop set
   and rendered its own <button> — so the injected props were
   dropped on the floor. Click did nothing.

   Fix: SelectButton is now React.forwardRef + spreads {...rest} onto
   the inner button. The injected click handler reaches the real
   element, the dropdown opens, the menu renders, and selection
   actually applies state.

   Every PopoverMenu trigger using SelectButton was affected — that's
   campaigns (folders + sort), emails (tag filter), contacts (sort +
   filters page rows). All now work.

2) Adding a folder/tag failed with "hex color must be a valid string"
   The /folders + /tags POST landed on groupRepository.Create with
   an empty color and the validator rejected. Even before the color
   check, the INSERT used tx.QueryRow + Scan against an INSERT with
   no RETURNING clause, which always errored with
   "sql: no rows in result set" once it got past validation.

   API improvements (kept the design but made it forgiving):
   - Color defaults: if the request omits color, the server picks one
     from an 8-swatch palette based on the new item's position. Two
     consecutive creates won't end up identical. Non-empty but
     invalid still 400s — that's a client bug worth surfacing.
   - Title min length 3 → 1. "Q1", "VIP", short names are common
     and shouldn't fail. Trimmed before validation so " " doesn't
     pass.
   - INSERT now uses tx.Exec instead of QueryRow.Scan — the broken
     code would never reach success even when validation passed.

   Verified end-to-end:
     POST /folders {"title":"Q1"} → 200, color=#94a3b8 (default).
     POST /folders {"title":"Q2","color":"#38bdf8"} → 200.
     POST /tags    {"title":"VIP","color":"#10b981"} → 200.

   Frontend:
   - createFolder / createTag clients accept an optional color param.
   - LabelListModal now picks a default palette color when entering
     add-row mode (rotating with item count) and offers a swatch
     popover to override before submitting. Selected color is sent to
     the backend.
2026-05-23 09:18:45 +00:00
Matthew Meszaros d8d88c7f69 feat: add warmup health tracking, migrate repos to postgres, and overhaul web UI 2026-04-03 06:08:52 +00:00
Matthew Meszaros 6c6d26d8f0 Update auth and onboarding flow 2026-02-14 05:38:27 +01:00
Matthew Meszaros 772c19820d New Repository: Add Backend Code 2026-01-17 14:11:14 +00:00