Skip to content

Display: add workday segmentation for weekly progress bars#1102

Open
Yuxin-Qiao wants to merge 3 commits into
steipete:mainfrom
Yuxin-Qiao:weekly-progress-workday-segmentation
Open

Display: add workday segmentation for weekly progress bars#1102
Yuxin-Qiao wants to merge 3 commits into
steipete:mainfrom
Yuxin-Qiao:weekly-progress-workday-segmentation

Conversation

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor

Fixes

Fixes #1096 — Weekly Progress Bar configurable to segment in number of work days.

Summary

  • Add a Display preference for weekly progress work-day segmentation:
    • Off
    • 4 days
    • 5 days
    • 7 days
  • Draw display-only day-boundary tick marks on weekly usage bars using the existing UsageProgressBar marker rendering
  • Keep the default Off / nil, so existing users see no UI change
  • Merge work-day markers with existing quota warning markers
  • No warning/alert behavior added; future warnings remain out of scope for this PR

Scope

  • Display/UI only
  • No provider fetcher changes
  • No UsageStore refresh changes
  • No OpenCode/OpenCodeGo changes
  • No Kimi changes
  • No MiniMax changes

Validation

  • swift test --filter MenuCardQuotaWarningMarkerTests
  • swift test --filter SettingsStoreCoverageTests
  • swift test --filter MenuCardModelTests
  • make check
  • git diff --check

Fixes steipete#1096 — Weekly Progress Bar configurable to segment in number of work days.

- Add a Display preference for weekly progress work-day segmentation:
  Off / 4 days / 5 days / 7 days
- Draw display-only day-boundary tick marks on weekly usage bars
- Keep the default Off / nil so existing users see no UI change
- Merge work-day markers with existing quota warning markers
- No warning/alert behavior added; future warnings remain out of scope for this PR

Validation:
- swift test --filter MenuCardQuotaWarningMarkerTests
- swift test --filter SettingsStoreCoverageTests
- swift test --filter MenuCardModelTests
- make check
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-22 17:27 UTC / May 22, 2026, 1:27 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

Summary
The branch adds an optional Display preference for Off/4/5/7 work-day segmentation, wires it into weekly menu metrics and tests, and includes a Linux FoundationNetworking import for the Alibaba cookie header.

Reproducibility: not applicable. for a feature PR. Source review verifies the new display, settings, and model paths, but there is no current-main bug reproduction path to establish.

PR rating
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Summary: The patch looks normally mergeable at source-review level, but missing real behavior proof keeps the overall PR below merge-ready quality.

Rank-up moves:

  • Attach a redacted screenshot or short recording showing the Display picker and weekly tick marks in a built CodexBar app.
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.

Real behavior proof
Needs real behavior proof before merge: No real behavior proof is attached; the contributor should add a redacted screenshot or recording of the Display picker and weekly tick marks in the built app, avoiding private details such as IPs, API keys, phone numbers, and non-public endpoints, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review if needed.

Mantis proof suggestion
A short desktop visual proof would directly show the picker choices and weekly progress-bar tick marks that unit tests cannot fully demonstrate. 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 the Display weekly work-days picker shows Off/4/5/7 and selecting 5 days adds tick marks to weekly usage bars while Off has none.

Risk before merge

  • The PR still lacks real behavior proof, so reviewers cannot confirm the new picker layout and weekly tick marks render correctly in a built CodexBar app.

Maintainer options:

  1. Decide the mitigation before merge
    Land the opt-in setting after redacted UI proof shows Off and a segmented weekly bar in the built app, while keeping the default disabled for existing users.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
Contributor action is needed for real UI proof; I found no narrow code repair left for ClawSweeper to queue.

Security
Cleared: Only Swift UI/model/settings/localization/test files and a conditional FoundationNetworking import are changed; no dependency, script, secret, permission, or supply-chain surface change was found.

Review details

Best possible solution:

Land the opt-in setting after redacted UI proof shows Off and a segmented weekly bar in the built app, while keeping the default disabled for existing users.

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

Not applicable for a feature PR. Source review verifies the new display, settings, and model paths, but there is no current-main bug reproduction path to establish.

Is this the best way to solve the issue?

Mostly yes if maintainers want this UI option: the patch keeps the default Off, reuses existing marker rendering, wires menu observation, and covers model/settings behavior, but it is not merge-ready without real UI proof.

Label justifications:

  • P2: This is a limited user-facing display improvement with no blocking code finding, but it still needs proof before merge.
  • rating: 🧂 unranked krab: Current PR rating is 🧂 unranked krab because proof is 🧂 unranked krab, patch quality is 🐚 platinum hermit, and The patch looks normally mergeable at source-review level, but missing real behavior proof keeps the overall PR below merge-ready quality.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No real behavior proof is attached; the contributor should add a redacted screenshot or recording of the Display picker and weekly tick marks in the built app, avoiding private details such as IPs, API keys, phone numbers, and non-public endpoints, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review if needed.

What I checked:

  • PR proof status: The PR body and later comments list focused Swift tests, make check, and git diff --check, while the contributor explicitly says UI proof can be attached next; no screenshot, recording, live output, or log proof is present in the provided PR discussion. (ebf2e2f01318)
  • Display setting diff: The PR diff adds a Display picker for weekly progress work days with Off, 4 days, 5 days, and 7 days choices. (Sources/CodexBar/PreferencesDisplayPane.swift:78, ebf2e2f01318)
  • Marker composition diff: The PR diff adds marker helpers that merge quota warning markers with work-day boundary markers and only generate work-day markers for 10080-minute weekly windows. (Sources/CodexBar/MenuCardQuotaWarningMarkers.swift:18, ebf2e2f01318)
  • Earlier Codex-path review addressed: A prior review comment noted Codex weekly lanes were missed; the follow-up diff now routes Codex lanes through codexLaneMarkerPercents and adds Codex projection coverage for workday markers, merged markers, and show-used behavior. (Sources/CodexBar/MenuCardView.swift:1432, d8aa68866e42)
  • Current main lacks the feature: Current main still only has warningMarkerPercents in MenuCardQuotaWarningMarkers.swift, with no weeklyProgressWorkDays/workDaysPerWeek setting or work-day marker helper. (Sources/CodexBar/MenuCardQuotaWarningMarkers.swift:15, cdb6acba6407)
  • No maintainer notes found: The checkout does not contain matching .agents/maintainer-notes entries for the touched display, settings, menu model, or provider files. (cdb6acba6407)

Likely related people:

  • steipete: Current relevant files are attributed to the v0.28.0 release commit in this shallow checkout, the path shortlog is dominated by Peter Steinberger, and the related issue has an OWNER status comment from steipete. (role: recent area contributor and repository owner signal; confidence: high; commits: 2db843a4600f; files: Sources/CodexBar/MenuCardView.swift, Sources/CodexBar/PreferencesDisplayPane.swift, Sources/CodexBar/SettingsStore.swift)
  • Alekstodo: Commit 18eb73d introduced the quota warning controls and marker rendering surface that this PR extends. (role: introduced marker behavior; confidence: high; commits: 18eb73dde236; files: Sources/CodexBar/MenuCardQuotaWarningMarkers.swift, Sources/CodexBar/MenuCardView.swift, Sources/CodexBar/PreferencesDisplayPane.swift)
  • Thiago Costa: Commit 009420a added the option to hide quota warning markers, the closest existing Display setting and settings-store path to this PR. (role: adjacent display/settings contributor; confidence: medium; commits: 009420a7f1de; files: Sources/CodexBar/PreferencesDisplayPane.swift, Sources/CodexBar/SettingsStore+Defaults.swift, Sources/CodexBar/SettingsStore+MenuObservation.swift)
  • Ratul Sarna: Commit 72e997e appears in the codexRateMetrics history and is relevant to the Codex projection lane path updated by the PR. (role: Codex menu projection contributor; confidence: medium; commits: 72e997ec66a6; files: Sources/CodexBar/MenuCardView.swift, Tests/CodexBarTests/MenuCardModelCodexProjectionTests.swift)
  • Misty: Commit b2bc921 introduced the Alibaba Token Plan provider file touched by the PR's Linux import follow-up. (role: Alibaba provider introducer; confidence: medium; commits: b2bc921ab8b8; files: Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift)

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

Copy link
Copy Markdown

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

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: 472f90d1d9

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/MenuCardView.swift Outdated
Comment on lines +1389 to +1393
warningMarkerPercents: (Self.warningMarkerPercents(
thresholds: input.quotaWarningThresholds[.weekly],
showUsed: input.usageBarsShowUsed))
showUsed: input.usageBarsShowUsed) + workDayMarkerPercents(
workDays: input.workDaysPerWeek,
windowMinutes: weekly.windowMinutes)).sorted())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply work-day markers to Codex weekly metrics

The new work-day segmentation is only merged into secondaryMetric, so it affects non-Codex providers but not the Codex path that builds weekly bars via codexRateMetrics. When provider == .codex and a projection is present, users can set “Weekly progress work days” and see no day-boundary markers on the weekly lane, which makes the new Display setting inconsistent across providers. Please also merge workDayMarkerPercents(...) into the weekly case in codexRateMetrics.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Follow-up fixes pushed for review feedback:

  • Added weeklyProgressWorkDays to SettingsStore.menuObservationToken, so changing the Display picker invalidates cached menu content.
  • Added focused observation coverage in SettingsStoreTests.
  • Applied workday markers to Codex weekly lanes built through codexRateMetrics.
  • Added Codex projection coverage for:
    • workday markers on weekly lanes
    • merging with quota warning markers
    • no inversion when usageBarsShowUsed is enabled
  • Moved marker composition helpers into MenuCardQuotaWarningMarkers.swift to keep MenuCardView.swift compact.
  • make check passes.

Validation:

  • swift test --filter MenuCardQuotaWarningMarkerTests
  • swift test --filter SettingsStoreCoverageTests
  • swift test --filter MenuCardModelTests
  • swift test --filter MenuCardModelCodexProjectionTests
  • swift test --filter SettingsStoreTests
  • make check
  • git diff --check

@clawsweeper clawsweeper Bot added the P2 Normal priority bug or improvement with limited blast radius. label May 22, 2026
@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Status update:

I can also add a redacted screenshot or short recording showing the Display picker and weekly tick marks if that would help review.

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Pushed follow-up fix in ebf2e2f to unblock Linux CLI CI:\n\n- Added conditional import in for Linux symbol availability.\n- No behavior change to the weekly progress workday segmentation feature in this PR.\n\nI’ll also add UI proof (Display picker + weekly tick marks) next if needed for ClawSweeper proof gate.

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Follow-up fix pushed in ebf2e2f to unblock Linux CLI CI.

  • Added conditional FoundationNetworking import in Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift for Linux HTTPCookie symbol availability.
  • No behavior change to the weekly progress workday segmentation feature in this PR.

If needed, I can also attach UI proof (Display picker + weekly tick marks) for the ClawSweeper proof gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature (small?): Weekly Progress Bar configurable to segment in number of work days

1 participant