Skip to content

feat(prompts): show a day block's positions in a styled tooltip on the positions panel - #1090

Merged
gkhngyk merged 8 commits into
ansvisor:mainfrom
cihan-gyk:feature/positions-day-tooltip
Oct 16, 2026
Merged

gkhngyk merged 8 commits into
ansvisor:mainfrom
cihan-gyk:feature/positions-day-tooltip

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

A day block's positions on the positions panel now show in a styled tooltip that opens at once, instead of the browser's title tooltip.

On 7d / 30d / 90d, each platform row has a block per day. Hovering one was meant to show that day's positions (#1003). It used the title attribute, which:

  • appears only after about a second;
  • can't be styled, and doesn't follow the light and dark themes;
  • doesn't show at all in some embedded browsers or in screenshots.

Now the same text ("Sep 26, 2026 · 1 run / Mentioned · Early · #1 of 3 / Not cited") opens at once in a tooltip in the app's popover look, and follows the pointer from block to block.

How

  • New wrapper. components/ui/tooltip.tsx is a thin wrapper around Base UI's tooltip (already a dependency, so nothing new to install), in the style of select.tsx and combobox.tsx.
  • One tooltip per row. A 90-day view has 8 × 90 blocks, so each platform row shares a single tooltip through a handle (createTooltipHandle). Each block passes its text as the payload, instead of mounting 720 tooltips.
  • Keyboard. The blocks stay out of the tab order: making them focusable would add up to 720 tab stops. Keyboard and screen-reader users get the same information from the row's aria-label and the platform's expandable day list, as before.
  • Touch: like the title tooltip before it, this one doesn't open on tap.

Stacked on #1089. Please review only the commit feat(prompts): show a day block's positions in a styled tooltip on the positions panel. The merge commit brings in #1089 (and #1088).

Related issue

None. Found while checking the Positions column and panel.

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 a prompt's positions panel at 30d and hover a coloured day block. A tooltip opens at once with the day, its runs and the best mention and citation positions.
  2. Move along the row: the tooltip follows from block to block. An untracked day reads "Not tracked".
  3. Repeat in the dark theme.

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 718/718, and yarn build passes. components/prompts/prompt-positions-sheet.test.tsx adds a test: the blocks carry no title, and hovering one opens the tooltip with its day's positions.
  • In the browser: hovering blocks on the panel at 30d in the light and dark themes opened the tooltip with the day's text, and it followed the pointer between blocks.

🤖 Generated with Claude Code

cihan-gyk and others added 7 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]>
…d isn't named in

The Positions column offered "See" only when the brand had a mention or a
citation, so a prompt that was tracked but never named read "—", like one
with no answers at all, and its panel (where "Not mentioned" and the Improve
tab are) could only be reached through the row's menu. The button now shows
whenever the prompt has answers in the window, and the cell says "Not
mentioned" for such a prompt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e positions panel

A day block's details were the browser's title tooltip: it came up after a
second, couldn't be styled, and on some browsers didn't show at all. They now
open at once in a tooltip in the app's popover look, which follows the
pointer from block to block. Each platform row shares one tooltip, each block
passing its text, rather than mounting up to 90. The blocks stay out of the
tab order; the platform's day list says the same. The Base UI tooltip gets a
thin wrapper in components/ui, like the select and combobox.

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]>
…-unmentioned

# Conflicts:
#	web/messages/en.json
…d test the panel button

A tracked prompt whose pages were cited without the brand being named read
"Not mentioned"; it now reads "Cited only", as the panel's legend calls
that state. Whether a row offers its panel moves into opensPositionsPanel,
next to positionCellKind, so the rule has a test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ay-tooltip

# Conflicts:
#	web/src/components/prompts/prompt-positions-sheet.test.tsx
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk the day blocks' details move from the title tooltip to a Base UI tooltip (no new dependency): it opens at once, follows the light/dark theme and the pointer, with one shared tooltip per platform row rather than up to 720. Blocks stay out of the tab order on purpose (the row's day list covers keyboard users). Stacked on #1089.

…-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.

@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. I merged main into the branch. With #1088 and #1089 now squashed there, their files come from main, and against main the diff is only this PR's three files: the tooltip wrapper, the heat map and its test. Web tests pass (843) and CI is green.

@gkhngyk
gkhngyk merged commit c9fdcf6 into ansvisor:main Oct 16, 2026
5 checks passed
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