Skip to content

feat(insights): show query fan-out on result detail - #362

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
waynedeng01:agent/show-query-fan-out
Jul 7, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
waynedeng01:agent/show-query-fan-out

Conversation

@waynedeng01

Copy link
Copy Markdown
Contributor

Summary

  • carry prompt_results.search_queries through to PromptResult.searchQueries
  • render a Query fan-out section below Citations on the result detail page
  • add helper coverage for visible queries, platform labels, and Perplexity engine labels

Validation

  • npx --yes [email protected] run src/lib/actions/tracking.test.ts 'src/app/[locale]/(dashboard)/dashboard/insights/[id]/query-fanout.test.ts' --config vitest.local.config.mjs
  • npx --yes [email protected] --check src/types/index.ts src/lib/actions/tracking.ts src/lib/actions/tracking.test.ts 'src/app/[locale]/(dashboard)/dashboard/insights/[id]/page.tsx' 'src/app/[locale]/(dashboard)/dashboard/insights/[id]/query-fanout.ts' 'src/app/[locale]/(dashboard)/dashboard/insights/[id]/query-fanout.test.ts'

Note: the Vitest command used a temporary local config for alias resolution because this checkout did not have dependencies installed. yarn install --frozen-lockfile repeatedly stalled while fetching packages in my local environment, so I could not run the full project test/typecheck commands locally.

Closes #361

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Welcome to Ansvisor, and thank you for your first PR! A maintainer will be by soon to review.

In the meantime, two things that make review faster:

  • A short description of why the change matters, not just what it does — most of our PRs link a Fixes #... to the issue that explains the why.
  • A quick local test note if there's anything worth eyeballing in the browser.

If you'd like to keep an eye on where Ansvisor goes next, a ⭐ on the repo helps others discover it (and Watch sends you a ping when related issues land). Either way — looking forward to your next one.

@waynedeng01
waynedeng01 force-pushed the agent/show-query-fan-out branch from 32cf417 to db65b08 Compare July 7, 2026 09:20
@waynedeng01
waynedeng01 marked this pull request as ready for review July 7, 2026 09:22

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

Excellent work — clean data plumbing (ObservedSearchQuery + a safe searchQueries mapping in mapResultRow), the fan-out section renders only when present, and nice cleanup swapping the duplicated local PLATFORM_LABELS for the shared @/config/platform-labels. The extracted query-fanout helpers + tests are a nice touch too.

Since deps wouldn't install in your environment, I ran the checks in an isolated worktree: typecheck, the new tests (4 passing), format:check, and lint all pass. LGTM! 🎉

@gkhngyk
gkhngyk merged commit 70fcc31 into ansvisor:main Jul 7, 2026
3 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.

feat(insights): show the answer's query fan-out on the prompt result detail page

2 participants