Skip to content

feat(content): filter opportunities by prompt #836

Closed

Description

@gkhngyk

Description

Content opportunities are generated per prompt: every row in content_opportunities carries a prompt_id, and nearly all rows have one set. The Content page, however, can only filter by status, impact and type, plus a free-text search over title and description. On larger brands the list runs to 100+ opportunities spread across 20–30 prompts, so answering "what should I write to show up for this prompt?" means scrolling or guessing search terms.

Proposed change

Add a Prompt filter to the Content page's filter bar, next to the existing Status / Impact / Type selects.

Server: server/src/routes/content.js: GET /api/content/brand/:brandId already reads status, impact, type and q from the query string. Accept a prompt_id parameter the same way and add it to the query as an equality filter.

Web:

UX details:

  • Only list prompts that have at least one opportunity. Show the prompt text, truncated, and ideally its opportunity count.
  • Hide the filter when a brand's opportunities span fewer than two prompts, since it would have nothing to narrow.
  • Brands can have 30+ prompts, so a searchable picker works better than a long plain list.
  • If you use the shared Select, pass items={[{ value, label }]} on the root. Without it, the trigger shows the raw id instead of the prompt text.

How to test

  1. Open /dashboard/content for a brand with opportunities across several prompts.
  2. Pick a prompt: only its opportunities are listed, and the count and pagination reflect the filtered set.
  3. Reload the page: the ?prompt= selection is kept.
  4. Clear filters: the full list comes back.

Run yarn build from web/ and yarn test from server/ before opening the PR. Branch and commit conventions are in CONTRIBUTING.md.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    content
    on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentenhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions