Repository navigation
feat(prompts): Query Fan-out — By prompt grouped view with expandable… - #358
Conversation
gkhngyk
left a comment
There was a problem hiding this comment.
Really clean work — the shared components (TrackCell / EngineBadges / IntentBadge), the useMemo inversion for the By prompt view, the expandable rows, keeping the pagination + setPage(1), and the seed.sql fan-out data all look great. 🎉
One fix before merge: in ByPromptView, groups.map(...) returns a bare <> fragment with no key, which triggers React's "unique key" warning (the inner TableRow keys don't satisfy the map's root element). Please switch it to <Fragment key={prompt.id}>…</Fragment> (import Fragment from react).
Everything else LGTM — ping me once that's in and I'll re-review.
Heads-up on sequencing: this touches _fanout-tab.tsx (same as PR #357, still open), so whichever merges second will need a small rebase.
541fe7b to
38f3dd3
Compare
|
Hi @gkhngyk , I've rebased the branch on top of main and resolved the conflicts. Also applied the fix you suggested — replaced <> with in ByPromptView's groups.map() so the key is now on the root element. Please review and let me know if anything needs attention! |
gkhngyk
left a comment
There was a problem hiding this comment.
Thanks — the Fragment key fix is in (<Fragment key={prompt.id}>, no more React key warning). I re-ran everything in an isolated worktree: typecheck, Prettier, and the fanout tests all pass, and the rebase correctly keeps the pagination (#355), the intent column (#353), and the onTracked wiring (#357) while adding the By-prompt grouped/expandable view. Clean work — LGTM! 🎉
Summary
On the Prompts page → Query Fan-out tab, the view showed a single flat list of sub-queries with no way to see which tracked prompts drove the most fan-out. Added a By prompt toggle that pivots the same data — one collapsible row per prompt, expanding to reveal the sub-queries that prompt's answers actually triggered. The "High frequency" flat list is unchanged; the two lenses share the tab via a segmented toggle.
Data is derived client-side by inverting the existing
sourcedPromptsarray on eachFanoutSubQuery— no new server action or DB columns required.Also adds fan-out seed data to
supabase/seed.sqlso the tab is populated on a localdb reset.Related issue
Closes #350
Type of change
feat— New featureChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn format:checkpasses (run fromweb/)