Skip to content

fix(insights): collapse duplicate provider entries in the AI Model filter - #12

Merged
gkhngyk merged 2 commits into
mainfrom
fix/group-models-by-provider-in-filter
May 13, 2026
Merged

gkhngyk merged 2 commits into
mainfrom
fix/group-models-by-provider-in-filter

Conversation

@gkhngyk

@gkhngyk gkhngyk commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

AI engine vendors swap underlying model slugs between runs.
Each slug was landing in prompt_results.model_used as a distinct value,
and the Insights filter built its dropdown from a deduped Set of raw
slugs — so two "ChatGPT" rows showed up, and a third would appear the
moment gpt-5-6 ships.

Group the dropdown by resolved provider display name. Each option's
value is now a comma-separated list of every raw slug that maps to the
same family (e.g. "gpt-5-3-mini,gpt-5-5"). The label uses the family
display name once.

Server side, applyModelFilter() detects the comma list and switches
from .eq() to .in() on prompt_results.model_used so a single "ChatGPT"
selection still pulls runs from every underlying slug. Single-slug
callers stay on .eq() — backwards compatible.

…lter

AI engine vendors swap underlying model slugs between runs (a ChatGPT
response can come back tagged "gpt-5-3-mini" one day and "gpt-5-5" the
next, the engine often A/B-tests across versions for the same user).
Each slug was landing in prompt_results.model_used as a distinct value,
and the Insights filter built its dropdown from a deduped Set of raw
slugs — so two "ChatGPT" rows showed up, and a third would appear the
moment gpt-5-6 ships.

Group the dropdown by resolved provider display name. Each option's
value is now a comma-separated list of every raw slug that maps to the
same family (e.g. "gpt-5-3-mini,gpt-5-5"). The label uses the family
display name once.

Server side, applyModelFilter() detects the comma list and switches
from .eq() to .in() on prompt_results.model_used so a single "ChatGPT"
selection still pulls runs from every underlying slug. Single-slug
callers stay on .eq() — backwards compatible.
@vercel

vercel Bot commented May 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ansvisor Ready Ready Preview, Comment May 13, 2026 2:57pm

Request Review

…aw slugs

When a provider family option was selected (value carries a
comma-separated slug list so the server can filter the whole family),
the SelectTrigger was rendering the literal value — "gpt-5-3-mini,
gpt-5-5" — instead of the resolved label.

Pass a render function to SelectValue so the trigger maps the value
back to the family's display name (ChatGPT / Gemini / Claude). Falls
back to the placeholder when nothing is selected.
@gkhngyk
gkhngyk merged commit 507f9b0 into main May 13, 2026
1 check passed
@gkhngyk
gkhngyk deleted the fix/group-models-by-provider-in-filter branch May 13, 2026 14:59

This branch was successfully deployed

1 active deployment
Preview — 2b447a21 Deployed May 13, 2026 by vercel[bot]
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.

1 participant