[front] feat: wire Models tab of the usage filter panel to real, period-scoped data - #30170
Open
avervaet wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| return "standard"; | ||
| case "premium": | ||
| return "complex"; | ||
| default: |
Contributor
There was a problem hiding this comment.
[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".)
Contributor
Author
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 10:10
3cf9361 to
cefe50f
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 10:10
d8bd447 to
dcd8759
Compare
This was referenced Aug 7, 2026
Open
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 11:03
cefe50f to
d07144c
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 11:03
dcd8759 to
8c695c6
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 13:56
d07144c to
8eafb82
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 13:56
8c695c6 to
5cb6de8
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 15:22
8eafb82 to
fa3b961
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 15:22
5cb6de8 to
efe467a
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 15:39
fa3b961 to
943d84b
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 15:39
efe467a to
3096eb4
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 16:02
3096eb4 to
848d3c7
Compare
avervaet
force-pushed
the
avervaet/wiring-usage-filter-component-agents-tab
branch
from
August 7, 2026 16:02
943d84b to
c53d9f0
Compare
…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
force-pushed
the
avervaet/wiring-usage-filter-component-models-tab
branch
from
August 7, 2026 16:44
848d3c7 to
1885dbe
Compare
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
useConsumptionTop), instead of the mock, period-unaware catalog.ModelsTierResource.getTierForModel) viaresolveConsumptionGroupLabels, instead of random mock values.useModels) grouped by maker, instead of the mock list.UsageFilterstate into the actual consumption queries for the "model" dimension, which it never did before.Stacked on #30166 (Agents tab).
Test plan
npx tsgo --noEmitpasseslabels.test.tsandtop.test.tspass, extended with model maker/tier coverage