Skip to content

Add per-provider usage item visibility - #3196

Open
psufka wants to merge 6 commits into
steipete:mainfrom
psufka:feature/provider-usage-visibility
Open

Add per-provider usage item visibility#3196
psufka wants to merge 6 commits into
steipete:mainfrom
psufka:feature/provider-usage-visibility

Conversation

@psufka

@psufka psufka commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • add per-provider Visible usage items checkboxes for every rendered quota or usage row
  • apply each selection consistently to provider menus, Settings previews, and Overview
  • persist selections in ProviderConfig, including sync and compatibility with older clients
  • migrate the existing Codex Spark and Claude Daily Routines choices into the shared model
  • keep hidden rows individually restorable if a provider temporarily stops reporting them

Closes #3182.

This is intended to supersede #3123, whose author recommended this implementation as the more complete version. #3124 remains separate because it chooses which window feeds the menu-bar percentage rather than which rows are shown.

Behavior

All rows remain visible by default, including newly reported rows. This changes presentation only; fetching, alerts, and quota calculations are unchanged.

Hidden unavailable rows remain in Settings as (... unavailable) so they can be restored without resetting other choices. Codex Limit Reset Credits is offered only when that section exists.

Real packaged-app proof

These are captures from a real local setup with live provider data. Personal information was hidden with CodexBar's native Hide Personal Info setting; no synthetic fixture was used.

Settings and live preview

Codex has Weekly and Limit Reset Credits selected; both Spark windows and Credits are hidden. The live Settings preview above the controls reflects the same choice.

Real packaged Settings with per-row choices

Provider menu after relaunch

The exact feature-code head (7fa30cb72) was Release-built, installed into the packaged app, terminated, and relaunched. The Codex provider menu still shows only Weekly and Limit Reset Credits.

Real Codex provider menu after relaunch

Overview after relaunch

The relaunched exact-head app shows Codex Weekly + Limit Reset Credits, Grok Weekly, and Cursor Grok Bot, with no empty sections or layout gaps.

Real Overview after relaunch

Redacted live-run log, persisted non-secret configuration, build hash, and capture provenance

The Settings capture was taken immediately before the final production commit; that commit only excludes hiddenUsageItemIDs from the provider refresh fingerprint. It changes refresh bookkeeping, not UI or rendering. The exact-head provider-menu and Overview captures above reverify the final rendered behavior. Commit 6f56cac3b adds only these proof artifacts.

Additional deterministic UI-test proof

Deterministic per-provider usage-item visibility proof

Validation

  • swift build -c release — passed at the exact feature-code head
  • packaged bundle codesign --verify --deep --strict — passed
  • exact-head packaged app terminate/relaunch — passed; selections persisted
  • swift test --filter ProviderUsageItemVisibility — 8 feature tests passed
  • make check — passed
  • make test — 932 selections in 78 groups; 0 failures and 0 retries

The ClawSweeper test attempt stopped before step 1 because its environment could not download pnpm; the same focused test passes locally as recorded above.

Credit

Includes Nguyễn Nam Long's unavailable-row restoration patch with original commit authorship preserved.

psufka and others added 3 commits August 25, 2026 12:18
The checkbox list was built only from the current menu-card model, so a lane the
user hid disappeared from settings as soon as a partial refresh, an outage, or a
plan change dropped it from the snapshot. The stored ID survived, but the only
way back was Restore Defaults, which discards every other choice too.

Append a row for each hidden item the provider is not reporting right now,
labelled so it reads as unavailable rather than as a live lane.
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@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: b71d91784e

ℹ️ 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/CodexBar/ProviderUsageItemVisibility.swift
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 8:11 AM ET / 12:11 UTC.

ClawSweeper review

What this changes

This PR adds per-provider checkboxes that persist which usage rows appear in provider menus, Settings previews, and the Overview.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main still has only the two provider-specific visibility controls, while this branch implements the requested generic selection model. The implementation and packaged-app proof are credible, but adopting a synced persisted preference and replacing the existing controls needs maintainer product approval plus a current-main merge refresh.

Priority: P3
Reviewed head: c3f608996255e5a9571a57f45a6616aa47896324
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The feature has strong real-app evidence and focused coverage; only the maintainer configuration decision and merge-refresh check remain.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Three prepared local screenshots and the redacted packaged-app log show the selected rows persist through relaunch and render consistently in Settings, the provider menu, and Overview.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Three prepared local screenshots and the redacted packaged-app log show the selected rows persist through relaunch and render consistently in Settings, the provider menu, and Overview.
Evidence reviewed 6 items Current-main capability: Current main has only the existing Codex Spark and Claude Daily Routines visibility gates; it has no generic hidden-item preference or visibility-settings module.
Rendering implementation: The branch filters metrics, credits, and reset credits after model creation, while retaining descriptors for hidden unavailable items so they can be restored.
Compatibility coverage: The branch serializes the new optional provider field and tests that old sync payloads preserve a local selection while an explicit empty array restores defaults.
Findings None None.
Security None None.

Live Verification

Command: swift test --filter ProviderUsageItemVisibility

Result: FAIL (failed) — execution before step 1 expect_output: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz

Assertions:

  • FAIL expect_output: ProviderUsageItemVisibilityTests

How this fits together

CodexBar turns provider usage snapshots into card models, which feed the provider menu, Settings preview, and Overview. This change keeps an unfiltered model for Settings controls and applies a persisted per-provider filter to the rendered card surfaces.

flowchart LR
A[Provider usage snapshots] --> B[Unfiltered usage card]
B --> C[Visible usage item settings]
C --> D[Persisted provider preference]
D --> E[Filtered usage card]
B --> F[Settings selection list]
E --> G[Provider menu]
E --> H[Overview]
Loading

Decision needed

Question Recommendation
Should CodexBar adopt a synced generic per-provider visibility preference that replaces the current Codex Spark and Claude Daily Routines controls? Adopt the generic preference: Approve the opt-in, default-visible shared model after a current-main merge refresh and retain the legacy migration behavior.

Why: The implementation is coherent, but permanently expanding the user preference and sync contract is a product and upgrade-policy choice rather than a mechanical defect repair.

Before merge

  • Resolve merge risk (P1) - This adds a synced persisted array and retires two existing settings controls; maintainers should explicitly accept the upgrade and downgrade semantics before landing.
  • Resolve merge risk (P1) - The branch needs a current-main three-way merge refresh before landing; the reported clean merge state does not prove that the review remains current.
  • Complete next step (P2) - A maintainer must choose whether the new synced preference is the desired long-term product contract, then refresh the branch against current main.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch composition production +365/-41, tests +418/-33 The feature grows both rendering/configuration code and focused coverage for projection, restoration, refresh revisions, and sync.
Localized settings surface 47 files changed; 22 localization catalogs Most touched files support the new Settings labels, while the core behavior spans presentation, persistence, and sync.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #3182
Summary: This PR is the active candidate implementation for the canonical request; the other row-visibility PR covers the same problem, while the percent-window picker is a distinct preference.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Adopt the persisted visibility contract (recommended)
    Accept the default-visible, old-client-preserving sync semantics and merge after refreshing the branch against current main.
  2. Retain the narrower settings model
    Decline this new synced configuration surface and preserve the existing provider-specific controls.

Technical review

Best possible solution:

If maintainers want a generic per-provider display filter, land this opt-in model after refreshing it against current main and preserving the tested legacy-toggle migration and old-client sync behavior.

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

Not applicable: this is a requested new presentation capability, and the supplied real packaged-app captures directly demonstrate its intended behavior.

Is this the best way to solve the issue?

Unclear: the shared model is narrower and more maintainable than adding provider-specific switches, but accepting its persistent sync contract requires maintainer product judgment.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d9e950e49c95.

Labels

Label justifications:

  • P3: This is an optional presentation and settings improvement; it does not alter fetching, alerting, or quota calculations.
  • merge-risk: 🚨 compatibility: The PR introduces a persisted, synced provider preference and migrates behavior from two existing user settings.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Three prepared local screenshots and the redacted packaged-app log show the selected rows persist through relaunch and render consistently in Settings, the provider menu, and Overview.
  • proof: sufficient: Contributor real behavior proof is sufficient. Three prepared local screenshots and the redacted packaged-app log show the selected rows persist through relaunch and render consistently in Settings, the provider menu, and Overview.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Three prepared local screenshots and the redacted packaged-app log show the selected rows persist through relaunch and render consistently in Settings, the provider menu, and Overview.

Evidence

What I checked:

  • Current-main capability: Current main has only the existing Codex Spark and Claude Daily Routines visibility gates; it has no generic hidden-item preference or visibility-settings module. (Sources/CodexBar/MenuCardView+ModelHelpers.swift:936, d9e950e49c95)
  • Rendering implementation: The branch filters metrics, credits, and reset credits after model creation, while retaining descriptors for hidden unavailable items so they can be restored. (Sources/CodexBar/ProviderUsageItemVisibility.swift:72, c3f608996255)
  • Compatibility coverage: The branch serializes the new optional provider field and tests that old sync payloads preserve a local selection while an explicit empty array restores defaults. (Tests/CodexBarTests/SyncModelTests.swift:76, c3f608996255)
  • Feature history: The existing per-family controls date to the Codex Spark visibility feature and Claude Daily Routines toggle; opt-in iCloud provider sync is established separately on main. (Sources/CodexBar/SettingsStore.swift:1070, 01b6dad78274)
  • Real behavior proof: Prepared local proof images show the Settings selections, a relaunched Codex menu containing only Weekly and Limit Reset Credits, and the matching filtered Overview; the accompanying log records a release build and persisted state. (.github/pr-proof/provider-usage-item-visibility-live.log:1, c3f608996255)
  • Base refresh needed: The current-main tree differs from the submitted head beyond this PR's supplied file list, while GitHub reports the PR as mergeable; refresh the three-way merge before landing rather than treating those differences as branch deletions. (d9e950e49c95)

Likely related people:

  • steipete: Introduced the existing Codex Spark visibility control and the opt-in iCloud provider-sync surface that this preference extends. (role: feature and sync-area owner; confidence: high; commits: 11d3fdc65590, 01b6dad78274; files: Sources/CodexBar/SettingsStore.swift, Sources/CodexBarCore/Sync/SyncModels.swift)
  • Trim: Introduced the existing Claude Daily Routines visibility toggle that the generic model replaces. (role: adjacent feature author; confidence: medium; commits: 1f3c65762205; files: Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift)
  • Peter Urda: Added the analogous per-provider accent-color preference, including a compatible optional sync representation. (role: adjacent configuration contributor; confidence: medium; commits: 099bf56f71fc; files: Sources/CodexBarCore/Sync/SyncModels.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch against current main and confirm the final three-way merge before landing.

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 (2 earlier review cycles)
  • reviewed 2026-08-25T19:07:13.200Z sha 7fa30cb :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-25T21:50:53.003Z sha 6f56cac :: needs maintainer review before merge. :: none

@psufka

psufka commented Aug 25, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

Added redacted real packaged-app captures for Settings, the Codex provider menu, and Overview, plus exact-head build/relaunch and persisted-config evidence. These use live provider data, not synthetic fixtures.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added 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. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Feature request: choose visible usage items per provider

2 participants