Skip to content

fix(usage): merge case-insensitive trend model segments - #541

Merged
xiufengsun merged 1 commit into
xiufengsun:mainfrom
LceAn:fix/trend-model-case-folding
Sep 1, 2026
Merged

fix(usage): merge case-insensitive trend model segments#541
xiufengsun merged 1 commit into
xiufengsun:mainfrom
LceAn:fix/trend-model-case-folding

Conversation

@LceAn

@LceAn LceAn commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • merge trend tooltip model segments case-insensitively after trimming whitespace
  • preserve the spelling of the variant with the highest usage while summing all variants
  • add a regression test for GPT-5.5/gpt-5.5 and whitespace variants

Verification

  • baseline TrendMonitor tests: 12 passed
  • modified TrendMonitor tests: 13 passed
  • dashboard lint, typecheck and production build: passed
  • UI hardcode and architecture guardrails: passed

This PR is scoped to the Usage Trend display and is independent of the Windows stability work in #540.

Summary by CodeRabbit

  • Bug Fixes
    • Improved trend breakdowns by combining model names that differ only by capitalization or extra spaces.
    • Excluded invalid or non-positive usage values from model totals.
    • Sorted model segments by usage and displayed the most-used spelling for each model.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 65e6e606-ec6d-460c-894f-5f4760721f80

📥 Commits

Reviewing files that changed from the base of the PR and between 58db7aa and cc6be18.

📒 Files selected for processing (2)
  • dashboard/src/ui/dashboard/components/TrendMonitor.jsx
  • dashboard/src/ui/dashboard/components/__tests__/TrendMonitor.test.jsx

Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The dashboard now merges model usage entries by trimmed, case-insensitive names. It filters invalid values, preserves the highest-usage display spelling, sorts totals, and uses the merged results for model bar segments. Tests cover normalization and aggregation.

Changes

Model Segment Normalization

Layer / File(s) Summary
Merge and render normalized model segments
dashboard/src/ui/dashboard/components/TrendMonitor.jsx, dashboard/src/ui/dashboard/components/__tests__/TrendMonitor.test.jsx
mergeModelSegments filters invalid values, merges normalized model names, preserves the highest-usage spelling, and sorts totals. getBarSegments uses the helper and retains the token-type fallback. Tests verify trimming, case-insensitive merging, and summed values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to cc6be

This localized dashboard change merges equivalent model labels while preserving the highest-usage spelling and includes regression coverage; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: xiufengsun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: merging usage trend model segments without case sensitivity.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xiufengsun
xiufengsun merged commit c84545a into xiufengsun:main Sep 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants