Add hourly past-24-hour usage view - #6170
Conversation
- Support hourly aggregation across web, mobile, and server - Add usage formatting, aggregation tests, and user documentation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
- Show today and yesterday labels in the requested time zone - Improve focus styling for usage window controls
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: 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
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.
## 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
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>
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>
What Changed
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
Checklist
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, anduntilTime, plus optionalhourStarton 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) andmerged.hourlyalongside existing daily rollups. ClientuseUsagecache 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
makeWindowin usageFormat.ts to support'hour'resolution, producing a minute-aligned rolling 24-hour window withsinceTime/untilTimebounds.enumerateHourStarts,formatHourShort,formatRelativeHourShort, andformatDateTimeShorthelpers for labeling hourly chart axes and tooltips, including DST-safe formatting.mergeUsageto populate ahourlytotals array fromhourStart-keyed buckets, and updatesUsageService.readSummaryon the server to validate and aggregate hourly requests with strict start-inclusive/end-exclusive semantics.USAGE_CONTRACT_VERSIONfrom 3 to 4 and addsUsageResolution,hourStart, and time-bound fields to the wire contract; older clients default to daily resolution.Macroscope summarized 026b57a.