You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(prompts): Query Fan-out track flashes the whole table to a skeleton instead of flipping just the row #346
On the Prompts page → Query Fan-out tab, clicking + (Track) on a row makes the whole table flash to a loading skeleton and back before the row shows Tracked ✓. It looks like the page reloads on every track. Expected: clicking + flips just that row to Tracked ✓ instantly, with no skeleton and no full-table reload.
Root cause (from the code)
The track handler re-runs the same fetch used for the initial load, and that fetch flips the whole tab into its skeleton state.
handleTrack() calls await trackFanoutQuery(...) then await load().
load() starts with setLoading(true), and the render is {loading ? <five Skeleton rows> : <table>} — so the entire table is replaced by skeletons until the refetch resolves, then swaps back.
So the skeleton flash is the initial-load spinner being reused for a post-track refresh.
Proposed change
Make the track update local and skeleton-free — mark only the acted row as tracked instead of re-fetching the whole tab:
On a successful trackFanoutQuery(...) (which returns { promptId }), update the row in local data state: set tracked: true and trackedPromptId to the returned id, so it flips to Tracked ✓ immediately.
Drop the await load() from handleTrack (no skeleton, no refetch). Keep the addingKey spinner on the + button itself while the server action is in flight (that part is already fine).
If a refresh of the aggregation is still wanted after tracking, do it silently (a background refetch that does not toggle the loading/skeleton state), not via the initial-load path.
Thanks @Sam-syntax35 — assigned to you! 🎉 The fix is to drop the await load() from handleTrack in _fanout-tab.tsx and instead flip just the tracked row in local state (set tracked: true + trackedPromptId from what trackFanoutQuery returns), keeping the inline spinner on the + button.
Heads-up: #345 (assigned to @AyushSrivastava1818) touches the same handleTrack function (refreshing the All Prompts list on track). You two may want to coordinate — whoever merges second will just need a small rebase. Ping here if anything's unclear.
Hey @Sam-syntax35 — just a friendly check-in on this one, no pressure at all. 🙂
Are you still planning to take it? If so, take your time — the fix is small and self-contained: in web/src/app/[locale]/(dashboard)/dashboard/prompts/_fanout-tab.tsx, on a successful trackFanoutQuery(...) update just the acted row in local data state (tracked: true + trackedPromptId from the returned id) and drop the await load() from handleTrack so the table no longer flashes its skeleton. Keep the addingKey button spinner as-is.
If you'd rather focus on your other open PR (#368) and let this one go, that's totally fine too — just let us know and we'll leave it open for someone else to pick up. Thanks for all your contributions! 🙌
Activity
Sam-syntax35 commentedon Jul 6, 2026
Hi @gkhngyk ! I'd like to work on this issue. Could you assign it to me?
gkhngyk commentedon Jul 6, 2026
Thanks @Sam-syntax35 — assigned to you! 🎉 The fix is to drop the
await load()fromhandleTrackin_fanout-tab.tsxand instead flip just the tracked row in local state (settracked: true+trackedPromptIdfrom whattrackFanoutQueryreturns), keeping the inline spinner on the + button.Heads-up: #345 (assigned to @AyushSrivastava1818) touches the same
handleTrackfunction (refreshing the All Prompts list on track). You two may want to coordinate — whoever merges second will just need a small rebase. Ping here if anything's unclear.gkhngyk commentedon Jul 9, 2026
Hey @Sam-syntax35 — just a friendly check-in on this one, no pressure at all. 🙂
Are you still planning to take it? If so, take your time — the fix is small and self-contained: in
web/src/app/[locale]/(dashboard)/dashboard/prompts/_fanout-tab.tsx, on a successfultrackFanoutQuery(...)update just the acted row in localdatastate (tracked: true+trackedPromptIdfrom the returned id) and drop theawait load()fromhandleTrackso the table no longer flashes its skeleton. Keep theaddingKeybutton spinner as-is.If you'd rather focus on your other open PR (#368) and let this one go, that's totally fine too — just let us know and we'll leave it open for someone else to pick up. Thanks for all your contributions! 🙌