Skip to content

fix(prompts): load suggestions only when the card is expanded - #476

Merged
gkhngyk merged 1 commit into
mainfrom
fix/suggestions-lazy-load
Jul 18, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
fix/suggestions-lazy-load

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

The "prompts table spins forever" regression started exactly when the suggestions card moved to the All Prompts tab (#466). Mechanism: the card fired its server action on every page mount, becoming the first entry in Next's serialized action queue — so any hiccup in that one request (the router-state-header framework issue worked around in #474/#475, a slow upstream) stalled the table's own data fetch queued behind it. Before the move the card lived on a secondary tab and fired nothing at page load, which is why the problem never existed then.

Fix: the collapsed strip now costs zero requests. Suggestions load the first time the card is actually expanded (the #prompt-opportunities deep link auto-expands and therefore loads). The count badge appears once loaded; before that the strip shows a neutral "expand for AI prompt ideas" hint. Page load is back to exactly one server action — the table's — matching the pre-#466 behavior.

Verified in the browser on the exact failing scenario: sidebar Visibility → Prompts now renders the full table (107 prompts) with the collapsed strip issuing no requests.

Related issue

Final piece of the urgent "prompts page never loads" fix (#474, #475 were mitigations at other layers).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. From Visibility (Insights), click Prompts in the sidebar — the table loads; the Network tab shows no suggestions request while the strip is collapsed.
  2. Expand the strip — suggestions fetch now; count badge appears; accept/dismiss/refresh work as before.
  3. Visit /dashboard/prompts?tab=all#prompt-opportunities — the card auto-expands, loads, and scrolls into view.
  4. Switch brands — expanding again fetches the new brand's suggestions.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Since the suggestions card moved to the All Prompts tab (#466) it fired
its server action on every page mount — and as the FIRST entry in
Next's serialized action queue. Any hiccup in that request (the
router-state-header framework issue, a slow upstream) stalled the
prompt table's own data fetch queued behind it: the exact regression
window the user identified — 'this never happened before the card
moved'.

The collapsed strip now costs zero requests. Suggestions are fetched
the first time the card is actually expanded (or via the
#prompt-opportunities deep link, which auto-expands); the count badge
appears once loaded, and the strip shows a neutral 'expand for AI
prompt ideas' hint before that. Page load is back to exactly one
server action — the table's — like before the move.
@gkhngyk
gkhngyk merged commit e59c6bf into main Jul 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant