Skip to content

fix(web): group insights results by platform - #235

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
VrtxOmega:fix/insights-platform-groups-231
Jun 11, 2026
Merged

fix(web): group insights results by platform#235
gkhngyk merged 1 commit into
ansvisor:mainfrom
VrtxOmega:fix/insights-platform-groups-231

Conversation

@VrtxOmega

Copy link
Copy Markdown
Contributor

Summary

  • Group the insights dashboard prompt-result buckets by platform only, so provider model slug changes do not split one logical platform into duplicate rows.
  • Keep the platform group's model metadata sourced from the latest run, so the badge still reflects the current model.
  • Move the pure grouping helpers into a small local module and add Vitest coverage for slug drift plus distinct-platform separation.

Related issue

Closes #231

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

Validation

  • corepack yarn test 'src/app/[locale]/(dashboard)/dashboard/insights/grouping.test.ts'
  • corepack yarn prettier --check 'src/app/[locale]/(dashboard)/dashboard/insights/page.tsx' 'src/app/[locale]/(dashboard)/dashboard/insights/grouping.ts' 'src/app/[locale]/(dashboard)/dashboard/insights/grouping.test.ts'
  • corepack yarn eslint 'src/app/[locale]/(dashboard)/dashboard/insights/page.tsx' 'src/app/[locale]/(dashboard)/dashboard/insights/grouping.ts' 'src/app/[locale]/(dashboard)/dashboard/insights/grouping.test.ts'
  • corepack yarn format:check
  • corepack yarn test
  • corepack yarn typecheck
  • corepack yarn lint (0 errors; existing unrelated warnings remain in other files)
  • git diff --cached --check

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) - see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused - one concern per PR

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

@gkhngyk
gkhngyk merged commit 7fa757f into ansvisor:main Jun 11, 2026
4 checks passed
@VrtxOmega

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge. PCF helped keep this contribution narrow on my side: it checked for overlapping PRs, kept the change scoped to the insights grouping path, and made sure the project validation passed before I opened it. Appreciate the fast turnaround.

@gkhngyk

gkhngyk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for the great work, @VrtxOmega! 🙌 Clean, well-scoped change — and extracting the grouping into a unit-tested grouping.ts module was a nice touch that goes beyond the one-line fix. The slug-drift and distinct-platform test cases made it easy to verify. Merged with confidence.

If you're up for it, there's a sibling of this exact bug: the prompt detail page (/dashboard/prompts/<id>) has its own copy of groupByPlatform() with the same platform|model key — tracked in #236. You'd be the natural person to take it given the shared grouping.ts you just landed. No pressure either way — thanks again for the contribution!

@VrtxOmega

Copy link
Copy Markdown
Contributor Author

@gkhngyk Thanks, I really appreciate that.

I tried to keep this one narrow and make the review path obvious, so I’m glad the extracted grouping/test coverage helped.

I can take a look at #236 next and see if the same shared helper can cleanly cover that page too.

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.

bug(insights): duplicate platform groups in 'Prompt Results by Topic' when a model slug changes

2 participants