Repository navigation
fix(desktop): chart this session's completed requests in Stats - #1453
Merged
jonathan308 merged 1 commit intoOct 15, 2026
Merged
jonathan308 merged 1 commit into
jonathan308 merged 1 commit into
Conversation
The native desktop API reports this session's local request history with completed_at only (DesktopRequestHistory.swift). recordedTraffic bucketed by settled_at ?? started_at, so every local record produced a NaN bucket and an empty series. Because history existed, Performance did not fall back to observed samples and hid the traffic chart entirely on a serving Mac. Bucket with the shared requestTime helper (settled, completed, started) and label local history as completed rather than settled requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
had a problem deploying
to
benchmarks
October 13, 2026 22:24 — with
GitHub Actions
Error
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonathan308
merged commit Oct 15, 2026
ef41517
into
codex/desktop-mac-preview-20261012
50 of 55 checks passed
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a serving Mac, My Macs → Stats → Performance never showed the traffic chart.
completed_atonly (provider-swift/Sources/darkbloom/Desktop/DesktopRequestHistory.swift,localRequestHistory).recordedTrafficbucketed records bysettled_at ?? started_at!. For local records that isundefined, so every bucket key wasNaNand the function returned[].MacPerformancedidn't fall back to observed samples, andpoints.length > 0hid the chart.The Activity table already handled this through
requestTime()(settled_at ?? completed_at ?? started_at), so the two views disagreed about the same records.Reproduction: render
MacPerformancewith a history of{ completed_at, outcome: 'completed' }records, the shape the Swift API emits while serving. Before: no traffic chart, andrecordedTrafficreturns[]. After: 30-minute buckets, with empty intervals between records kept as explicit zero-request intervals as before, and the chart labeled Completed requests · 30-minute intervals. Ledger history (settled_at) keeps Settled requests.Found during a desktop UI audit. Base:
codex/desktop-mac-preview-20261012(unmerged desktop stack: #1354 plus the signed preview packaging commits). The diff contains only this fix.Before / After
flowchart LR subgraph Before["Before"] direction TB B1(["Serving Mac opens Stats"]):::user --> B2["GET request history<br/>records: completed_at only"]:::code B2 --> B3["recordedTraffic:<br/>settled_at ?? started_at → undefined"]:::bad B3 --> B4["NaN buckets → points = []"]:::bad B4 --> B5(["Traffic chart hidden"]):::bad end subgraph After["After"] direction TB A1(["Serving Mac opens Stats"]):::user --> A2["GET request history<br/>records: completed_at only"]:::code A2 --> A3["recordedTraffic:<br/>requestTime(record)"]:::fix A3 --> A4["30-minute buckets"]:::fix A4 --> A5(["Chart: Completed requests ·<br/>30-minute intervals"]):::good end classDef user fill:#1f2937,stroke:#93c5fd,color:#f9fafb classDef code fill:#312e81,stroke:#a5b4fc,color:#eef2ff classDef bad fill:#7f1d1d,stroke:#fca5a5,color:#fef2f2 classDef fix fill:#065f46,stroke:#6ee7b7,color:#ecfdf5 classDef good fill:#14532d,stroke:#86efac,color:#f0fdf4Legend: blue = user action, indigo = unchanged code path, red = defect, green = changed code / fixed outcome.
Changes
features/stats/data.ts:recordedTrafficbuckets byrequestTime(), the helper the Activity table already uses.features/stats/Performance.tsx: the scope label says Completed requests unless every record is settled.tests/macStats.test.tsx: unit and render regressions using the Swift local-history shape. Both fail on the base branch.CHANGELOG.md: Unreleased entry.Validation
Limitations
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.