Skip to content

Agent: correct usage model highlights - #1567

Closed
matthewrball wants to merge 8 commits into
MaplePrivacyLabs:masterfrom
matthewrball:ux/usage-best-models
Closed

matthewrball wants to merge 8 commits into
MaplePrivacyLabs:masterfrom
matthewrball:ux/usage-best-models

Conversation

@matthewrball

@matthewrball matthewrball commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does

  • Names the best models actually used from the server's catalog groups, rather than ranking only by range usage. DeepSeek Uncensored keeps its purple highlight; GPT-OSS is no longer promoted ahead of it.
  • Gives other used models genuinely spare palette slots and shares their colors across the chart, tooltip, By model and Recent requests. Switching range or metric no longer arbitrarily reorders those colors.
  • Shows up to seven named models. With more than seven, it keeps six plus one gray "More models" aggregate; with fewer, no aggregate appears.
  • Preserves the existing older-host fallback when catalog groups are absent or empty, and keeps billing and catalog loading independent.

Native usage history in light mode with DeepSeek Uncensored in purple Native usage history in dark mode with DeepSeek Uncensored in purple

Notes

  • The temporary Native screenshot lab is not included. Screenshots use a real debug UI with synthetic offline data; no account or production profile was changed.
  • Served catalog groups are authoritative; the compatibility ranking is used only without nonempty groups. Existing localized group names and model labels are reused.
  • Frontend: 1,121 tests, 119 files, 4,373 assertions pass; TypeScript/build, Prettier and ESLint (zero errors; 13 existing warnings outside this diff) pass.
  • Native: focused app tests and Rust formatting pass. The group-less Catalog compatibility case failed before its fix and now passes on both implementations; the same frontend boundary is covered by its focused cases.
  • Fresh Native light/dark screenshots verify the purple Uncensored highlight and matching model-table colors. The five-model example has no "More models"; Native and web regressions cover six-plus-gray overflow.
  • Full workspace just ci is partial on this host because of SQLCipher store failures outside this diff; this is not a claim of full host-native CI parity.

Legacy description

Previous draft

Summary

  • Use the composer catalog's groups and data order for Usage highlights. Name DeepSeek V4.1 Flash Uncensored with its purple highlight instead of letting flat range-usage ranking push it into More models; do not promote unavailable or ungrouped models into featured slots.
  • Show only models used in the selected range, with no unused color slots. Up to seven named models can appear; excess activity folds into one gray More models series. Preserve the compatibility fallback only while catalog-group metadata is unavailable or empty, and load native catalog metadata independently of billing completion.
  • Keep chart, tooltip, By model, and Recent requests colors consistent with the same named/folded decisions and totals. A model newly promoted out of the aggregate borrows the first palette color unused by the other named models, so its earlier and current activity stays consistent across every view.

Validation

  • Focused web Usage regression tests pass: 52 passed, including duplicate catalog memberships and named/aggregate color sharing. The complete frontend formatting, TypeScript, ESLint, and test checks passed earlier in this change.
  • The web one-frame ordering correction uses useLayoutEffect so named-model colors propagate before paint. Its coverage is source analysis and the 52 focused render/data tests, not a fresh browser proof of the single frame.
  • Earlier isolated macOS Settings → Usage runtime checks with the restored isolated session confirmed Uncensored purple and GPT-OSS gray/folded. That proof predates the latest catalog-lifecycle and shared-color refinements; the current native head has not had a rebuilt exact-runtime smoke.
  • Earlier focused native model-data regressions passed. The added native lifecycle test covers requesting metadata without BillingStatus, rereading a cached catalog, and preserving it after a test-backend failure.

Verification limits

The repository's pinned Nix environment and Rust 1.94.1 are unavailable locally. Full host-native warning-denied checks stop on existing objc-macro unexpected_cfgs diagnostics in unchanged native-quit code. The follow-up native binary built, but its test executable did not run because the loader could not find libswift_Concurrency.dylib; therefore, no native tests ran in that attempt. These host attempts are not CI parity. Pinned remote PR CI is green on final head e647d9e4: all selected checks passed, including native lint/tests, macOS, Windows, and research-web. No authentication, billing-data, or production-profile changes are part of this work.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Give DeepSeek V4.1 Flash Uncensored the purple series instead of GPT-OSS. Keep used models named until the seven color slots are full, fold only overflow, and align chart and table colors on web and Agent.
Rank highlighted models by catalog capability and usage, rather than keeping a flat list that let lower-tier models outrank DeepSeek uncensored. Collapse usage into More models only when the legend's available colors are exhausted.

Preserve catalog group metadata through the native cache path so chart, table, and tooltip colors stay aligned without depending on the age of a cache entry.
Rank used models by the server catalog on web and native, with a fixed fallback outside the product path. Load native catalog metadata independently of billing status.

Show up to seven individually named model series, aggregate only true overflow, and keep shared table/chart colors stable when the aggregate appears.
Refresh native model metadata without requiring billing status, coalescing only in-flight requests and preserving the last good catalog on failure.

Propagate shared web model colors before paint and count duplicate catalog entries consistently with native ranking.
@matthewrball matthewrball changed the title Ux: correct usage model highlights Agent: correct usage model highlights Nov 12, 2026
Use the served catalog ranking for native usage colors so DeepSeek Uncensored keeps its purple highlight rather than promoting GPT-OSS. Give other used models genuinely spare palette slots and aggregate only real overflow. Preserve older-catalog compatibility and metric-stable frontend ordering.
@matthewrball
matthewrball marked this pull request as ready for review November 12, 2026 19:47
@AnthonyRonning

Copy link
Copy Markdown
Contributor

I don't see a reason why we need to hardcode model recommendations in the model usage pages.

@matthewrball

Copy link
Copy Markdown
Collaborator Author

@AnthonyRonning Agreed — model recommendations don’t belong in usage reporting, and my previous approach still included hardcoded preferences.

The issue I’m trying to fix is that models outside the fixed list are grouped into “More models,” even when they account for most of someone’s usage.

I’ve replaced that approach in #1625. The five named series now come from actual usage for the selected date range and metric, with no recommendation list or catalog dependency. Remaining models are listed individually in the daily breakdown and “By model” table, with totals preserved. The new draft includes native and web screenshots.

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.

2 participants