fix: let WidgetKit own usage content margins - #3480
Conversation
Remove redundant outer padding from Usage, Switcher, History, and Metric views while preserving system margins and the existing layout semantics. Extracted from #3137; the broader redesign remains separate. Native signed WidgetKit before/after proof uses the same synthetic snapshot. Full 1,031-selection suite, make check, and independent P2 review pass. Production -9 lines; docs and changelog updated. Co-authored-by: iamenahs <xianheng.ma@gmail.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 7, 2026, 5:33 PM ET / 21:33 UTC. ClawSweeper reviewWhat this changesRemoves nine outer-padding modifiers from Usage, Switcher, History, and Metric widgets so WidgetKit controls their margins, and updates the documentation and changelog. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, narrowly scoped fix: current main and v0.56.8 retain the redundant padding. No introduced correctness defect was found. Owner-authored work and the repository’s conservative review policy also preclude cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherCodexBar saves provider usage snapshots for its WidgetKit extension. The extension combines those snapshots with the selected provider and widget size to display usage, credits, costs, and history. flowchart LR
A[Provider usage snapshot] --> B[Widget timeline]
C[Provider and widget size] --> B
B --> D[Usage and metric views]
E[WidgetKit content margins] --> D
D --> F[Desktop widget]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use WidgetKit’s existing content margins while preserving widget data and interactions, with the broader quota and navigation redesign evaluated separately. Do we have a high-confidence way to reproduce the issue? Yes, source establishes an extra 12-point application inset inside WidgetKit’s enabled margins on current main. Native visual reproduction was not independently performed. Is this the best way to solve the issue? Yes. Removing the redundant modifiers uses the existing system margin mechanism and avoids introducing another layout policy or changing saved widget settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 707fdda427f3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Usage, History, Metric, and Switcher widgets added 12-point outer padding to WidgetKit's existing content margins. Switcher compounded that with the nested usage view's padding, wasting space in already narrow tiles.
Remove those nine padding modifiers and let WidgetKit own the content boundary. The existing provider chips, quota ordering, percentages, history, empty states, and internal spacing remain. Burn Down is unchanged. This extracts the concrete inset bug from #3137; its broader appearance and binding-quota design decision remains open. Thanks @iamenahs for identifying the issue and discussing the system-owned margin option.
Native proof uses Developer ID signed baseline and candidate extensions in macOS 26.5 WidgetKit, with five synthetic providers, identical quotas/credits/costs, and seven fixed history points. Both fresh fixture identities read the same persisted snapshot. Relative age labels continue advancing between captures. These are cropped native gallery captures, not headless ImageRenderer approximations. They show Small, Medium, and Large Switcher families; the preexisting five-provider chip wrapping is still visible and is not claimed fixed. Initial cached previews were discarded before the matched capture.
Before:
After:
make checkpasses with zero violations. Independent P0–P2 review is clean. The full local suite passes all 1,031 selections across 86 groups on the first attempt, without retries or timeouts, in 937.6 seconds. After #3341 landed, a changelog-only conflict was resolved by retaining both entries. Widget source and documentation remain byte-identical to the tested candidate; the integration review is clean. Exact-head CI 34163165352 passes all macOS tests, Linux builds, lint, and security checks on 1d37bb2. The earlier run was superseded by the main synchronization, with no test or assertion weakened. The patch removes nine production lines and updates the widget documentation and Unreleased changelog.