Skip to content

refactor: single source of truth for Claude model families - #64

Merged
patoles merged 1 commit into
mainfrom
refactor/shared-claude-families
Jul 11, 2026
Merged

refactor: single source of truth for Claude model families#64
patoles merged 1 commit into
mainfrom
refactor/shared-claude-families

Conversation

@patoles

@patoles patoles commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Consolidates the Claude family list that existed in three places (the formatModelName regexes, MODEL_FAMILY_CONTEXT, and MODEL_FAMILY_COST) into one CLAUDE_FAMILIES table in canvas-constants.ts that drives display names, context windows, and cost rates. Also makes the formatter match case-insensitively, consistent with the tables' documented lower-cased matching. No behavior change for existing model IDs. Follow-up promised in #60.

How to test

  1. pnpm test — includes two new tests: case-insensitive matching, and a loop asserting every CLAUDE_FAMILIES entry is formattable.
  2. pnpm run build:web.
  3. In the visualizer, model labels, context bars, and cost display are unchanged.

Checklist

The family list existed in three places: the formatModelName regexes,
MODEL_FAMILY_CONTEXT, and MODEL_FAMILY_COST. Adding a family meant three
lockstep edits across two files, and the formatter matched case-sensitively
while the tables are documented as lower-cased.

One CLAUDE_FAMILIES table now drives display names, context windows, and
cost rates; the formatter regexes are built from it and match
case-insensitively. Follow-up promised in #60.
@patoles
patoles merged commit 84cd2fb into main Jul 11, 2026
2 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.

1 participant