Skip to content

fix: let WidgetKit own usage content margins - #3480

Merged
steipete merged 2 commits into
mainfrom
codex/widget-native-margin-fix
Sep 7, 2026
Merged

fix: let WidgetKit own usage content margins#3480
steipete merged 2 commits into
mainfrom
codex/widget-native-margin-fix

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Owner

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:

Native WidgetKit baseline

After:

Native WidgetKit with system-owned margins

make check passes 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.

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>
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 7, 2026, 5:33 PM ET / 21:33 UTC.

ClawSweeper review

What this changes

Removes 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
Reviewed head: 1d37bb22f7c978653c20144aaf033da5830d7361

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent repair with no actionable correctness findings and reported full validation; reviewer attachment access does not reduce its rating.
Proof confidence 🌊 off-meta tidepool Not applicable: The OWNER-authored PR is exempt from the contributor-proof gate. Its body reports native macOS 26.5 Switcher before/after captures exercising the changed margin boundary, but attachment retrieval failed; inspected local images belong to the separate redesign and cannot independently confirm this candidate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The OWNER-authored PR is exempt from the contributor-proof gate. Its body reports native macOS 26.5 Switcher before/after captures exercising the changed margin boundary, but attachment retrieval failed; inspected local images belong to the separate redesign and cannot independently confirm this candidate.
Evidence reviewed 10 items Applicable repository policy: Read the complete root AGENTS.md. No nested AGENTS.md files or .agents/maintainer-notes directory were found. Applied its small-change, provider-isolation, and native-widget verification guidance; builds and tests were not executed under the read-only review contract.
Verified introduced scope: The pinned main-to-head diff contains nine padding deletions and two prose additions across three files. It does not change widget configuration, stored snapshots, provider selection, intent execution, dependencies, or packaging.
System margins remain enabled: The four affected widget configurations instantiate the reviewed views without disabling WidgetKit content margins. Their entrypoints retain container backgrounds and layout frames; the removed padding therefore eliminates an additional application-owned inset.
Findings None None.
Security None None.

How this fits together

CodexBar 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]
Loading

Before merge

  • Resolve merge risk (P1) - Independent visual verification remains limited: this PR’s native attachments returned Cache miss, while prepared local images show the broader redesign branch.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production −9 lines; tests 0; documentation/changelog +2 The repair removes redundant layout modifiers without adding implementation or configuration surface.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Use WidgetKit’s existing content margins while preserving widget data and interactions, with the broader quota and navigation redesign evaluated separately.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a bounded widget-spacing improvement without changed data, account, or provider behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The OWNER-authored PR is exempt from the contributor-proof gate. Its body reports native macOS 26.5 Switcher before/after captures exercising the changed margin boundary, but attachment retrieval failed; inspected local images belong to the separate redesign and cannot independently confirm this candidate.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md. No nested AGENTS.md files or .agents/maintainer-notes directory were found. Applied its small-change, provider-isolation, and native-widget verification guidance; builds and tests were not executed under the read-only review contract. (AGENTS.md:1, 1d37bb22f7c9)
  • Verified introduced scope: The pinned main-to-head diff contains nine padding deletions and two prose additions across three files. It does not change widget configuration, stored snapshots, provider selection, intent execution, dependencies, or packaging. (Sources/CodexBarWidget/CodexBarWidgetViews.swift:126, 1d37bb22f7c9)
  • System margins remain enabled: The four affected widget configurations instantiate the reviewed views without disabling WidgetKit content margins. Their entrypoints retain container backgrounds and layout frames; the removed padding therefore eliminates an additional application-owned inset. (Sources/CodexBarWidget/CodexBarWidgetBundle.swift:15, 1d37bb22f7c9)
  • Still necessary on main: The fetched main revision retains all nine .padding(12) modifiers removed by this branch. (Sources/CodexBarWidget/CodexBarWidgetViews.swift:130, 707fdda427f3)
  • Latest release comparison: The supplied latest-release revision, v0.56.8, also retains all nine outer-padding modifiers; this repair is not already shipped there. (Sources/CodexBarWidget/CodexBarWidgetViews.swift:130, 6ef82690b4a7)
  • Re-review continuity: Widget source and documentation are byte-identical to the earlier reviewed head. The previous completed review contained no findings; its attachment-access limitation does not establish a patch defect or a contributor-proof requirement for an OWNER-authored PR. (Sources/CodexBarWidget/CodexBarWidgetViews.swift, 1d37bb22f7c9)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-07T21:05:36.317Z sha a44acc0 :: blocked before merge. :: none

@steipete
steipete merged commit 912eac2 into main Sep 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant