Repository navigation
refactor(web): centralize the duplicated model display-name maps - #501
Merged
Merged
Conversation
Closes #435. The MODEL_DISPLAY_NAME map was copy-pasted on the insights, citations, prompt-detail and competitors pages (the last with model-level Claude labels), so adding a slug meant touching every copy. Two maps now live next to the canonical PLATFORM_LABELS in config/platform-labels.ts: MODEL_PROVIDER_LABELS (provider-level, used by insights / citations / prompt detail) and MODEL_LABELS (model-level, spread from the former with the four Claude overrides, used by competitors). All four local copies and the citations page's PLATFORM_LABELS duplicate are deleted. Rendered labels are unchanged. The prompt-detail page's local PLATFORM_LABELS said 'Gemini' for gemini-web where the canonical map says 'Google Gemini', but that branch is unreachable there: its ModelBadge always passes a model slug (modelUsed ?? platform), so the model map wins before the platform map is consulted.
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #435.
The
MODEL_DISPLAY_NAMEmap was copy-pasted on four dashboard pages (insights, citations, prompt detail, competitors — the last with model-level Claude labels), so adding a new model slug meant touching every copy and a missed one produced inconsistent labels.PLATFORM_LABELSinweb/src/config/platform-labels.ts:MODEL_PROVIDER_LABELS— provider-level (claude-sonnet-5→ "Claude"), used by insights, citations, and prompt detail.MODEL_LABELS— model-level (claude-sonnet-5→ "Claude Sonnet 5"), spread from the provider map with the four Claude overrides, used by the competitors head-to-head badges.MODEL_DISPLAY_NAMEcopies and the citations page's byte-identicalPLATFORM_LABELSduplicate are deleted; a repo-wide search forMODEL_DISPLAY_NAMEreturns nothing. Net −87 lines.PLATFORM_LABELSsaid "Gemini" forgemini-webwhere the canonical map says "Google Gemini" — but that branch is unreachable there (itsModelBadgealways passes a model slug viamodelUsed ?? platform, so the model map wins before the platform map is consulted).Out of scope:
MODEL_TO_PROVIDERintracking.tsis a provider-routing map, not a display-name map — the issue's acceptance criteria only cover theMODEL_DISPLAY_NAMEcopies.Related issue
Closes #435
Type of change
refactor— Code change that neither fixes a bug nor adds a featureHow to test
yarn typecheck,yarn lint,yarn testfromweb/— all pass.npm run dev):grep -r MODEL_DISPLAY_NAME web/src→ no matches.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)