Skip to content

[front] feat: wire Models tab of the usage filter panel to real, period-scoped data - #30170

Open
avervaet wants to merge 1 commit into
avervaet/wiring-usage-filter-component-agents-tabfrom
avervaet/wiring-usage-filter-component-models-tab
Open

[front] feat: wire Models tab of the usage filter panel to real, period-scoped data#30170
avervaet wants to merge 1 commit into
avervaet/wiring-usage-filter-component-agents-tabfrom
avervaet/wiring-usage-filter-component-models-tab

Conversation

@avervaet

@avervaet avervaet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Models now come from the same period-ranked consumption data the Attribution table uses (useConsumptionTop), instead of the mock, period-unaware catalog.
  • The maker (lab) and Fast/Standard/Complex quick-filter tier are also real now, resolved server-side from the model config and its pricing tier (ModelsTierResource.getTierForModel) via resolveConsumptionGroupLabels, instead of random mock values.
  • "More models" now browses the workspace's real, period-independent model catalog (useModels) grouped by maker, instead of the mock list.
  • Wires the page's UsageFilter state into the actual consumption queries for the "model" dimension, which it never did before.

Stacked on #30166 (Agents tab).

Test plan

  • npx tsgo --noEmit passes
  • labels.test.ts and top.test.ts pass, extended with model maker/tier coverage
  • Manually exercise the Models tab filter panel in the browser (period top-100 list, tier quick filter, "More models" browse-by-maker, and that selecting a model actually narrows the overview/chart/attribution table)

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
playground Ignored Ignored Preview Aug 7, 2026 5:04pm
storybook Ignored Ignored Preview Aug 7, 2026 5:04pm

Request Review

@dust-agent dust-agent Bot 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.

Reviewed for coding rules compliance.

return "standard";
case "premium":
return "complex";
default:

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.

[GEN6] Prefer exhaustive switch + assertNever over if/else on union types

The default branch silently swallows both legitimate null/undefined values and any future unknown ModelsTierName values added server-side. Since this processes backend data, separate them so TypeScript can enforce exhaustiveness on the tier union while gracefully ignoring unknown API values.

Suggested change
default:
if (tier === null || tier === undefined) {
return undefined;
}
switch (tier) {
case "cost_efficient":
return "fast";
case "balanced":
return "standard";
case "premium":
return "complex";
default:
assertNeverAndIgnore(tier);
return undefined;
}

(Don't forget to import assertNeverAndIgnore from "@app/types/shared/utils/assert_never".)

@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from 3cf9361 to cefe50f Compare August 7, 2026 10:10
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from d8bd447 to dcd8759 Compare August 7, 2026 10:10
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from cefe50f to d07144c Compare August 7, 2026 11:03
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from dcd8759 to 8c695c6 Compare August 7, 2026 11:03
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from d07144c to 8eafb82 Compare August 7, 2026 13:56
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from 8c695c6 to 5cb6de8 Compare August 7, 2026 13:56
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from 8eafb82 to fa3b961 Compare August 7, 2026 15:22
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from 5cb6de8 to efe467a Compare August 7, 2026 15:22
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from fa3b961 to 943d84b Compare August 7, 2026 15:39
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from efe467a to 3096eb4 Compare August 7, 2026 15:39
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from 3096eb4 to 848d3c7 Compare August 7, 2026 16:02
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-agents-tab branch from 943d84b to c53d9f0 Compare August 7, 2026 16:02
…od-scoped data

Models now come from the same period-ranked consumption data the
Attribution table uses (useConsumptionTop), instead of the mock,
period-unaware catalog. The maker (lab) and Fast/Standard/Complex
quick-filter tier are also real now, resolved server-side from the model
config and its pricing tier (ModelsTierResource.getTierForModel) via
resolveConsumptionGroupLabels, instead of random mock values. "More
models" now browses the workspace's real, period-independent model
catalog (useModels) grouped by maker, instead of the mock list.

Also wires the page's UsageFilter state into the actual consumption
queries for the "model" dimension, which it never did before.
@avervaet
avervaet force-pushed the avervaet/wiring-usage-filter-component-models-tab branch from 848d3c7 to 1885dbe Compare August 7, 2026 16:44
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