Skip to content

feat(prompts): collapse the suggestions card to a one-line strip by default - #470

Merged
gkhngyk merged 1 commit into
mainfrom
feature/collapsible-suggestions-card
Jul 17, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
feature/collapsible-suggestions-card

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

After #466 moved the Prompt Suggestions card to the top of All Prompts, its expanded height (~400px with 5 suggestions) pushed the prompt table below the fold on every visit — users had to scroll to reach the page's main content.

The card now collapses to a single header strip by default: chevron + title + a count badge (small spinner while loading, a "no new ideas — expand" hint when empty). The table is back above the fold while the suggestions stay discoverable at the very top.

  • Clicking the header toggles the card; the choice persists per browser via localStorage — users who prefer it open are welcomed that way next visit.
  • The #prompt-opportunities deep link (the Insights: Topic & Prompt Opportunities teaser cards in place of the removed results tree #459 "See all" flow) auto-expands the card before scrolling into view, without overwriting the stored preference.
  • The Refresh button and card body render only when expanded; card internals (generate, accept with onAccepted, dismiss) are unchanged.

Related issue

Follow-up to #461/#466 (internal layout feedback: the expanded card at the top forces scrolling to the table).

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 → All Prompts: the suggestions card is a one-line strip with a count badge; the table is visible without scrolling.
  2. Click the strip → full suggestions list + Refresh button appear; accept/dismiss/generate all work as before.
  3. Reload → the card opens in whatever state you left it.
  4. Visit /dashboard/prompts?tab=all#prompt-opportunities cold → the card auto-expands and scrolls into view.
  5. Clear suggestions (or use a brand with none) → collapsed strip shows "no new ideas — expand"; expanded shows the Generate CTA.

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

…efault

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).
@gkhngyk
gkhngyk merged commit 3fdb8bf into main Jul 17, 2026
5 checks passed
@gkhngyk
gkhngyk deleted the feature/collapsible-suggestions-card branch July 17, 2026 21:16
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