Repository navigation
fix(content): suppress skeleton flash on filter change and bulk actions - #367
Conversation
Closes #365 - Added silent parameter (default false) to loadData - When silent=true, skips setLoading(true) so existing rows stay visible during background refresh - Initial load and filter-change calls remain non-silent (correct full loading state on first paint and filter switch) - All post-mutation calls use loadData(true): handleSendWebhook, handleDismiss, handleBulkSend, handleBulkDone, handleBulkDismiss, and pollJob completion handler - Zero new TypeScript errors introduced (verified via tsc --noEmit diff) Signed-off-by: Maqbool Ahmed <[email protected]>
There was a problem hiding this comment.
Nice — the bulk-action skeleton flash is fixed with the silent param (loadData(true) on the mutation paths). 🙌
One thing before it fully closes #365: the issue also covers filter changes (the reporter specifically hit "selecting a filter option runs the skeleton"), and that path still flashes — the useEffect(() => loadData(), [loadData]) re-runs non-silent whenever a Status/Impact/Type filter changes (its deps include the filters), so setLoading(true) fires and the list drops to the skeleton.
Could you suppress that case too? Two clean options:
- (a) make the filter-change effect call
loadData(true)after the first load — distinguish the initial mount via ahasLoadedRef; or - (b) simpler — gate the skeleton render on
loading && opportunities.length === 0, so a populated list never flashes during any refetch (filter change or mutation), only the first empty load does.
Either one makes it satisfy the filter-change step (step 2 of the How-to-test in the issue). Thanks!
gkhngyk
left a comment
There was a problem hiding this comment.
Perfect — gating the skeleton on loading && opportunities.length === 0 covers both cases cleanly: a filter change keeps the populated list in place (no flash), and the initial empty load still shows the skeleton. Combined with loadData(true) on the mutation paths, both the filter-change and bulk-action flashes from #365 are gone. Prettier's happy. LGTM! 🎉
Closes #365
Summary
Related issue
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)