Repository navigation
feat(prompts): show a prompt's content opportunities on its detail page - #994
Merged
gkhngyk merged 4 commits intoOct 13, 2026
Merged
Conversation
gkhngyk
requested changes
Oct 10, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this. Two things need fixing before merge, plus a few smaller ones.
Required
- "View all N" opens a different list (
_workflow-cards.tsx, the "View all" link). N counts onlynewopportunities, but the link doesn't carry the status, so the Content page shows every non-archived status for the prompt. Use/dashboard/content?prompt=${encodeURIComponent(promptId)}&status=new. - The card loads the active brand's opportunities, not the prompt's (
page.tsx, thegetOpportunitieseffect). The rest of the page loads the prompt regardless of the active brand. When the active brand is a different one (a shared link, or switching brand on the page), the card shows "No open opportunities" for a prompt that has some. Usedata.prompt.brandIdinstead ofactiveBrandId, and load once the prompt has loaded.
Please also
- Show a failed load as unavailable, not as "no opportunities."
OpportunityContextdoes this with afailedstate, and the card can do the same. - Clear the previous results when a new load starts or fails. Otherwise a failed reload keeps showing the old rows.
- Reuse the Content page's labels for impact and type. That means
IMPACT_COLORS,t('content.impact.*')andt('content.type.*')instead of the rawHIGH/OWNEDvalues, so both pages look the same.
Nits
- Keep the preview size in one constant (
5appears in three places), and drop theslice(0, 5), since the request already limits to 5. - Remove the unused
groupandflex justify-betweenclasses, and addtitle={opp.title}to the truncated title. - Update the module comment in
_workflow-cards.tsx: the section now has three cards, not two. - Rename the PR to Conventional Commits form, e.g.
feat(prompts): show a prompt's content opportunities on its detail page. It becomes the squash commit message.
Contributor
Author
|
Thanks for the detailed review, @gkhngyk. I've addressed everything:
One note: Tested locally: the labels and colors, long titles truncating, "View all" landing on the Content page with the New status filter and the same count, and the empty state. |
gkhngyk
approved these changes
Oct 13, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Thanks, all addressed. Moving IMPACT_COLORS into a shared file can wait for a follow-up.
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
Adds a Content opportunities card to the prompt detail page, in the Workflow section below the Notes and Target URLs cards.
/dashboard/content/<id>./dashboard/content?prompt=<promptId>when there are more than 5.getOpportunities(brandId, { promptId, status: 'new', limit: 5 }); theprompt_idfilter from feat(content): filter opportunities by prompt #836 is already merged, so this is frontend-only.Closes #838
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
Local data comes from
supabase/seed.sql(npx supabase db reset), signed in as[email protected].newrows to one prompt in my local DB, one with a brief): the card lists 5, shows the count badge, "Brief ready" on the one with a brief, and "View all N".Notes
yarn buildcompiles and passes TypeScript, but fails at page-data collection for an unrelated route (/api/agent/conversations/[id]) because a Supabase key is not set in my local env.yarn lintreports 0 errors (the same 8 warnings that already exist in unrelated files).yarn format:checkflags many files repo-wide on my Windows machine (CRLF line endings); the two files I changed passprettier --check --end-of-line auto.Checklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)