Skip to content

feat(prompts): show a prompt's content opportunities on its detail page #838

Closed

Description

@gkhngyk

Description

Content opportunities are generated per prompt, but the only place to see them is the Content page, where they are mixed in with every other prompt's. When a user is on a prompt's detail page, the question they are usually asking is "what should I publish to show up here?", and the answer lives on another page. Customer feedback asked for exactly this: seeing a prompt's content opportunities on the prompt's own page.

Proposed change

Add a Content opportunities card to the prompt detail page, web/src/app/[locale]/(dashboard)/dashboard/prompts/[id]/page.tsx, in the Workflow section alongside the Notes and Target URLs cards. Like those cards, it does not depend on the selected date range, so load it once per prompt outside the date-driven load cycle, the same way getPromptWorkflow is loaded.

Data: Load the prompt's opportunities with getOpportunities(brandId, { promptId, status: 'new' }) from web/src/lib/actions/content.ts. This depends on the prompt_id filter from #836. If #836 hasn't landed yet, add that parameter as part of this change: it is the same small addition to GET /api/content/brand/:brandId in server/src/routes/content.js.

Card contents:

  • Up to 5 open opportunities, each showing its title, impact and type (owned / earned), and a "Brief ready" marker when a brief has been generated. Each row links to the opportunity's detail page, /dashboard/content/<id>.
  • When there are more than 5, a "View all N" link to /dashboard/content?prompt=<promptId>, the filtered view from feat(content): filter opportunities by prompt #836.
  • An empty state when the prompt has no open opportunities yet.

How to test

  1. Open a prompt that has content opportunities: the card lists them, capped at 5, and each row opens its opportunity.
  2. For a prompt with more than 5, "View all" opens the Content page filtered to that prompt.
  3. Open a prompt with none: the empty state shows.
  4. Change the date range: the card does not reload.

Run yarn build from web/ before opening the PR. See CONTRIBUTING.md for conventions.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    prompts
    content
    on Sep 26, 2026
  2. Nandinikumari02 commented on Oct 2, 2026

    @Nandinikumari02
    Contributor

    Hi @gkhngyk, I'd like to work on this issue.

    Two quick questions before I start:

    1. feat(content): generate content opportunities per prompt cluster, not per prompt #857 proposes generating opportunities per prompt cluster rather than per prompt. Should feat(prompts): show a prompt's content opportunities on its detail page #838 go ahead as written, or would you prefer to wait for feat(content): generate content opportunities per prompt cluster, not per prompt #857?
    2. Is there a recommended way to test this locally with real data (e.g. a dev Supabase project or seed data)? I can build the card, but I'd like to verify it renders against actual opportunities.
  3. gkhngyk commented on Oct 2, 2026

    @gkhngyk
    ContributorAuthor

    Assigned — go ahead as written. #857 is still at the design stage, and the card reads a prompt's opportunities through the prompt_id filter from #836. When clusters land, that filter changes on the server and the card follows without restructuring.

    For local data, supabase/seed.sql ships a demo brand with prompts, results and content opportunities tied to prompts. npx supabase db reset loads it. Sign in as [email protected] / demo123, and run both web/ and server/, since the Content data comes through the server API. See the seed data section in CONTRIBUTING.

    The seed has at most one open opportunity per prompt and none with a brief. To check the "View all" link and the "Brief ready" marker, add a few more new opportunities to one prompt in your local database and give one of them a brief. Happy to review!

  4. gkhngyk commented on Oct 7, 2026

    @gkhngyk
    ContributorAuthor

    Hi @Nandinikumari02, how is this going? Since you picked it up, opportunities are now generated per prompt cluster (#930), and the prompt filter matches through cluster membership (#932), so getOpportunities(brandId, { promptId }) already returns this prompt's opportunities. If you're no longer able to work on it, just let us know and we'll free it up for someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

contentenhancementgood first issuehelp wantedprompts

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions