Repository navigation
fix(prompts): load suggestions only when the card is expanded - #476
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-opportunitiesdeep 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 featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
/dashboard/prompts?tab=all#prompt-opportunities— the card auto-expands, loads, and scrolls into view.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)