Skip to content

fix(content): the list flashes its skeleton on every filter change and bulk action #365

Closed

Description

@gkhngyk

Problem

On the Content Optimization page (/dashboard/content), the whole opportunity list flashes to its loading skeleton on almost every interaction — changing a filter (Status / Impact / Type) or running a bulk action (Done / Dismiss all / Send all) briefly wipes the list and re-renders skeletons. It's jarring and makes the page feel like it fully reloads each time. The skeleton should only show on the initial load; subsequent refreshes should update the list in place.

Root cause (from the code)

In web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx:

  • loadData always starts with setLoading(true), and the list render is gated on that loading flag (skeletons while true).
  • loadData is a useCallback whose deps include statusFilter, impactFilter, typeFilter, so changing any filter recreates it, and the useEffect(() => { loadData() }, [loadData]) re-runs it — full skeleton every filter change.
  • The bulk handlers (handleBulkDone, handleBulkDismiss, handleBulkSend) each await loadData() afterward — full skeleton after every bulk action too.

So every filter change and every bulk action toggles the full-page skeleton.

Proposed change

Distinguish the initial load from re-fetches, so only the first load shows the skeleton:

  • Add a { silent } option to loadData that skips setLoading(true) (mirrors the pattern the Insights page already uses: loadData(overrideFilters, { silent })).
  • Call the silent variant for filter-change refreshes and after bulk actions, keeping the current list visible while it updates (optionally a subtle inline/“refreshing” indicator instead of the skeleton).

Alternatively (simpler), only render the skeleton when the list is actually empty — e.g. gate it on loading && opportunities.length === 0 — so a populated list stays put during a refetch.

How to test

  1. Load /dashboard/content → the skeleton shows once on first load.
  2. Change the Status / Impact / Type filter → the list updates without flashing back to the skeleton.
  3. Select some opportunities and click Done / Dismiss all / Send all → the list updates in place, no skeleton flash.
  4. Switching brand (a genuinely new dataset) may still show the skeleton — that's fine.

Notes

Activity

  1. added
    bug
    good first issue
    help wanted
    on Jul 7, 2026
  2. Sam-syntax35 commented on Jul 7, 2026

    @Sam-syntax35
    Contributor

    i really read all the documentation ! and so far i am enjoying contributing on this project. could you please assign this to me

  3. gkhngyk commented on Jul 7, 2026

    @gkhngyk
    ContributorAuthor

    Thanks for the interest, @Sam-syntax35! This one's already being worked on — @Maqbool61 has PR #367 open for it (currently in review), so I'll leave it with them to avoid duplicate work. There are plenty of other open good-first-issues if you'd like to pick up another one! 🙌

  4. added a commit that references this issue on Jul 8, 2026
    3fd0ba3
  5. added a commit that references this issue on Jul 9, 2026
    5625386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions