Skip to content

feat(prompts): show the table's answer counts on the positions panel's cards - #1088

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/positions-answer-counts
Oct 16, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/positions-answer-counts

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The positions panel's cards now also show the Prompts table's numbers: answers, mentions and citations.

The table and the panel count different things under similar names:

  • The table counts answers (Runs), the brand's mentions in them (Mentions) and its own sources (Citations).
  • The panel counts days, and platforms on 24h.

For a prompt the table shows as 37 runs, 108 mentions and 54 citations, the panel said "Mentioned 10 / 10 days" and "Cited 9 / 10 days". None of the table's numbers could be found in it.

Each card keeps its days (the counting rules #1003 set) and gains a line with the table's count:

Card New line (7d / 30d / 90d)
Runs 37 answers
Mentioned In 37 of 37 answers · 108 mentions
Cited In 27 of 37 answers · 54 citations
  • On 24h, where the cards count platforms in their latest run, the lines say they cover the period, e.g. In 2 of 3 answers in this period · ….
  • Plan scope. The panel never reads a locked platform's answers. Where the plan locks one, a note says the counts cover the included platforms, because the table still sums those answers.

How

  • PositionAnswer carries the answer's mentions and citations (mention_count, citation_count, which getPromptPositions already read).
  • PositionsSummary adds answers, mentionedAnswers, citedAnswers, mentions and citations.
  • The new strings are in en.json under prompts.positions. The panel's existing strings are left as they are.

Related issue

None. Found while checking the Positions column and panel against the table. #1087 fixes the demo data; #1089 and #1090 are stacked on this PR.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Open Prompts → Tracked Prompts at 30d. Note a prompt's Runs, Mentions and Citations.
  2. Open its positions panel. The Runs, Mentioned and Cited cards show the same three numbers.
  3. Switch the panel to 24h. The lines say "in this period".
  4. On a plan that locks a platform with stored answers, the panel notes that the counts cover the included platforms.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): no errors; the 7 warnings are in files this PR does not touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run:

  • web: yarn test passes (713 on this branch), and yarn build passes. New tests:
    • lib/prompt-positions.test.ts: the summary's answer, mention and citation counts, with a locked engine's answers left out.
    • components/prompts/prompt-positions-sheet.test.tsx:
      • the cards' lines;
      • the 24h wording;
      • the locked-platform note.
  • In the browser: on four prompts at 30d, each card's line matched the table's Runs, Mentions and Citations exactly. I checked at 1440px and 1024px, in the light and dark themes.
  • Review: a code review found the 24h cards mixing units and the locked-platform difference; both are fixed above.

🤖 Generated with Claude Code

cihan-gyk and others added 2 commits October 16, 2026 14:33
…s cards

The Prompts table counts answers (Runs), the brand's mentions in them
(Mentions) and its own sources (Citations); the positions panel counted days
and platforms, so none of the table's numbers could be found in it. Each
summary card now also says what the table counts: "37 answers", "In 37 of 37
answers · 108 mentions", "In 27 of 37 answers · 54 citations", on the 24h
view too. The days view the panel was built around stays as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 24h cards count platforms in their latest run, so their answer lines now
say they cover the whole period; and where the plan locks a platform, whose
answers the panel never reads, a note says the counts cover the included
platforms. The panel gets a test for its cards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk the positions panel's cards now also show the table's numbers ("37 answers", "In 37 of 37 answers · 108 mentions", "In 27 of 37 answers · 54 citations") next to #1003's day counts, so the table's Runs/Mentions/Citations can be found in the panel. Web only. #1089 and #1090 are stacked on it; #1087 fixes the demo data so it shows locally.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, approving. Web tests pass on the tree merged with main. The panel's answer counts come from the same mention_count and citation_count the table sums.

@gkhngyk
gkhngyk merged commit e52fae5 into ansvisor:main Oct 16, 2026
6 checks passed
gkhngyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 16, 2026
…-tooltip

main now carries ansvisor#1088 and ansvisor#1089 as squashes; their files come from main, and this branch's tooltip changes stay as they were.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants