Skip to content

feat(web): redesign usage insights - #7147

Merged
maria-rcks merged 8 commits into
mainfrom
ui-refresh/usage
Aug 19, 2026
Merged

feat(web): redesign usage insights#7147
maria-rcks merged 8 commits into
mainfrom
ui-refresh/usage

Conversation

@maria-rcks

@maria-rcks maria-rcks commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Reworks Usage around provider summaries, API cost estimates, hourly and daily curves, clamped hover details, and a simpler totals breakdown.
  • Adds per-provider session counts while retaining source-fingerprint ownership so the same transcript directory is counted once across environments.
  • Uses the shared workspace header from feat(web): unify workspace navigation #7153, introduces a content frame shared by Settings and Usage, and adopts segmented controls.

Screenshots

Direct parent on the left; this PR on the right. Same viewport and copied application state.

BeforeAfter
Usage page before Usage page after
## Why

Usage was mixed with unrelated workspace, Pull Requests, terminal, and tool-call work. This layer keeps the presentation and its small shared aggregation change together for one review.

Validation

  • UsageProviderChart tests
  • usageMerge tests, including duplicate-source ownership and empty-provider handling
  • Affected-package typechecks
  • Changed-file lint and formatting checks

Stack order

  1. feat(web): unify workspace navigation #7153 workspace and navigation
  2. feat(web): redesign usage insights #7147 Usage, this PR
  3. feat(web): refresh pull request details #7148 Pull Requests
  4. feat(web): improve terminal workspace controls #7149 terminal
  5. feat(web): attach composer state drawers #7150 composer
  6. fix(server): preserve tool lifecycle identity #7151 tool lifecycle projection
  7. feat(web): collapse tool activity into one line #7152 tool activity UI

Built with GPT-5.6-sol in the Codex harness.


Note

Medium Risk
Changes usage aggregation (ProviderTotals.sessions, provider list shape) and a large Usage UI refactor; merge logic is tested but displayed totals/session labels depend on correct per-provider session attribution across environments.

Overview
Usage moves metric, time window, and breakdown controls into the shared workspace header—segmented ToggleGroups on large screens and compact Selects on small ones—with the active date range shown in the breadcrumb.

The page layout uses WorkspacePageHeader and WorkspacePageContainer (wide), simplifies the headline and provider sidebar (stable PROVIDER_ORDER, session counts, chart color dots; no metric-based reordering or share bars), trims the totals strip, and swaps custom bordered buttons for segmented toggles in the breakdown section.

Shared UI: new WorkspacePageContainer with readable / wide / expanded max-widths; Settings adopts it instead of local width classes. Toggle / ToggleGroup gain a segmented variant (default size when variant is segmented). WorkspaceBreadcrumbSeparator accepts an optional className.

Data / chart: usageMerge adds sessions per provider (from owned source distinctSessions, still deduped by fingerprint) and tests for empty-provider omission. UsageProviderChart repositions the hover tooltip from cursor-local coordinates (clamped, ResizeObserver); UsageChartLegend is removed.

Reviewed by Cursor Bugbot for commit 3fa0aed. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Redesign the Usage Insights page with responsive controls, provider session counts, and unified header components

  • Replaces the Usage page layout with a breadcrumb header containing responsive metric/period controls (segmented toggles on desktop, selects on mobile), removing the in-chart legend and metric toggle
  • Adds per-provider session counts to mergeUsage output via a new sessions field on ProviderTotals; providers with no sessions and no usage are omitted from results
  • Simplifies the Totals section to show only label/value pairs, removing period averages, cache share details, and provider bar visualizations; providers now display in fixed PROVIDER_ORDER
  • Introduces shared layout primitives: WorkspacePageHeader (standardizes electron drag-region and native-control insets) and WorkspacePageContainer (standardized width presets), replacing bespoke header elements across chat, settings, and onboarding routes
  • Moves the settings sidebar Back button into a new SidebarUtilityMenu component shared with the main sidebar footer; the back action now prefers window.history.back() before falling back to navigating to /
  • Adds segmented size and variant to Toggle/ToggleGroup for the new control styling
  • Behavioral Change: Metric component no longer renders a detail line; UsageSkeleton no longer accepts a resolution prop

