perf(spend): bound initial ledger layout on long ranges - #4001
Conversation
Show the newest 30 daily rows initially and retain the complete ledger behind Show all. Consolidate daily/hourly chart styling and per-row provider help without changing source history, totals, chart scope, or exports. Adopt the bounded-ledger portion of #3998 with expanded fixture coverage. Retain the v0.65.0 default status-item width contract while investigating #3993. Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
f659012 to
0fb7e87
Compare
|
Codex review: blocked before merge. Reviewed September 25, 2026, 3:42 PM ET / 19:42 UTC. ClawSweeper reviewWhat this changesThe PR initially displays the newest 30 daily spend rows with an expand control, groups provider tooltips, shares chart styling, and adds layout and regression coverage. Merge readiness⛔ Blocked before merge - 2 items remain Current main still lays out every daily ledger row. This focused PR addresses that behavior, and the reported native layout measurements support its narrower initial-layout claim. The full test suite remains unreported under repository handoff guidance. Priority: P2 Review scores
Verification
How this fits togetherCodexBar turns provider usage snapshots into daily spend summaries for the Settings window. Charts, totals, and the ledger consume those summaries; this change limits the rows laid out initially while preserving the full-period data. flowchart LR
A[Provider usage] --> B[Daily spend summaries]
B --> C[Selected range]
C --> D[Charts and totals]
C --> E[Initial ledger row limit]
E --> F[Settings display]
F --> G[Show all control]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the bounded ledger after full-suite validation, with complete accounting retained and the separate Dock performance question handled on its own merits. Do we have a high-confidence way to reproduce the issue? Yes: a 365-day synthetic history can exercise the production Settings view in an AppKit host, and current main visibly renders every row. The reviewer did not independently run the macOS layout test. Is this the best way to solve the issue? Yes: the existing expand-control pattern gives users access to every row while reducing initial layout work; model totals and charts retain the full range. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a2cf7face10b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Long Usage & Spend ranges initially lay out every daily ledger row. Show the newest 30 rows with the existing Show all / Show less control, keep full-period totals and chart data, and group provider-icon tooltips per row. Shared daily/hourly chart styling offsets the change: production code is 71 insertions and 72 deletions.
This adopts the ledger portion of #3998. Thanks @Yuxin-Qiao; co-author credit is in the commit. The Dock activation-policy change remains outside this adoption because this isolated proof does not measure LaunchServices or live scrolling.
Verification
Synthetic 365-day history, debug build, one warm-up excluded:
The rendered-height regression failed all four baseline iterations and passes after the change. These are layout measurements on a shared host, not scroll-FPS or view-body invocation measurements. Expanded mode still exposes every row.
Results:
Test run with 540 tests in 41 suites passed; XCTest ran 7 cases with 4 opt-in cases skipped and 0 failures;make checkpassed with 0 SwiftLint violations. An initial parallel focused run had timing failures in the existing concurrency suite; the repository runner's--no-parallelmode passes the complete selection.Synthetic before/after renders were inspected. The 30-day, hourly, selected-day hourly, project, session, and overview PNGs are byte-identical. Proof images are retained locally for the coordinator; this lane's permitted REST operations do not include uploads. No running app was relaunched or real account probed.
Independent review reported one missing-import finding; rejected after verifying the existing
@testable import CodexBarat the top of the test and the successful build. No accepted actionable findings remain.The v0.65.0 status-item renderer is unchanged; added width goldens retain 56/49 pt for the default synthetic 16-pt-icon, 50% fixture and 26/19 pt for icon-only (Regular/Tight). The spacing report needs its actual layout settings. PR #3997 is not adopted: its session titles/project labels bypass Hide personal info, and its hourly chart changes from the full range to the latest active day.
Closes #3998
Refs #3997
Refs #3993