Skip to content

feat(prompts): give suggestions their own tab and show what feeds them - #727

Merged
gkhngyk merged 6 commits into
mainfrom
feature/659-suggestions-tab
Aug 15, 2026
Merged

gkhngyk merged 6 commits into
mainfrom
feature/659-suggestions-tab

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Prompt suggestions lived in a collapsible card, collapsed by default, so most people never saw them — the strip read "expand for AI prompt ideas" and that was the whole invitation. They now get a tab of their own, and a panel showing which data sources feed them.

A flat fourth tab — All Prompts · Suggestions · Query Fan-out · Insights — rather than tabs nested inside a tab. The four panels are peers: each is a different view of the same brand's prompts.

The collapse machinery is gone, and that is safe

The card was collapsed by default for a real reason, not for looks: as an always-mounted card its request became the first entry in Next's serialised server-action queue, and every hiccup in it stalled the prompt table's own fetch behind it — the "table spins forever" bug.

Fetching on mount is fine now because the component only mounts when the tab is open, and the tab click is the user asking for it. The comment in the file says so, so nobody moves it back above a tab boundary later.

The data-source panel replaces #659's one-liner

That issue asked for a muted inline hint. It predates Analytics becoming a suggestion source (#705), and a quiet link is the wrong weight for what is now the difference between suggestions built on estimates and suggestions built on the brand's own demand and behaviour.

Four states, because they mean different things:

state shown
not configured (self-host without Composio) nothing — never advertise a flow that cannot complete
configured, org not connected Connect
connected, brand not mapped Map property, with its own wording
connected and mapped Feeding suggestions

Connected-but-unmapped is the state that silently produces nothing, which is why it gets its own copy rather than a green tick. The whole panel hides once every source is feeding — the suggestion rows already carry their own source badges, so a panel repeating that is noise. It is dismissable, and the dismissal is remembered.

Both buttons deep-link to the existing Settings → Integrations flow rather than reimplementing it.

Also

  • The date range control hides on this tab. Suggestions are regenerated on demand with a 48-hour life and carry no date dimension, so a range would change nothing — same reasoning as Insights.
  • Old deep links still work. The Insights recommendation row now points at ?tab=suggestions, and a bookmark carrying the old #prompt-opportunities anchor opens the tab instead of landing on All Prompts with nothing to scroll to.

Not included, deliberately

The mockup this came from also had a source filter and a search box over the suggestion list. Suggestions are capped at 8 per brand — the live distribution is 8 for eleven brands, 7 for two, 6 and 4 for one each. Filtering and searching six rows is more chrome than content. Worth revisiting if the cap ever rises.

DataForSEO was also shown as a connectable source. It is our own API key used to enrich Search Console candidates with competition data, not a customer connection and not a suggestion source — listing it beside GSC and Analytics under "your data is secure" would misrepresent both.

Related issue

Closes #659

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. Open Prompts — four tabs. All Prompts no longer carries the suggestions card.
  2. Open Suggestions — the list loads on entry; the date range control is not shown.
  3. With Analytics or Search Console unconnected, the panel offers Connect; connected but with no property mapped, it offers Map property; with both mapped it disappears entirely.
  4. Dismiss the panel with the ✕ — it stays hidden across reloads.
  5. From Insights, the prompt-opportunities recommendation opens the Suggestions tab.
  6. Visit /dashboard/prompts#prompt-opportunities directly — the Suggestions tab opens.
  7. Accept and dismiss still work, and accepting still refreshes the tracked list behind the tab.

yarn typecheck, yarn lint (6 pre-existing warnings, 0 errors), yarn format:check and yarn build pass locally.

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

Suggestions lived in a collapsible card that was collapsed by default, so
most people never saw them: the strip read "expand for AI prompt ideas" and
that was the whole invitation. They are now a tab of their own, alongside All
Prompts, Query Fan-out and Insights.

A flat fourth tab rather than tabs inside a tab. The alternative nests two
levels of navigation on one page, and the four panels are peers — each is a
different view of the same brand's prompts.

The collapse machinery goes with the card. Fetching on mount is safe now
because the component only mounts when the tab is open, and the tab click is
the user asking for it. That is the constraint the collapsed card existed to
respect: as an always-mounted card its request was the first entry in Next's
serialised server-action queue, and every hiccup in it stalled the prompt
table behind it. Moving it behind a tab keeps that property.

The data-source panel replaces the quiet one-line hint #659 asked for. That
issue predates Analytics being a suggestion source, and a muted link is the
wrong weight for what is now the difference between suggestions built on
estimates and suggestions built on the brand's own demand and behaviour. It
distinguishes four states, because connected-but-unmapped is the one that
silently produces nothing and deserves its own wording rather than a green
tick. Nothing renders when Composio is unconfigured — a self-host cannot
complete the flow — or when every source is already feeding, since the
suggestion rows carry their own badges.

The date range control hides on this tab. Suggestions are regenerated on
demand with a 48-hour life and carry no date dimension, so a range there
would change nothing, exactly as on Insights.

Deep links written before the tab existed still work: the Insights
recommendation row now points at ?tab=suggestions, and a bookmark carrying
the old #prompt-opportunities anchor opens the tab rather than landing on All
Prompts with nothing to scroll to.

Closes #659
…esign

The first pass diverged from the mockup on the point that mattered most: it
promoted suggestions to a fourth top-level tab instead of splitting the
Prompts tab into Tracked Prompts and Prompt Suggestions. Those two are views
of one roster — the date range, Add prompt and Export all belong to both — so
a segmented control inside the tab is the right shape, and the top-level tabs
go back to three.

The connect panel becomes the promo cell plus a card per source, and the list
becomes numbered rows with the source as its own column. Every row carries
Ansvisor Agents, joined by a data source badge when the suggestion was mined
from the brand's own Search Console or Analytics — two badges is the honest
reading, since the data and the phrasing come from different places.

Source filter, search, New and Clear All land as drawn. Clear All dismisses
what is listed rather than everything stored: dismissing a Search Console or
Analytics row keeps that query or page out of the pool for thirty days, so
clearing a filtered view must not silently suppress rows the user never saw.

The date range stays visible on this tab. It scopes the tracked view, which
is the other half of the same panel.

DataForSEO is still absent from the panel. It is our own API key, used to
enrich Search Console candidates with competition data — not a customer
connection and not a suggestion source, so listing it under "your data is
secure and never shared" would misdescribe both it and the two that are.
…lace

Three cards, as drawn. DataForSEO is ours rather than the customer's — our
key, enriching Search Console candidates with competition and volume data —
so it reports a state and offers no button: "Enabled" when the deployment has
credentials, absent when it does not. A new status endpoint answers that,
declared above the :provider routes which would otherwise claim the path and
reject it as an unknown provider. It returns a boolean and never the
credentials.

The panel no longer hides itself once every source is connected. It is the
standing answer to "what is behind these suggestions", not a prompt to act,
and a reader who connected Search Console last month should still see that it
is the one doing the work. Dismissing it remains the way to hide it, and that
choice is still remembered.

Rows can now carry a DataForSEO badge too, but only where the row actually
holds its contribution — the competition index it returned for that query.
A badge on a row it never touched would be decoration claiming to be
provenance, which is the opposite of what the source column is for.
The cards showed generic lucide glyphs where the provider's own mark belongs.
They now load an SVG from web/public, matching how platform logos already
work on this codebase, and fall back to the previous icon when the file is
absent — so a deployment missing an asset shows something sensible rather
than a broken image.

The three files are not in this commit: they are third-party marks, and the
right versions are the ones each vendor publishes rather than something
redrawn from a screenshot. Drop them in as web/public/google-search-console.svg,
google-analytics.svg and dataforseo.svg and they appear with no code change.
The data-source cards already reference these paths and fall back to a
generic icon when they are missing; with the files present the cards show
each provider's own mark.
The data-source panel appeared well after the suggestions it sits above,
because resolving each provider's state called the live status endpoint,
which asks Composio and re-syncs our row. Measured at 493ms and 389ms for the
two providers, plus a brand-mapping query each.

The panel now reads the row that status check maintains, together with the
brand's property mapping, in two database queries — 468ms to 100ms on the
same connection, and no Composio round trip at all. The env booleans come
from one lightweight endpoint that replaces the DataForSEO-only one added
earlier in this branch; it reports all three integrations and never touches
Composio either.

The trade-off is stale state: a connection revoked on Google's side still
reads as connected here until Settings runs its authoritative check and
rewrites the row. For a panel that describes what feeds suggestions, a
briefly stale "connected" is a better failure than a second of blank space on
every visit — and Settings, where connections are actually managed, still
resolves live.
@gkhngyk
gkhngyk merged commit b864595 into main Aug 15, 2026
4 checks passed
@gkhngyk
gkhngyk deleted the feature/659-suggestions-tab branch August 15, 2026 15:59
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.

Prompts: surface a Search Console connect hint on the suggestions card when GSC isn't feeding it

1 participant