Macroscope summarized 8156179.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e5ee8af-399e-4f05-89fe-808aef67f105

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 12.6 KiB 12.6 KiB −15 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 6.3 KiB 6.3 KiB −4 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.3 KiB 6.3 KiB −11 B (−0.2%) 7.8 KiB
Codex Live turn WebSocket decoded 51.8 KiB 51.8 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 12.6 KiB 12.6 KiB +12 B (+0.1%) 15.1 KiB
Claude Thread snapshot wire 6.3 KiB 6.3 KiB +13 B (+0.2%) 7.3 KiB
Claude Live turn WebSocket wire 6.3 KiB 6.3 KiB −1 B (−0.0%) 7.8 KiB
Claude Live turn WebSocket decoded 52.7 KiB 52.7 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: 07f8027 · PR result: 3fa0aed · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 99.9 KiB
  • Claude decoded thread snapshot: 100.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp macroscopeapp 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.

Two consistency findings in the Usage refresh: a hand-rolled glass surface that bypasses the shared glass contract, and a call-site override of the shared workspace topbar height.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsageProviderChart.tsx Outdated
Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated
Comment thread packages/shared/src/usageMerge.ts
@macroscopeapp

macroscopeapp Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR redesigns the usage insights page with new UI components, a segmented toggle variant, and changes to how session counts are aggregated per provider. As a feature introducing new components and data structure changes, it warrants human review.

No code changes detected at 3fa0aed. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp macroscopeapp 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.

UI Consistency

One finding: the new compact header menu duplicates an existing header control instead of routing through a shared primitive. The two items flagged on the previous run (header height override on WorkspacePageHeader, hand-rolled glass on the chart tooltip) are resolved on this head — the header now uses the primitive's geometry unchanged and the tooltip composes surface-glass.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated
@maria-rcks
maria-rcks force-pushed the ui-refresh/usage branch 2 times, most recently from 5e96339 to 2ec34dc Compare August 16, 2026 01:36
Comment thread apps/web/src/components/HeaderFilterMenu.tsx Outdated

@macroscopeapp macroscopeapp 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.

One finding: the usage chart is now the only place provider colors appear, and this PR removes every static key for them.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx

@macroscopeapp macroscopeapp 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.

UI consistency review: the earlier glass-surface and topbar-geometry issues are resolved (the tooltip now uses surface-glass, and the header goes through WorkspacePageHeader without overriding its height). Two remaining findings, both about new shared API surface introduced here.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/HeaderFilterMenu.tsx Outdated
Comment thread apps/web/src/components/ui/segmented-tabs.tsx Outdated
@maria-rcks
maria-rcks force-pushed the ui-refresh/usage branch 2 times, most recently from 4e4d9b3 to 8f2efda Compare August 16, 2026 01:51
Comment thread apps/web/src/components/HeaderFilterMenu.tsx Outdated

@macroscopeapp macroscopeapp 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.

One consistency finding on the new SegmentedTabList primitive. Earlier findings from previous runs (glass tooltip, header geometry, provider color encoding, unused density size) look addressed; the HeaderFilterMenu / CompactFilterMenu duplication flagged previously is still open but not re-reported here.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ui/segmented-tabs.tsx Outdated

@macroscopeapp macroscopeapp 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.

One consistency finding on the new SegmentedTabList primitive. Earlier findings from previous runs (glass tooltip, header geometry, provider color encoding, unused density size) look addressed; the HeaderFilterMenu / CompactFilterMenu duplication flagged previously is still open but not re-reported here.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ui/segmented-tabs.tsx Outdated
@maria-rcks
maria-rcks force-pushed the ui-refresh/usage branch 2 times, most recently from 4421251 to 144e585 Compare August 19, 2026 03:29

@macroscopeapp macroscopeapp 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.

One finding: the usage skeleton's left column no longer matches the geometry of the loaded content it stands in for, so the page still shifts when the last device answers (visible below lg, where the summary column stacks above the chart and everything under it moves). Everything else in this revision looks consistent with the shared system — the segmented size now defaults from the variant, the chart tooltip uses the shared surface-glass composition, and the provider swatches restore the chart's color mapping outside the hover tooltip.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated

@macroscopeapp macroscopeapp 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.

One finding: the new segmented defaulting logic in the shared ToggleGroup primitive has no focused test. Everything else in this revision (shared page frame, breadcrumb separator, segmented track/size ownership, glass tooltip, skeleton geometry) now lines up with the existing shared-component and Tailwind ownership conventions.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ui/toggle-group.tsx

@macroscopeapp macroscopeapp 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.

One finding on the breakdown tables: the new row treatment drops the separators and replaces them with a hover tint that resolves to an imperceptible color in both themes. Everything else in this revision looks consistent with the shared system — the segmented variant now owns its item geometry (with a focused test), the tooltip composes surface-glass, the skeleton mirrors the loaded geometry, and WorkspacePageContainer / WorkspacePageHeader are shared by Settings and Usage alike.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated

@macroscopeapp macroscopeapp 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.

One finding: the two new topbar Select popups keep Base UI's item-aligned positioning, unlike every other align="end" popup in apps/web. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated

@macroscopeapp macroscopeapp 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.

One finding: the two new topbar Select popups keep Base UI's item-aligned positioning, unlike every other align="end" popup in apps/web. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/usage/UsagePage.tsx Outdated

@macroscopeapp macroscopeapp 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.

One finding on the new segmented toggle treatment: in the default dark theme the hover fill lands on top of the pressed fill, so the selected segment is not identifiable while the pointer is inside the group. Everything else in this revision (segmented size defaulting plus its test, alignItemWithTrigger={false} on the new header popups, shared WorkspacePageContainer/WorkspacePageHeader composition, surface-glass chart tooltip, skeleton geometry) lines up with the existing primitives.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ui/toggle.tsx Outdated
Base automatically changed from agent/ui-workspace-refresh to main August 19, 2026 19:50
@maria-rcks
maria-rcks merged commit 8c85b49 into main Aug 19, 2026
20 checks passed
@maria-rcks
maria-rcks deleted the ui-refresh/usage branch August 19, 2026 20:10
bcotrim pushed a commit to bcotrim/mognet that referenced this pull request Aug 20, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 20, 2026
## What's Changed
* fix(desktop): stop automatic passkey prompts by @t3dotgg in pingdotgg/t3code#7522
* fix(web): align version text with its label by @RakshithBhat03 in pingdotgg/t3code#7521
* fix(web): refresh open file with the file tree by @StiensWout in pingdotgg/t3code#7490
* Add OpenCode skill discovery by @dbalders in pingdotgg/t3code#3154
* feat(web): unify workspace navigation by @maria-rcks in pingdotgg/t3code#7153
* fix(web): hide opencode's plan agent when legacy plan mode is off by @UtkarshUsername in pingdotgg/t3code#6420
* feat: refine thread action menus by @maria-rcks in pingdotgg/t3code#7476
* feat(web): redesign usage insights by @maria-rcks in pingdotgg/t3code#7147
* fix(server): outdated gh no longer reads as "not authenticated" by @t3dotgg in pingdotgg/t3code#7588
* fix(desktop): refresh queued updates before install by @SunkenInTime in pingdotgg/t3code#6269
* feat(web): confirm before closing a terminal by @maria-rcks in pingdotgg/t3code#7592
* feat(web): refresh pull request details by @maria-rcks in pingdotgg/t3code#7148
* fix(web): usage hourly breakdown lists every hour chronologically by @lgwacker in pingdotgg/t3code#7595
* fix(web): remove the terminal pane's app-canvas gutter by @jakeleventhal in pingdotgg/t3code#6222
* feat(web): attach composer state drawers by @maria-rcks in pingdotgg/t3code#7150
* fix(server): preserve tool lifecycle identity by @maria-rcks in pingdotgg/t3code#7151
* chore(desktop): use stable Clerk Electron release by @t3dotgg in pingdotgg/t3code#7602


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260819.1133...v0.0.34-nightly.20260820.1139

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260820.1139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant