Repository navigation
Conversation
Assisted-by: Claude Code
gkhngyk
left a comment
There was a problem hiding this comment.
The move itself is right (render-first on All Prompts, removed from Insights, anchor id added) — but relocating this card changes its cost profile and leaves two #461 acceptance criteria unmet:
1. The card now auto-fires LLM generation on the product's hottest path.
SuggestionsCard mounts with load(true), which auto-calls refreshPromptSuggestions (a POST that generates via LLM) whenever the server marks the stored set stale. On the Insights tab that cost was gated behind opening a secondary tab; on All Prompts — the default tab — it now fires on every Prompts page visit once suggestions go stale. Issue #461 said "no changes to the card's internals", but the move itself makes this internal necessary: please change the mount call to load(false) so stale suggestions render as-is and generation only happens via the explicit Refresh / Generate buttons. (Same principle as #459/#463: no LLM calls in a page's load path.)
2. Accepting a suggestion doesn't update the tracked list below (AC: "inserts it into the tracked list below and refreshes it").
handleAccept removes the item from the card's own state, but the prompt table on the same tab is page-level state and won't show the new prompt until a manual reload — visibly inconsistent now that both live on one screen. Add an optional onAccepted?: () => void prop to SuggestionsCard, call it after a successful accept, and have PromptsPage pass its prompt-reload function.
3. Cold-load anchor scroll (AC: "scrolls to the card, including on a cold page load").
The card renders after async loading, so the browser's native hash scroll misses it. A small effect that re-applies the hash once content is mounted covers it, e.g. in the card: useEffect(() => { if (!loading && window.location.hash === '#prompt-opportunities') document.getElementById('prompt-opportunities')?.scrollIntoView(); }, [loading]);
All three are small; happy to re-review quickly.
Assisted-by: Claude Code
gkhngyk
left a comment
There was a problem hiding this comment.
All three verified in the new commits:
- ✅ Mount now calls
load(false)— stale suggestions render as-is and generation only happens via the explicit Refresh / Generate buttons. No LLM on the page's load path. - ✅
onAcceptedprop wired to the page'sloadData, so accepting a suggestion refreshes the tracked list on the same screen. - ✅ Hash-scroll effect re-applies
#prompt-opportunitiesonce the card content mounts — cold-load deep links work.
CI green. LGTM, thanks for the quick turnaround!
…efault (#470) At the top of All Prompts the expanded suggestions card (~400px) pushed the prompt table below the fold on every visit. Collapse it to a single header row by default — chevron + title + count badge — so the table is back above the fold while the suggestions stay discoverable at the top. - Expanding/collapsing persists per browser via localStorage. - The #prompt-opportunities deep link auto-expands (without touching the stored preference) before scrolling into view. - Refresh button and card content render only when expanded; collapsed header shows a small spinner while loading and a count badge after. Related to #461/#466 (placement feedback follow-up).
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.
fix(prompts): move suggestions to All Prompts
Summary
Moves the Prompt Suggestions card from the Insights tab to the top of All Prompts, where suggested prompts can be acted on alongside the tracked prompt list. The card now exposes a stable anchor for direct navigation.
Fixes #461
Changes
SuggestionsCardfirst in the All Prompts tab and remove it from Insights.prompt-opportunitiesanchor ID to the suggestions card.Testing
Ran in the required isolated sandbox from
repo/:sandbox-run "cd web && yarn install --frozen-lockfile && yarn lint && yarn typecheck && yarn format:check"All commands passed.
yarn lintcompleted with 9 pre-existing warnings and no errors.AI assistance disclosure
This contribution was produced by an autonomous AI coding agent (Claude Code) that @Dodothereal operates and monitors. @Dodothereal is accountable for it, will address review feedback promptly, and will close this PR immediately if this kind of contribution is unwelcome in this project. Commits carry an
Assisted-by: Claude Codetrailer.