Commit 5d394f2
Brand onboarding · cross-check review + Google search ingest + clickable cards + visible delete
The user-flagged trio of brand-page issues, all in one refactor.
1. Review-before-save flow (cross-check step)
Previously: paste URL → AI extracts → IMMEDIATELY saves to IndexedDB
and sets active. User had no chance to review what the AI got, and
any errors became the permanent brand voice for every generation.
Now: paste URL → AI extracts → ExtractionReview panel renders
between the ingest forms and the saved-brand list. Panel shows:
· Source label ("acme.com via Jina Reader" / "Pasted content" /
"Google search · 'Acme Tax'")
· N/M fields-filled count in the corner (e.g. 11/16)
· Field-by-field cross-check with three states per row:
✓ green-bar — filled
✗ red-bar — core field empty (business_name, industry,
niche, USP, tone, audience_who)
○ gray-bar — non-core field empty (fine to ship without)
· Core-empty warning banner when any core field is blank
· Social handles row when any platform handle was found
· Three actions:
"Looks good — save & activate" (primary, sets active brand)
"Edit before saving" (opens BrandBrainForm pre-filled)
"Discard" (drops the staged extraction)
2. Google-search ingest
New input block above the brand list. Uses Jina's s.jina.ai
endpoint (Google-results-as-markdown) so users can onboard a
client that has no website or whose site blocks scrapers.
Same staging flow as URL ingest — output goes through the
review panel.
3. Clickable brand cards + visible "ACTIVE" badge
Each saved brand card is now an entire clickable region (role="button"
with keyboard support). Click switches the active brand and emits
ados:brains-changed so the entire app updates immediately. The
currently active brand shows a yellow "✓ ACTIVE" pill, an orange
border with inset glow, and live-colored heading. Non-active cards
show "click to activate" hint text. Cards also surface the brand's
platforms + content_pillars as inline chips so users can audit
at-a-glance.
4. Prominent Delete button
Was a tiny trash icon hidden among ghost buttons. Now a bordered
red button with "Delete" text label, requires a confirm() dialog
("Delete X? You can undo from the toast for 7 seconds"). Edit and
Export got the same upgrade — bordered buttons with text labels,
stacked vertically on the right side of each card. Click bubble
stopped so action buttons don't also activate the brand.
5. New "Your clients (N)" header above the list with a hint:
"click a card to switch · entire app reflects the active client".
State plumbing
- New pendingExtraction state in BrandInner. stageBrain() helper
pivots the 3 ingest paths to all funnel through review.
- activeBrandId state mirrored from getActiveBrainId() so the
✓ ACTIVE pill updates without a refresh round-trip.
- activateBrand() updates both localStorage AND React state, then
fires the ados:brains-changed event GeneratorShell already listens
to for cross-tool auto-fill.
Verified: typecheck clean · 43 tests pass · production build clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7d00d74 commit 5d394f2
1 file changed
Lines changed: 382 additions & 89 deletions
0 commit comments