Repository navigation
feat(insights): Topic & Prompt Opportunities teaser cards - #479
Merged
Merged
Conversation
Fills the space freed by the removed results tree (#458) with a Recommendations row: top 5 stored similar-topic clusters and top 5 stored prompt suggestions, each with a See all link into the Prompts page. Both reads are assembled server-side inside getInsightsData's Promise.all (no extra client POST, no LLM call) and degrade independently to an empty list so a hiccup never blocks the Insights load. Empty cards show a Generate ideas CTA instead of rendering blank. The section sits under its own heading with no delta badges — it is stored account data, not period-scoped (see #457). Deep links: the suggestions card already handles #prompt-opportunities on the default tab; the similar-topics card gets id=topic-opportunities and the Prompts page re-applies the hash once the Insights tab's data has rendered (a bare anchor can't scroll to a not-yet-mounted card). The tab URL sync now preserves location.hash instead of stripping it.
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
Fills the space freed by the removed results tree (#458) with a Recommendations row at the bottom of the Insights page — the "so what, what should I do next?" step the page was missing:
Design notes, per the issue spec:
getInsightsData's existingPromise.all— zero additional client POSTs (the serialized-action-queue lesson from perf(insights): drop the full-table scan on load + use SQL limit/count instead of fetching all rows #313/fix(prompts): consolidate the page's first load into one server action #473) and no LLM call on the Insights load path. Each read degrades independently to an empty list on failure, so an aeo-server hiccup can never block the Insights page./dashboard/prompts#prompt-opportunities— the suggestions card lives on the default All Prompts tab and already expands + scrolls itself for that hash. Topic Opportunities links to/dashboard/prompts?tab=insights#topic-opportunities: the Similar Topics card now carries thatid, and the Prompts page re-applies the hash after the Insights tab's volume data has rendered, so the scroll works on cold page loads too. The tab URL sync no longer stripslocation.hashwhen it rewrites the query string.Related issue
Closes #459
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/insightsfor a brand with volume analyses and stored prompt suggestions: a Recommendations section with the two cards renders below the Share of Voice row, up to 5 items each.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)