Repository navigation
feat(content): show the Plan's Priority Score, and how it is worked out - #1342
Conversation
…e in its final layout - "What AI cites in your topics" drew both shares on one track scaled to AI's largest share, so a type the brand leans on more than AI does (e.g. 35% · 73%) ran its bar past the track onto the shares column. The two shares are now two thin bars on one scale, the larger of the two, never past the track. - The list and the sections above it (AI results, the mix) were read and drawn apart, so the list showed mid-screen first and jumped down when the sections came in. The page now shows one spinner until both reads are in; a list that fails says so at once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rlap warning More of the brand's pages cited for the same prompts is no loss (AI answers aren't a ranking), so neither Start nor the Plan treats it as a problem any more: - Start's "Overlap check" is an "Overview": a plain box listing the brand's pages AI already cites for these prompts, with no amber warning, no "Safe to create" and no "Recommended". The action the person clicked stays chosen (Create stays Create); the choices are the plan's page when it named one, a new page, and optimizing the page cited most. - The Plan drops the Overlaps card, the ⚠ Overlap tag on rows, and the rows that were listed only because another page of the brand is cited for the same prompts. content_plan_pages (00220/00221) still returns overlaps; the Plan no longer reads it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each Priority list row gets a "…" menu: - Assign to… (every member): a row with a draft assigns its Action Center task (sending the draft first when needed); a row without one opens Start on Team, which now has an "Assign to" picker. The Who column shows the assignee. - Mark as priority (admins and managers): the row goes to the top with a Priority tag; a Priority card counts and filters the marked rows. - Hide from the plan (admins and managers): the row leaves the list, with Undo and "N hidden rows · Show"; an opportunity's row also dismisses the opportunity and gets its status back when shown again. Migration 00229 adds content_plan_marks (members read; admins and managers write). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…type Content Opportunities gave every brand the same ten asset types, so a shop could get a glossary or landing page and a SaaS brand a product or category page. The generator now reads brands.site_type (or the editor's guess from Shopping mode and industry), lists that site's page types with their formats in the prompt, and limits assetType and the supporting types to them, plus the earned third_party_article and backlink. No calculation changes. Older opportunities keep their stored types and are read as the brand's page types (pillar_guide -> guide / buying_guide, landing_page -> solution_page / collection_page / destination_page, and so on). The opportunities list, the drawer, the assets card and Copy All Data name them with the editor's labels. Start preselects an opportunity's type for a new page; an existing page goes by its own address or title first. The Content Plan follows the same rules. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # web/src/components/content/new-content-dialog.tsx # web/src/lib/actions/content-plan.ts
From the user's spec, PR B of the Content Editor entry points, with the user's follow-up choices: - Opportunity panel: three buttons in front, in this order: Send to Actions, Generate Brief and Send to Editor. Each turns into its done state in place (Open in Actions, Brief Generated, Open draft). The rest move into a "..." menu on the right: Send to Plan, Another angle, Send to Workflow, Copy All Data, Mark as reviewed, Restore, Dismiss. - Opportunities list: a row's actions sit in one "..." menu: Send to Editor or Open draft, Send to Plan or Open in Plan, Send to Workflow, Open in new tab, Dismiss. The Actions column narrows to fit. - Send to Editor opens New content > Start. A create decision starts a new page; any other decision starts on its first target page (lib/content/opportunity-start.ts). Owned work still open only. getOpportunityDrafts finds the draft already being written. - Send to Plan marks the opportunity's Plan row as a priority (content_plan_marks, ansvisor#1321) for admins and managers; getPlanPriorities reads which rows already are. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Priority Score column beside the rank shows each row's 0-100 score as the Action Center's badge does (level by colour, its name on wide windows). On hover or focus it says what the score is made of: the opportunity's own score, a drop's base and points, or a top page's citations. The calculation and the order don't change. The table still fits at 1024 px. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk Step 1 of the Plan's Priority Score, stacked on #1334 (this PR's own commit is |
# Conflicts: # supabase/schema.sql # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/content/plan/_plan-insights.tsx # web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/content/plan/page.tsx # web/src/components/content/new-content-dialog.test.tsx # web/src/lib/content/plan.test.ts # web/src/lib/content/plan.ts
… only what is still dismissed hidePlanRow and showPlanRow no longer take an opportunity id from the client: the server reads it from the row key the mark is written under (a uuid, or 'invalid'). Show again gives an opportunity back its status only while it is still dismissed; one completed or reopened elsewhere keeps its status and only the mark goes. Hidden rows read only dismissed opportunities. The Priority card's dot is in ink, as its outline badge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nu' into feature/opportunity-content-entry
…and tell the list about Send to Plan - A failed getOpportunityDrafts is no "no draft": the row menu and the panel offer "Couldn't check for a draft · Retry" instead of Start, so a failed read never starts a second draft for the same opportunity. - Send to Plan from the panel calls the page's onPrioritized, so the row's menu says Open in Plan without a reload. - Start's page types come from the opportunity's brand, not the active one. - content.send is gone; content.alternative.hint is Another angle's title. - Drop the unused contains mock and fix the content prop's doc. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. Two small follow-ups (reviewed 78fe313d, the only commit of this PR's own). 832db273 and 87dfcf25 are clean merges of #1334: each is identical to re-merging its parents.
web/src/app/[locale]/(dashboard)/dashboard/content/plan/_plan-table.tsx:252: the breakdown lives only in a Base UI tooltip, and the tooltip isn't tied to its trigger (noaria-describedby). A screen reader hears "Priority Score 61: how it is worked out" and can't reach the breakdown. Fix either way:- put the breakdown text in the button as an
sr-onlyspan; - or drop ": how it is worked out" from
score.label(web/messages/en.json:3169).
- put the breakdown text in the button as an
_plan-table.tsx:289andweb/messages/en.json:3172: the drop's "(at most 100)" can never show (40 + 20 + 40 = 100). The cap that does apply, citations lost counting for at most 40 points, isn't stated: a page that lost 90 reads "+ 40 for 90 citations lost". Move thecappedselect onto the lost part (lostPoints < lost) and say "(at most 40)".
The order and the scores are unchanged: the new constants equal the old literals, and the tests tie each breakdown to its row's score.
Stacked on #1334, with #1332 and #1321 under it. Merge those first. It merges cleanly on main.
Tested on top of the current main together with #1343, #1344, #1321, #1329, #1332, #1334 and #1342: web and server tests, tsc, lint and Prettier pass, and schema.sql matches a rebuild. 00229, 00234 and 00238 are applied on production.
Summary
From the user: the Content Plan ranks its list by a 0–100 score that the page never showed. This shows it, with how it is worked out. Step 1 of 2: the calculation and the order don't change.
PriorityBadge: the score coloured by its level, and the level's name ("76 High"), with the same thresholds (90 / 75 / 50,priorityLevelOf).xlthe level's name is hidden (the colour still says it), the header wraps, and the Page column narrows to 200 px. Without that the table ran 87 px past its card at 1024 px; now it fits.PriorityBadgegets an optionallevelClassNamefor this. The Action Center is unchanged.plan.ts:PlanRowcarriesscoreParts, built from the same numbers the score uses;citationsDownScoreandprotectScorenow read named constants (DROP_BASE,PROTECT_BASE,MAX_PROTECT_SCORE) shared with the breakdown;Step 2 (a separate PR, with your input) would align the score to spec v2: the AC-006 priority, page value and the period's change. The order would change then, and this breakdown makes the before/after easy to compare.
Web only, no migration.
Stacked on #1334 (and #1332/#1321/#1320 below it), which change the Plan table this adds to. This PR's own commit is
78fe313d.Related issue
None. Product feedback from the user.
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
/dashboard/content/plan: the Priority list has a Priority Score column after #, e.g. "76 High".Checked in light and dark, at 1280 px and 1024 px. The demo data has only opportunity rows; the drop and top-page breakdowns are covered by tests.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)yarn test: 286 files, 2,530 tests pass.yarn buildpasses with CI's placeholders.🤖 Generated with Claude Code