Skip to content

Add per-provider usage item visibility - #3196

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

Add per-provider usage item visibility#3196
psufka wants to merge 7 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 29, 2026, 9:54 AM ET / 13:54 UTC.

ClawSweeper review

What this changes

The PR adds per-provider usage-row checkboxes, persists the selections, and applies them to provider menus, Settings previews, and the Overview.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for a maintainer product decision: the implementation is coherent and proven, but it deliberately makes a new display preference part of the synced provider-config contract and maps newer partial choices onto older all-or-nothing controls on downgrade.

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

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong real-app proof and focused persistence/sync regression coverage support a well-implemented feature; the remaining gate is product compatibility direction.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The changed owner is the card-model visibility projection and its Settings binding; inspected redacted packaged-app captures and the live-run log show the feature-code release build rendering selected rows in Settings, the provider menu, and Overview after terminate/relaunch with persisted non-secret state.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The changed owner is the card-model visibility projection and its Settings binding; inspected redacted packaged-app captures and the live-run log show the feature-code release build rendering selected rows in Settings, the provider menu, and Overview after terminate/relaunch with persisted non-secret state.
Evidence reviewed 7 items Final display projection: The reviewed head filters metrics, credits, and Codex reset credits from a copied card model, preserving the unfiltered model for Settings controls.
All intended display entrypoints: The status-menu model and provider Settings pane both apply the same saved IDs; Settings uses the unfiltered card model to keep hidden items restorable.
Persisted sync contract: The new array is encoded in ProviderConfig and propagated as a three-state ProviderIntentPayload field, with an explicit old-client preservation path.
Findings None None.
Security None None.

How this fits together

CodexBar turns provider usage snapshots into menu cards, Settings previews, and the multi-provider Overview. This change inserts a persisted per-provider visibility projection before those display surfaces.

flowchart LR
  A[Provider usage snapshots] --> B[Provider card model]
  C[Saved provider preferences] --> D[Visibility projection]
  B --> D
  D --> E[Provider menu]
  D --> F[Settings preview]
  D --> G[Overview]
Loading

Decision needed

Question Recommendation
Should per-provider usage-row visibility be a synced ProviderConfig preference, with partial newer choices approximated by the legacy Boolean on downgrade? Accept synced visibility: Keep the new ProviderConfig and sync field so a user's chosen provider presentation follows their settings across current devices.

Why: The code safely implements either local or synced presentation, but the persistence scope and downgrade promise are product compatibility choices rather than mechanical correctness questions.

Before merge

  • Resolve merge risk (P1) - This introduces a synced provider-config field, so a visibility choice on one device can intentionally alter the menu presentation on another device.
  • Resolve merge risk (P1) - A newer partial Codex Spark selection cannot be represented exactly by the older Boolean on downgrade; the compatibility writeback preserves the nearest all-or-nothing state.
  • Complete next step (P2) - A maintainer must choose the persistence and sync scope before this feature can land.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +324, tests +385 The shared preference crosses UI, persistence, and sync, with more added regression coverage than production code.
Localization surface 24 catalogs updated The new Settings controls are translated across the repository's shipped locales.

Merge-risk options

Maintainer options:

  1. Confirm the synced compatibility contract (recommended)
    Accept the three-state sync semantics and the documented nearest-match legacy writeback before merging.
  2. Make the preference local-only
    Remove the new ProviderConfig and sync payload fields if menu presentation should remain independent on each device.
  3. Pause for preference-scope policy
    Defer this feature if maintainers do not want to commit to syncing row visibility yet.

Technical review

Best possible solution:

If maintainers want row visibility to roam with provider settings, land this as the canonical synced display preference and document the intentionally approximate legacy downgrade behavior.

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

Not applicable: this PR implements a new feature, and inspected packaged-app evidence demonstrates its intended behavior after relaunch.

Is this the best way to solve the issue?

Unclear: the implementation is a coherent shared solution, but maintainers must choose whether this display preference belongs in synced provider configuration.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is an optional presentation feature with no demonstrated urgent breakage.
  • merge-risk: 🚨 compatibility: The PR adds a synced persisted preference and deliberately changes legacy downgrade representation for partial row choices.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The changed owner is the card-model visibility projection and its Settings binding; inspected redacted packaged-app captures and the live-run log show the feature-code release build rendering selected rows in Settings, the provider menu, and Overview after terminate/relaunch with persisted non-secret state.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the card-model visibility projection and its Settings binding; inspected redacted packaged-app captures and the live-run log show the feature-code release build rendering selected rows in Settings, the provider menu, and Overview after terminate/relaunch with persisted non-secret state.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The changed owner is the card-model visibility projection and its Settings binding; inspected redacted packaged-app captures and the live-run log show the feature-code release build rendering selected rows in Settings, the provider menu, and Overview after terminate/relaunch with persisted non-secret state.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Recent history on the provider Settings/model area includes the provider-special-case refactor and identity seam that this feature extends. (role: recent provider-settings architect; confidence: high; commits: 61fbe9fac507, 15a855a2132a; files: Sources/CodexBar/PreferencesProvidersPane.swift, Sources/CodexBar/StatusItemController+MenuCardModel.swift)
  • Peter Urda: Introduced the analogous per-provider accent-color override that established the nearby config and sync pattern. (role: persisted-preference precedent owner; confidence: high; commits: 099bf56f71fc; files: Sources/CodexBarCore/Config/CodexBarConfig.swift, Sources/CodexBarCore/Sync/SyncModels.swift)
  • Trim: History attributes the earlier Claude Daily Routines visibility control that this PR migrates into the shared model. (role: legacy visibility-setting author; confidence: medium; commits: 1f3c65762205; files: Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift)

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 (3 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
  • reviewed 2026-08-27T12:11:55.374Z sha c3f6089 :: 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
psufka added 2 commits August 27, 2026 07:06
# Conflicts:
#	Sources/CodexBar/Resources/ca.lproj/Localizable.strings
#	Tests/CodexBarTests/ProviderArchitectureGatekeeperTests.swift
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 29, 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: 🦞 diamond lobster Very strong PR readiness with only minor 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