Skip to content

feat: add Burn Down widgets (single window + 5h & 7d combined)#1255

Open
jamesjlopez wants to merge 1 commit into
steipete:mainfrom
jamesjlopez:feat/burn-down-widgets
Open

feat: add Burn Down widgets (single window + 5h & 7d combined)#1255
jamesjlopez wants to merge 1 commit into
steipete:mainfrom
jamesjlopez:feat/burn-down-widgets

Conversation

@jamesjlopez

Copy link
Copy Markdown

Two new medium widgets that plot a provider's remaining budget against the ideal steady-burn rate line.

Burn Down (single window)
Selectable between the 5-hour session window and the 7-day weekly window via the widget's Edit configuration. Shows % remaining, pace indicator (conserving / over pace / on pace), a mini burn chart with ideal-pace dashed line and projection, and a reset countdown.
Single burn down widget

Burn Down (5h + 7d)
Stacks both windows in a single medium tile so you see session and weekly pace side-by-side without needing two separate widgets.
Combined 5h   7d burn down widget

Edge cases handled

  • Weekly-exhausted clamp: when the 7-day budget is spent, the 5-hour row reads 0% remaining with a blank chart and its "Resets in" timer retargets to the weekly reset.
  • Gemini early-reset: the 5H row shows the sooner 7D reset time when the weekly cap resets before the session window.
  • Provider mismatch: if the configured provider has no snapshot data, the widget shows "Open CodexBar" instead of silently falling back to another provider's numbers.
  • Fresh-window suppression: run-out projection is hidden for the first few minutes of a new window to avoid a false alarm from a single early sample.

Infrastructure

  • BurnWindowChoice AppEnum + window parameter added to the shared ProviderSelectionIntent so the picker doesn't orphan placed tiles.
  • displayPrimary / zeroedRemaining() helpers on WidgetSnapshot.ProviderEntry and RateWindow for the weekly-exhausted clamp.
  • Improved WidgetSnapshotStore.load() with multi-path candidate search and structured error logging.
  • scheduleWidgetReload() coalesces burst reload calls from a single refresh cycle into one trailing reloadAllTimelines().
  • Improved AppGroupSupport sandbox URL lookup for local ad-hoc builds.
  • SwiftUI render tests write PNG artifacts to /tmp for visual review across providers, themes (dark/light/monochrome), and edge cases.

@clawsweeper

clawsweeper Bot commented May 31, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 7:15 PM ET / 23:15 UTC.

Summary
The branch adds two medium Burn Down widgets, a shared widget window parameter, snapshot App Group fallback paths, reload coalescing, Gemini reset handling, Xcode entries, and render artifact tests.

Reproducibility: not applicable. this is a feature PR, not a reported bug. The PR body screenshots are visible-behavior proof for the new widgets, and I did not run the macOS widget bundle in this read-only review.

Review metrics: 3 noteworthy metrics.

  • Feature surface: 2 widget kinds added. Two new user-visible widgets need product sign-off and visual/runtime confidence before merge.
  • Diff size: 12 files, +1738/-13. The branch spans widget UI, core snapshot storage, provider parsing, Xcode project metadata, and tests.
  • Shared intent touched: 1 existing widget intent changed. ProviderSelectionIntent is already used by existing Usage and History widgets, so upgrade behavior matters even though the new parameter is for Burn Down.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Add or link upgrade proof for an already-placed Usage or History widget after the shared ProviderSelectionIntent parameter change.

Mantis proof suggestion
A short desktop/widget proof would materially help verify the new visible widgets and existing widget upgrade behavior. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify both Burn Down widgets render selected-provider data and existing Usage/History widgets keep provider configuration after upgrade.

Risk before merge

  • [P1] The PR changes the shared ProviderSelectionIntent used by existing Usage and History widgets; screenshots prove the new widgets render, but they do not prove already-placed widgets keep their provider configuration and edit behavior across upgrade.
  • [P1] WidgetSnapshotStore load/save candidate paths change local App Group and widget sandbox behavior, so maintainers should verify signed and ad-hoc widget data sharing before merge.

Maintainer options:

  1. Verify widget upgrade behavior (recommended)
    Before merge, prove an already-placed Usage or History widget keeps its provider selection after the shared intent gains the Burn Down window parameter, and that the new widgets still read the expected snapshot path.
  2. Accept the shared-intent tradeoff
    Maintainers may intentionally accept the extra shared intent parameter if preserving placed widgets is more important than keeping existing widget edit sheets Burn-Down-specific.

Next step before merge

  • [P2] Manual review is appropriate because the remaining action is feature sign-off and upgrade confidence, not a discrete automated repair.

Security
Cleared: No concrete security or supply-chain issue was found; the diff adds no dependencies, CI actions, secret handling, or remote code execution paths.

Review details

Best possible solution:

Land the Burn Down widgets after maintainer feature sign-off and upgrade proof that existing provider widgets keep their configuration while the new widgets render only the selected provider's snapshot.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a feature PR, not a reported bug. The PR body screenshots are visible-behavior proof for the new widgets, and I did not run the macOS widget bundle in this read-only review.

Is this the best way to solve the issue?

Unclear: the implementation fits the existing widget structure and now respects provider siloing, but VISION.md places new features and data-storage behavior behind maintainer sign-off. The remaining question is upgrade safety, not a narrow code defect.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 460975a5ceff.

Label changes

Label changes:

  • add P2: This is a normal-priority user-facing feature with bounded but real widget compatibility risk.
  • add merge-risk: 🚨 compatibility: Changing the shared widget intent and snapshot storage paths could affect existing placed widgets or local widget data sharing after upgrade.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. Burn-down pacing turns raw provider quota windows into actionable planning signals, which is a strong fit for CodexBar's control-surface goal.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body includes screenshots of both new widgets rendering after the change; upgrade-safety proof for existing widgets remains a separate merge risk.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority user-facing feature with bounded but real widget compatibility risk.
  • merge-risk: 🚨 compatibility: Changing the shared widget intent and snapshot storage paths could affect existing placed widgets or local widget data sharing after upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. Burn-down pacing turns raw provider quota windows into actionable planning signals, which is a strong fit for CodexBar's control-surface goal.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body includes screenshots of both new widgets rendering after the change; upgrade-safety proof for existing widgets remains a separate merge risk.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes screenshots of both new widgets rendering after the change; upgrade-safety proof for existing widgets remains a separate merge risk.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body includes screenshots of both new widgets rendering after the change; upgrade-safety proof for existing widgets remains a separate merge risk.
Evidence reviewed

What I checked:

Likely related people:

  • Peter Steinberger: Current main blame/log history attributes the existing widget intent, widget bundle, widget snapshot store, and the original widget persistence commit to this author. (role: widget feature history owner; confidence: high; commits: 98fd481366c4, 37bc49f756ba; files: Sources/CodexBarWidget/CodexBarWidgetProvider.swift, Sources/CodexBarWidget/CodexBarWidgetBundle.swift, Sources/CodexBarCore/WidgetSnapshot.swift)
  • Oleksandr Soldatov: Recent provider work touched the widget provider surface while adding Bedrock support, making this a plausible adjacent reviewer for provider-widget behavior. (role: adjacent provider/widget contributor; confidence: medium; commits: c3bc1adcfafc; files: Sources/CodexBarWidget/CodexBarWidgetProvider.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33db1ec91e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/CodexBarWidget/BurnDownWidgetViews.swift Outdated
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 31, 2026
@jamesjlopez jamesjlopez force-pushed the feat/burn-down-widgets branch from 33db1ec to 51c50c5 Compare May 31, 2026 22:54
@jamesjlopez

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51c50c5286

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/CodexBarWidget/CombinedBurnDownWidgetViews.swift Outdated
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 31, 2026
@jamesjlopez jamesjlopez force-pushed the feat/burn-down-widgets branch from 51c50c5 to f43a830 Compare May 31, 2026 23:07
Two new medium widgets that plot a provider's remaining budget against
the ideal steady-burn rate line.

**Burn Down (single window)**
Selectable between the 5-hour session window and the 7-day weekly window
via the widget's Edit configuration. Shows % remaining, pace indicator
(conserving / over pace / on pace), a mini burn chart with ideal-pace
dashed line and projection, and a reset countdown.

**Burn Down (5h + 7d)**
Stacks both windows in a single medium tile so you see session and
weekly pace side-by-side without needing two separate widgets.

**Edge cases handled**
- Weekly-exhausted clamp: when the 7-day budget is spent, the 5-hour
  row reads 0% remaining with a blank chart and its "Resets in" timer
  retargets to the weekly reset.
- Gemini early-reset: the 5H row shows the sooner 7D reset time when
  the weekly cap resets before the session window.
- Provider mismatch: if the configured provider has no snapshot data,
  the widget shows "Open CodexBar" instead of silently falling back to
  another provider's numbers.
- Fresh-window suppression: run-out projection is hidden for the first
  few minutes of a new window to avoid a false alarm from a single
  early sample.

**Infrastructure**
- `BurnWindowChoice` AppEnum + `window` parameter added to the shared
  `ProviderSelectionIntent` so the picker doesn't orphan placed tiles.
- `displayPrimary` / `zeroedRemaining()` helpers on `WidgetSnapshot.ProviderEntry`
  and `RateWindow` for the weekly-exhausted clamp.
- Improved `WidgetSnapshotStore.load()` with multi-path candidate search
  and structured error logging.
- `scheduleWidgetReload()` coalesces burst reload calls from a single
  refresh cycle into one trailing `reloadAllTimelines()`.
- Improved `AppGroupSupport` sandbox URL lookup for local ad-hoc builds.
- SwiftUI render tests write PNG artifacts to `/tmp` for visual review
  across providers, themes (dark/light/monochrome), and edge cases.
- `docs/widget-pitfalls.md` documents non-obvious WidgetKit pitfalls
  discovered during implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamesjlopez jamesjlopez force-pushed the feat/burn-down-widgets branch from f43a830 to 8c9034c Compare May 31, 2026 23:09
@jamesjlopez

Copy link
Copy Markdown
Author

@openclaw-mantis visual task: verify the Burn Down widgets render selected-provider data and that weekly-exhausted 5H rows show 0% with weekly reset and no 5H chart.

@jamesjlopez

Copy link
Copy Markdown
Author

@codexreview

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@jamesjlopez

Copy link
Copy Markdown
Author

@codex review

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c9034cf09

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread Sources/CodexBarWidget/CodexBarWidgetProvider.swift
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. 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