Skip to content

Add hourly past-24-hour usage view - #6170

Merged
juliusmarminge merged 3 commits into
mainfrom
add-today-usage-tab
Aug 11, 2026
Merged

Add hourly past-24-hour usage view#6170
juliusmarminge merged 3 commits into
mainfrom
add-today-usage-tab

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 11, 2026

Copy link
Copy Markdown
Member

What Changed

  • Added hourly usage aggregation and formatting for the past 24 hours across the server, shared packages, web, and mobile clients.
  • Updated usage charts and state handling to display the new time-series data.
  • Added usage documentation and focused aggregation, chart, formatting, and merge tests.
  • Simplified mobile settings-sheet navigation and related thread/input layouts.
  • Updated mobile and web dependencies and package patches.

Why

Users can now see recent usage trends with hourly resolution instead of relying only on broader totals. The shared aggregation and formatting logic keeps the web and mobile views consistent, while the focused tests cover the new data shapes and rendering behavior.

The accompanying mobile changes align settings navigation with the revised sheet structure and simplify thread interaction layouts and dependency maintenance.

UI Changes

  • Updated the web Usage page and provider charts.
  • Added the hourly past-24-hour usage view to mobile.
  • Updated mobile settings navigation and thread/input layouts.
  • Before/after screenshots and an interaction video should be added for the affected usage and mobile UI changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Touches usage contract version 4 and server aggregation; older environments may show as stale until upgraded, but daily paths stay backward compatible.

Overview
Adds a Past 24h range that shows usage in rolling hourly buckets instead of calendar days, on web and mobile.

The usage contract moves to v4 with optional resolution, sinceTime, and untilTime, plus optional hourStart on buckets. The server validates hourly windows (≤24h, inclusive start / exclusive end) and aggregates into fixed hour buckets anchored to the window start. Shared code adds hour enumeration/formatting (including DST fall-back labels) and merged.hourly alongside existing daily rollups. Client useUsage cache keys include the new window fields; refresh rebuilds the rolling window when bounds would otherwise stay stale.

Charts, breakdown tables, and “per active period” metrics switch between hourly and daily when that range is selected. User docs for reviewing usage are added.

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

Note

Add hourly Past 24h usage view to web and mobile

  • Adds a 'Past 24h' window option to the Usage page (web and mobile) that fetches and displays hourly buckets instead of daily totals.
  • Extends makeWindow in usageFormat.ts to support 'hour' resolution, producing a minute-aligned rolling 24-hour window with sinceTime/untilTime bounds.
  • Adds enumerateHourStarts, formatHourShort, formatRelativeHourShort, and formatDateTimeShort helpers for labeling hourly chart axes and tooltips, including DST-safe formatting.
  • Extends mergeUsage to populate a hourly totals array from hourStart-keyed buckets, and updates UsageService.readSummary on the server to validate and aggregate hourly requests with strict start-inclusive/end-exclusive semantics.
  • Bumps USAGE_CONTRACT_VERSION from 3 to 4 and adds UsageResolution, hourStart, and time-bound fields to the wire contract; older clients default to daily resolution.

Macroscope summarized 026b57a.

- Support hourly aggregation across web, mobile, and server
- Add usage formatting, aggregation tests, and user documentation
@coderabbitai

coderabbitai Bot commented Aug 11, 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: 06ec955a-41a0-4aa9-8fba-5b03f479e052

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

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 11, 2026
Comment thread packages/shared/src/usageFormat.ts
- Show today and yesterday labels in the requested time zone
- Improve focus styling for usage window controls
@github-actions

github-actions Bot commented Aug 11, 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 11.3 KiB 11.3 KiB −9 B (−0.1%) 15.1 KiB
Codex Thread snapshot wire 5.5 KiB 5.5 KiB +4 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 5.9 KiB 5.9 KiB −13 B (−0.2%) 7.8 KiB
Codex Live turn WebSocket decoded 49.7 KiB 49.7 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 16 16 0 (0.0%) 21
Claude Total thread wire 11.3 KiB 11.3 KiB +13 B (+0.1%) 15.1 KiB
Claude Thread snapshot wire 5.5 KiB 5.5 KiB +11 B (+0.2%) 7.3 KiB
Claude Live turn WebSocket wire 5.9 KiB 5.9 KiB +2 B (+0.0%) 7.8 KiB
Claude Live turn WebSocket decoded 50.6 KiB 50.6 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 16 16 0 (0.0%) 21

Baseline: 6676f9c · PR result: 026b57a · 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: 94.6 KiB
  • Claude decoded thread snapshot: 95.4 KiB

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

@macroscopeapp

macroscopeapp Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new 'Past 24h' hourly usage feature with changes across contracts (version bump), server aggregation, web/mobile UIs, and shared utilities. New user-facing features with cross-cutting changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

- Include short time-zone names for repeated fall-back hours
- Add coverage for EDT and EST hourly labels
@juliusmarminge
juliusmarminge merged commit c842c6f into main Aug 11, 2026
19 checks passed
@juliusmarminge
juliusmarminge deleted the add-today-usage-tab branch August 11, 2026 14:47
xiaogwu pushed a commit to xiaogwu/t3code that referenced this pull request Aug 11, 2026
Brings in 7 upstream commits, including two that touch the same code as the
pinned-reorder work: Copy Thread ID in the thread context menu (pingdotgg#5574) and
shift+click new-thread-in-project (pingdotgg#5994). Merged clean, no conflicts.

Also picks up the hourly past-24h usage view (pingdotgg#6170), the GitLab self-hosted
remote routing fix (pingdotgg#6061), mobile composer stabilisation (pingdotgg#5986), the App
Store release version guard (pingdotgg#6177), and the typography font-size default
restore (pingdotgg#6172). pnpm-workspace.yaml, pnpm-lock.yaml and four patches/ files
changed, so this needs a fresh install before it builds.
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 11, 2026
## What's Changed
* feat: add ability to create a new thread in the current project with shift+click and show shortcut in tooltip by @UtkarshUsername in pingdotgg/t3code#5994
* feat(web): add Copy Thread ID to the sidebar and chat header thread context menu by @UtkarshUsername in pingdotgg/t3code#5574
* fix(mobile): stabilize thread composer and interactions by @juliusmarminge in pingdotgg/t3code#5986
* Add hourly past-24-hour usage view by @juliusmarminge in pingdotgg/t3code#6170
* fix(mobile): guard App Store release versions by @juliusmarminge in pingdotgg/t3code#6177
* fix(web): restore typography font sizes to defaults by @StiensWout in pingdotgg/t3code#6172


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260811.1067...v0.0.34-nightly.20260811.1068

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260811.1068
0veek added a commit to 0veek/Ronin that referenced this pull request Aug 11, 2026
Twenty-two upstream commits. Roughly half needed no thought -- server and
shared fixes that this fork never touched: Azure DevOps SSH remotes, bare
Windows drive roots, self-hosted GitLab routing, unborn HEAD in VCS
status, 256-color TERM on Windows, skipping Linux libc detection off
Linux, and OpenCode model slugs containing a slash. The mobile commits do
not apply; apps/mobile was removed here, and its files, patches and EAS
workflow stay deleted.

The rest crossed the shell redesign and needed deciding.

OKLCH palettes (pingdotgg#6036) are adopted. The generator now emits
themeRgbToThemeColor everywhere, including the roles this fork retuned --
the compressed surface tiers, the harder accent-blended border, and the
sidebar rule at 0.2 rather than 0.12 in light. The tuning is the fork's,
the color space is upstream's. Downstream of that: the boot script's
hand-maintained palette copy is regenerated from the real generator
output, and its default-palette copy is pinned back to hex, because
getDefaultThemeColors still returns the Sakura role tables verbatim and
the two halves have to agree or the splash disagrees with the app.

Sidebar footer back buttons (pingdotgg#6031) are taken, rebuilt on this fork's
footer: the meter stays full-bleed below the nav, the nav keeps the
content inset, and the link is still Stats.

The theme-aware environment artwork (pingdotgg#6183) is taken, with one
correction. The merge attached sidebarArtwork to four of the five curated
themes by line position and left OLED Void out. That flag is new; before
it existed the artwork was gated only by the user's identification
setting, so an accidental omission would have silently turned the artwork
off for one theme. All five opt in.

The hourly past-24-hour usage view (pingdotgg#6170) is taken wholesale -- it
reshapes the page's state around windowSelection and sinceTime/untilTime
-- with this fork's Escape-to-leave handler reapplied on top.

Deliberately not taken: T3_CHAT_THEME and the other retired presets that
upstream reintroduces through themePalette and its tests, LegacySidebar
and useLegacySidebarEnabled, the pre-split index.css monolith, and the
Clerk and react-native patch entries. Their ids stay claimed in
RESERVED_THEME_IDS so a settings.json pinned to one still degrades to
system, which now has a test of its own.

@legendapp/list comes back to the catalog with its 3.3.5 patch. The
virtual list behind the chat timeline is a web dependency, and
apps/web/package.json was still asking for it through catalog: with
nothing to resolve to.

Two dead things went with the merge rather than surviving it: the theme
editor's sidebar-artwork toggle, defined but rendered by neither side,
and expectThemeColors, whose only callers were the retired-preset tests.

Verified: typecheck and lint clean across web, server, contracts,
client-runtime and desktop; 2238 tests pass; web builds; desktop smoke
test passes. The ghostty runtimeAbi wasm test fails identically before
and after the merge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
sandscooling pushed a commit to sandscooling/t3code that referenced this pull request Aug 12, 2026
Both new commits are Interface rows. The title toggle is a behaviour change
people will go looking for in settings, and the elapsed clock replaces a label
rather than adding a panel, so neither belongs under Fixes.

Upstream base moves from 0a7c662 to 849bac8, 43 commits past v0.0.33. The
merge was taken rather than replayed: every source file auto-merged and the
only conflict was pnpm-lock.yaml, which is the standing cost of carrying two
pull requests that add dependencies.

The carried table is unchanged and still accurate. pingdotgg#4989 and pingdotgg#5114 were both
re-checked with gh pr view and are still open, and neither has moved off its
pinned commit, so there is nothing new to fetch on either.

README.upstream.md needed no refresh either. Upstream did not touch its own
README across those 38 commits, and the copy here is still byte-identical.

The usage note above the tables also still holds. Upstream added an hourly
past-24-hour view in pingdotgg#6170, which makes its usage page better at the question
it already answered and does not bring it any closer to the plan window the
composer meter reports.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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