Repository navigation
feat(prompts): show estimated AI volume as a range with an Estimate badge and method note - #1361
Conversation
…adge and method note PROMPT-013, part 1. A prompt's AI volume is the median Google volume of its keywords x the AI adoption rate; how far to trust it follows from how many keywords have data and how closely they agree. lib/volume-estimate.ts turns each stored estimate into a range and a confidence (high, medium, low; a level less when over six months old), and adds them up for the Insights cards. The Prompts page shows ranges with a dashed Estimate badge and a method note (sources, month, confidence, date), greys low-confidence estimates, leaves them out of High Opportunity on their own and sorts them after the confident ones by Volume. The Tracked Prompts CSV gains volume_type, volume_confidence, the range and volume_date. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk PROMPT-013 part 1 (ROADMAP item 03): estimated AI volumes on the Prompts pages become ranges with an Estimate badge and a method note, and low-confidence ones are grey and not ranked on their own. Confidence and range come from what Two choices I'd like your view on:
Parts 2 (Similar Topics, Suggestions, prompt detail card) and 3 (Insights Opportunities, content and Action Center, exports, MCP) will stack on this one. |
gkhngyk
left a comment
There was a problem hiding this comment.
A few fixes before merge. The range and badge plumbing is solid, but the confidence rule doesn't fit real keyword data. I ran it against every prompt_volumes row on prod (3,025 prompts, 56 brands).
-
The confidence rule marks almost everything low (
web/src/lib/volume-estimate.ts:35-39,:78-83).- On prod, 2,606 of 3,025 prompts (86%) come out low. Only 62 come out high.
- High Opportunity Prompts drops from 963 prompts to 92. 23 of the 44 brands that have the card lose it entirely.
- 53 of 56 brands' Total card reads "Estimate · low confidence". None reads high.
- Sorting Tracked Prompts by Volume puts 86% of the rows in the "after the rest" group (
prompt-sort.ts:99-101), so in practice the column no longer sorts by volume. - The cause: the five keywords are head terms that spread widely by design, which is why 00154 takes their median. Their max/min ratio has a median of 58× on prod and a p90 of 823×. A typical row is
[0, 0, 170, 210, 27100], which is low under this rule because of one broad term the median already ignores. - Fix: measure agreement around the median, not at the extremes. For example, use q3/q1 of the measured volumes (the 2nd and 4th of five). With high ≤ 4× and medium ≤ 15×, prod splits 38% high, 40% medium and 23% low, and High Opportunity keeps 757 of its 963 prompts. Calibrate the thresholds on prod data, and add a test with a realistic spread like the row above.
-
The range is almost always exactly ½× to 2× (
volume-estimate.ts:90-93,bounds).- The AI share of the smallest and largest keyword falls outside ½×–2× on both sides for 2,240 of the 2,981 prompts with two or more keywords (75%), and on at least one side for 98%.
- So the range carries no information from the keywords. The note's "from the AI share of the smallest to the largest" (
rangeSpread) is wrong for most rows. - Fix: use q1–q3 × rate, then clamp, in line with item 1. Or keep the fixed band and have the note say "half to twice the estimate" plainly.
-
The method note misstates the 45% (
web/messages/en.json:5309-5311).- "The share of searches that now happen in AI assistants (45%)" is not what the multiplier is. Per
server/src/lib/intent-extraction.jsand 00155, it is the share of Google searches that get an AI answer: AI Overviews show on roughly 43–48% of them. - Fix: "… × the share of Google searches that now get an AI answer ({rate}%)" in
method,methodTotalandmethodAverage.
- "The share of searches that now happen in AI assistants (45%)" is not what the multiplier is. Per
-
One Tooltip root per row in tables without pagination (
prompts/page.tsx:2387,:2464).- The Prompt Volumes and High Opportunity tables render every row. The largest brand has 733 analyzed prompts, so 733+ Tooltip roots and buttons mount, where there were plain spans before.
- Fix: use one
createTooltipHandle()per table with the estimate as the payload, asClampedTextdoes.
-
The Prompt Volumes chart on the same tab still shows exact numbers (
prompts/_charts.tsx:131).- "Est. queries: 12,345" per platform comes from the point estimate. The chart isn't listed for part 2 or part 3.
- Fix: add it to part 3, or show a range there too.
-
Unused code.
rankable(volume-estimate.ts:183) is only used in tests, whileopportunityLevelandcomparePromptSortRowseach repeatconfidence === 'low'. Either use it in both or drop it.- The
perMonthprop onEstimateRangeisn't used yet. Leave it for part 2, where something uses it.
-
PR body. The Drive path in the description has a non-English folder name. Please keep the body English only.
Checked and fine:
- The stored
est_ai_volumematchesround(median × ai_volume_multiplier)on prod, apart from round-half cases. - Every row is at 0.450.
google_volumesholds numbers only.- The CSV columns, the i18n keys and
opportunityLevel's optional argument (it has no other callers) are all fine.
…an, one note per table Review fixes for PROMPT-013 part 1. The keywords are head terms that spread widely by design, so agreement is now the upper over the lower quartile of the measured volumes (as percentile_cont): high at three or more within 4x, medium at two or more within 15x. The range is the AI share of that middle half, clamped to half to twice. The note calls the 45% the share of Google searches that now get an AI answer. Long tables share one tooltip through createEstimateNoteHandle, the Prompt Volumes chart shows each platform's share of the range, rankable is used by both ranking rules, and perMonth waits for part 2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk thanks for running it on prod. Fixed in d297d95:
Checks: web lint (0 errors), typecheck, 2,739 tests, format:check and build. #1362 and part 3a will merge this forward. |
…t Suggestions As ansvisor#1361's tables do: each long list mounts one method note through createEstimateNoteHandle rather than one per row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good. All seven items are done. I re-ran the split on prod (below). Three optional copy fixes are at the end.
Earlier items
- Confidence around the median: done (
volume-estimate.ts:96-105). - The range comes from the quartiles and is clamped: done.
- The 45%: done in
method,methodTotal,methodAverageand the Sources line. - One tooltip per table: done for Prompt Volumes, High Opportunity and Tracked Prompts, and a test covers it.
- Chart: done. "Est. queries" is now a range.
- Unused code: done.
rankableis used by both rules, andperMonthis gone. - Body: done.
Re-ran on prod. This covers all 3,025 prompt_volumes rows across 56 brands, with exactly your rule: quartiles as percentile_cont over volumes > 0, the minimum counts, and one level less after 183 days on fetched_at.
- Prompts: 1,132 high (37.4%), 1,193 medium (39.4%) and 700 low (23.1%). It was 86% low before. The minimum counts only affect the 97 rows with one or two measured keywords.
- Total card: 46 brands read medium, 10 low and none high. Before, 53 read low.
- No brand reaches high. The best has 76% of its volume at high confidence, short of the 80% bar.
- Low-confidence prompts are 23% of prompts but 42.5% of the volume, because the broad ones tend to be large.
- High Opportunity: keeps 755 of 963 prompts (78%), and 353 of the 478 at High. 40 of the 44 brands keep the card. Each of the 4 that lose it had only one or two prompts on it.
- Tracked Prompts sorted by Volume: 23% of rows now sort after the rest, down from 86%.
- Range: over the 2,981 rows with two or more measured keywords:
- 713 (24%) show exactly ½×–2×, down from 75%;
- 161 (5%) show exactly ±25%;
- 303 (10%) take both ends from the quartiles.
- By end: the low end is clamped to ½× for 46% of rows and widened to −25% for 25%. The high end is clamped to 2× for 50% and widened to +25% for 20%.
- High-confidence rows are never clamped at both ends.
Three measured keywords: keep the rule as it is, without a nearest-neighbour case. 143 rows (4.7%) have exactly three measured keywords: 70 high, 51 medium and 22 low.
- Using the median's nearest neighbour instead of the quartiles for n = 3 gives 111 high, 25 medium and 7 low. That promotes 41 rows to high, including rows like
[100, 200, 2000]that are medium today. - Using it only to lift a low row to medium changes 11 rows (14 at ≤ 15×).
- None of the 22 low rows reaches the 1,500 High Opportunity floor. Either way, the only visible effect is a dozen rows across all brands changing from grey to black.
- The overall split is already where it should be, so the special case isn't worth it.
Optional, copy only:
- The note doesn't mention the ±25% floor (
web/messages/en.json:5314), yet it sets at least one end of the range for 39% of rows. For example: "The range is the AI share of the middle half of them, at least a quarter either side and at most half to twice the estimate." aiTipandfootnote(web/messages/en.json:5136-5137) still say "the AI adoption rate", while the note beside them now says "an AI answer share". Align them here, or in part 3 along with the MCP descriptions.- The test title "or volumes 10× apart" (
web/src/lib/volume-estimate.test.ts:55) is from before the 15× rule. Its row's quartiles are 25× apart.
…t page's AI volume as estimates (#1362) * feat(prompts): show estimated AI volume as a range with an Estimate badge and method note PROMPT-013, part 1. A prompt's AI volume is the median Google volume of its keywords x the AI adoption rate; how far to trust it follows from how many keywords have data and how closely they agree. lib/volume-estimate.ts turns each stored estimate into a range and a confidence (high, medium, low; a level less when over six months old), and adds them up for the Insights cards. The Prompts page shows ranges with a dashed Estimate badge and a method note (sources, month, confidence, date), greys low-confidence estimates, leaves them out of High Opportunity on their own and sorts them after the confident ones by Volume. The Tracked Prompts CSV gains volume_type, volume_confidence, the range and volume_date. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(prompts): label Similar Topics, Prompt Suggestions and the prompt page's AI volume as estimates PROMPT-013, part 2. Two more kinds of estimate: one keyword's AI share (its Google volume is measured, only the adoption rate assumed: medium, ±25%) for Similar Topics' rows, and an AI's guess (always low, half to twice) for Prompt Suggestions' volume badge. The method note words each. Similar Topics' Est. AI Volume card shows the prompts' summed range with the Estimate badge, and a prompt's detail page gains an "AI searches a month" card, read through getPromptVolume (the prompt is checked with the user's client before prompt_volumes is read with the admin client). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): read an estimate's confidence and range around the median, one note per table Review fixes for PROMPT-013 part 1. The keywords are head terms that spread widely by design, so agreement is now the upper over the lower quartile of the measured volumes (as percentile_cont): high at three or more within 4x, medium at two or more within 15x. The range is the AI share of that middle half, clamped to half to twice. The note calls the 45% the share of Google searches that now get an AI answer. Long tables share one tooltip through createEstimateNoteHandle, the Prompt Volumes chart shows each platform's share of the range, rankable is used by both ranking rules, and perMonth waits for part 2. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): share one estimate note across Similar Topics and Prompt Suggestions As #1361's tables do: each long list mounts one method note through createEstimateNoteHandle rather than one per row. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gökhan Geyik <[email protected]>
…volumes as estimates (#1364) * feat(prompts): show estimated AI volume as a range with an Estimate badge and method note PROMPT-013, part 1. A prompt's AI volume is the median Google volume of its keywords x the AI adoption rate; how far to trust it follows from how many keywords have data and how closely they agree. lib/volume-estimate.ts turns each stored estimate into a range and a confidence (high, medium, low; a level less when over six months old), and adds them up for the Insights cards. The Prompts page shows ranges with a dashed Estimate badge and a method note (sources, month, confidence, date), greys low-confidence estimates, leaves them out of High Opportunity on their own and sorts them after the confident ones by Volume. The Tracked Prompts CSV gains volume_type, volume_confidence, the range and volume_date. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(prompts): label Similar Topics, Prompt Suggestions and the prompt page's AI volume as estimates PROMPT-013, part 2. Two more kinds of estimate: one keyword's AI share (its Google volume is measured, only the adoption rate assumed: medium, ±25%) for Similar Topics' rows, and an AI's guess (always low, half to twice) for Prompt Suggestions' volume badge. The method note words each. Similar Topics' Est. AI Volume card shows the prompts' summed range with the Estimate badge, and a prompt's detail page gains an "AI searches a month" card, read through getPromptVolume (the prompt is checked with the user's client before prompt_volumes is read with the admin client). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): read an estimate's confidence and range around the median, one note per table Review fixes for PROMPT-013 part 1. The keywords are head terms that spread widely by design, so agreement is now the upper over the lower quartile of the measured volumes (as percentile_cont): high at three or more within 4x, medium at two or more within 15x. The range is the AI share of that middle half, clamped to half to twice. The note calls the 45% the share of Google searches that now get an AI answer. Long tables share one tooltip through createEstimateNoteHandle, the Prompt Volumes chart shows each platform's share of the range, rankable is used by both ranking rules, and perMonth waits for part 2. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): share one estimate note across Similar Topics and Prompt Suggestions As #1361's tables do: each long list mounts one method note through createEstimateNoteHandle rather than one per row. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(action-center): label the Action Center's and Opportunities' AI volumes as estimates PROMPT-013, part 3a. readPromptDemand returns each prompt's estimate (a range and a confidence) instead of a number, so the Affected tab, the Why ("28-42k AI searches a month, estimated"), the history drawer and the action exports show ranges; CSV and Excel gain volume_type and volume_confidence. A topic opportunity's demand and its suggestions' are an AI's guess: grey, low-confidence ranges in the title, the drawer and Insights' Opportunities card. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(action-center): share one estimate note across the Affected tab's volumes As the Prompts tables do (#1361): the column's ranges pass a shared createEstimateNoteHandle rather than mounting a tooltip each. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(action-center): word sums of AI guesses and export confidence for people, keep ranges focusable Pre-push review fixes for PROMPT-013 part 3a. A sum of suggestions' AI guesses gets its own note, and its low-confidence line no longer claims it never ranks. Excel and Markdown word the confidence through volumeEstimate.level while the CSV keeps the code. The topic context keeps its separator in en.json and shares one note across its suggestions, the Opportunities line truncates only its text so the range stays focusable, and tests date their volumes relative to now. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gökhan Geyik <[email protected]>
… current estimate (#1367) * feat(prompts): show estimated AI volume as a range with an Estimate badge and method note PROMPT-013, part 1. A prompt's AI volume is the median Google volume of its keywords x the AI adoption rate; how far to trust it follows from how many keywords have data and how closely they agree. lib/volume-estimate.ts turns each stored estimate into a range and a confidence (high, medium, low; a level less when over six months old), and adds them up for the Insights cards. The Prompts page shows ranges with a dashed Estimate badge and a method note (sources, month, confidence, date), greys low-confidence estimates, leaves them out of High Opportunity on their own and sorts them after the confident ones by Volume. The Tracked Prompts CSV gains volume_type, volume_confidence, the range and volume_date. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(prompts): label Similar Topics, Prompt Suggestions and the prompt page's AI volume as estimates PROMPT-013, part 2. Two more kinds of estimate: one keyword's AI share (its Google volume is measured, only the adoption rate assumed: medium, ±25%) for Similar Topics' rows, and an AI's guess (always low, half to twice) for Prompt Suggestions' volume badge. The method note words each. Similar Topics' Est. AI Volume card shows the prompts' summed range with the Estimate badge, and a prompt's detail page gains an "AI searches a month" card, read through getPromptVolume (the prompt is checked with the user's client before prompt_volumes is read with the admin client). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): read an estimate's confidence and range around the median, one note per table Review fixes for PROMPT-013 part 1. The keywords are head terms that spread widely by design, so agreement is now the upper over the lower quartile of the measured volumes (as percentile_cont): high at three or more within 4x, medium at two or more within 15x. The range is the AI share of that middle half, clamped to half to twice. The note calls the 45% the share of Google searches that now get an AI answer. Long tables share one tooltip through createEstimateNoteHandle, the Prompt Volumes chart shows each platform's share of the range, rankable is used by both ranking rules, and perMonth waits for part 2. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(prompts): share one estimate note across Similar Topics and Prompt Suggestions As #1361's tables do: each long list mounts one method note through createEstimateNoteHandle rather than one per row. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(action-center): label the Action Center's and Opportunities' AI volumes as estimates PROMPT-013, part 3a. readPromptDemand returns each prompt's estimate (a range and a confidence) instead of a number, so the Affected tab, the Why ("28-42k AI searches a month, estimated"), the history drawer and the action exports show ranges; CSV and Excel gain volume_type and volume_confidence. A topic opportunity's demand and its suggestions' are an AI's guess: grey, low-confidence ranges in the title, the drawer and Insights' Opportunities card. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(action-center): share one estimate note across the Affected tab's volumes As the Prompts tables do (#1361): the column's ranges pass a shared createEstimateNoteHandle rather than mounting a tooltip each. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(action-center): word sums of AI guesses and export confidence for people, keep ranges focusable Pre-push review fixes for PROMPT-013 part 3a. A sum of suggestions' AI guesses gets its own note, and its low-confidence line no longer claims it never ranks. Excel and Markdown word the confidence through volumeEstimate.level while the CSV keeps the code. The topic context keeps its separator in en.json and shares one note across its suggestions, the Opportunities line truncates only its text so the range stays focusable, and tests date their volumes relative to now. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(content): show a content opportunity's AI volume as its prompts' current estimate The opportunity detail's Est. AI Volume card, Copy All Data and Export now read the sum of the opportunity's prompts' current estimates as a range with its confidence (PROMPT-013), falling back to the volume kept on the opportunity as an undated, low-confidence estimate. The page reads the basket once for its card and the volume. The MCP get_prompt_volumes rows gain est_ai_volume_low/high, volume_confidence and volume_type, and three tool descriptions say the volumes are estimates. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Cihan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gökhan Geyik <[email protected]>
Summary
PROMPT-013, part 1 of 3: on the Prompts pages, an estimated AI search volume is a range with an "Estimate" badge and a method note, never a bare number that reads as measured. This is item 03 of the ROADMAP plan (mockup screen 2).
What the user sees:
Tooltip.How confidence and range are worked out (
web/src/lib/volume-estimate.ts, from whatprompt_volumesalready stores; no migration):Agreement is read around the median, not at the extremes: the keywords are head terms that spread widely by design, which is why 00154 takes their median. The quartiles are interpolated as
percentile_contdoes (of five, the 2nd and the 4th).est_ai_volumedoesn't change. Sorting and totals still use it.Low confidence isn't ranked on its own (
rankable, used by both rules below):opportunityLevel(estAiVolume, confidence)gives a low-confidence estimate no level, so it isn't listed by volume alone.comparePromptSortRows).Where (
prompts/page.tsx):scaleEstimate), not a point figure.Long tables share one note. The Prompt Volumes and High Opportunity tables list every analyzed prompt, up to 733 on the largest brand, and Tracked Prompts lists a page of them. Each of these tables mounts one tooltip through
createEstimateNoteHandle(), asClampedTextdoes, and every range passes it its estimate.Tooltips and the footnote now say the volume is an estimate shown as a range. The Google Vol. tooltip said "total … across all extracted keywords" and now says the median, as it has been since 00154. The strings this touches moved into
en.json(prompts.volumeInsights,volumeEstimate).Export. The Tracked Prompts CSV gains
volume_type(estimate),volume_confidence,est_ai_volume_low,est_ai_volume_highandvolume_date, afterest_ai_volume.Next PRs (stacked on this one):
Related issue
ROADMAP plan item 03 (PROMPT-013), queued by the user on 2026-10-22. No issue.
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
On a brand with analyzed volumes:
Checked locally on the demo brand (6 analyzed prompts):
Under the quartile rule all six demo prompts read high, since their middle keywords agree; the low and medium cases are covered by tests. The chart's tooltip reads, for example, "Est. queries: 4.7–11k" for Google AI Overview.
Tests:
lib/volume-estimate.test.ts(10): the confidence levels and ranges from the quartiles, including a prod-like row with one broad head term ([0, 0, 170, 210, 27100], low with three measured; medium with five), plus staleness, totals, averages andrankable.components/prompts/volume-estimate.test.tsx(5): range text, grey low, the note for a prompt and for a total, a shared note telling the focused range's estimate, and the badge text and labels.prompt-sort.test.ts(+2): low-confidence volumes after confident ones, before none, in both directions.prompt-volume-opportunity.test.ts(+1).Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/) (0 errors; the 6 warnings are in untouched files, as on main)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run: web
yarn test(2,739 tests) andyarn build.🤖 Generated with Claude Code