SDCC Stories
repo: ~/Projects/SDCC-Stories · 5 commits · 0 in last 24h, 0 in last 7d ·
Skills used
- /candidates1
- /search1
- /token1
- /index1
- /styles1
- /app1
- /deploy1
Creative ideas + design notes
Commits with substantial prose (≥120 chars) — the rationale behind each move.
dbfa7ca · 2026-06-01 · Global search across candidates + stories + settings
Add a unified search bar to the SDCC-Stories admin header. Replaces the
narrow ?search= filter on /api/candidates (which only hit 3 columns)
with cross-table coverage.
server.js
GET /api/search?q=<query>&limit=25 — searches:
· candidates (name, email, zip, story, key_quote, demographics,
district, representative, story_category, press_pitch_angle,
story_type, tier — 18 LIKE columns)
· stories (one_liner, instagram_caption, x_post, hashtags,
story_category, lane, status)
· settings (key + value — credential values masked as
'(set — N chars)' for keys matching /token|secret|password|key$/i)
Returns unified {results, query, counts, total} grouped by type.
public/index.html
Add header-center search input + results panel.
public/css/styles.css
.global-search-* styles matching the existing light theme.
public/js/app.js
Debounced 220ms search → fetch → grouped render.
Cmd+K / Ctrl+K focuses input. Esc closes. Arrow keys + Enter.
Click-through: candidate → switchTab + openCandidate;
story → switchTab + scroll-into-view;
setting → switchTab('settings').
Story cards get data-story-id so the scroll-into-view works.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
File tree
15 files tracked. Click any to browse the source at HEAD.
rendered in 0ms