Polish quota warning settings
Summary
- Redesign global quota warning settings into compact Session/Weekly threshold rows.
- Remove the Apply button and noisy row separators.
- Add
%labels and rename threshold controls toWarningandCritical. - Dim disabled quota warning rows while preserving saved threshold values.
- Save edited thresholds on Return, focus loss, outside click, or view teardown instead of every keystroke.
- Fix the threshold field focus/loading issue by anchoring outside-click detection to the threshold editor bounds.
- Ignore unchanged threshold saves to avoid unnecessary refresh churn.
- Prevent provider threshold editors from re-creating stale overrides after “Customize thresholds” is disabled.
- Update quota warning localization copy across resource catalogs.
Why
The previous settings layout could wrap and misalign inside macOS SwiftUI Form, making the quota warning section feel buggy. Saving every keystroke also caused unnecessary provider refresh behavior while users were still editing.
The new Warning / Critical labels describe the user-facing behavior more clearly than numeric position labels: warning fires earlier, critical fires when remaining quota is low. Internally, the same threshold storage is preserved.
This makes the layout cleaner, the editing flow calmer, and the focus/save behavior more reliable.
Validation
swift test --filter SettingsStoreTestsswift test --filter PreferencesPaneSmokeTestsmake check
Screenshot
before
after
Notes
Provider-specific quota warning layout polish is intentionally left for a follow-up PR.
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 8:01 AM ET / 12:01 UTC.
Summary The branch compacts quota warning threshold rows, saves threshold edits on focus/Return/teardown, preserves provider inheritance, updates localization, and adds focused settings tests.
Reproducibility: not applicable. for the PR as a whole because this is settings polish rather than a standalone bug report. The prior provider-threshold blockers are source-checkable and now covered by focused SettingsStore and preferences smoke tests.
Review metrics: 3 noteworthy metrics.
- Files changed: 30 files, +659/-114. The functional change is bounded but spans SwiftUI settings, persistence helpers, localization catalogs, changelog, and tests.
- Localization catalogs: 23 catalogs changed. The Warning/Critical wording is user-visible across supported languages and should stay visible in maintainer review.
- Focused regression tests: 173 added lines across 2 test files. The persistence and inherited-threshold edge cases are covered through stable store/view seams instead of brittle live AppKit automation.
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:
- none.
Next step before merge
- No ClawSweeper repair is needed; the remaining action is ordinary maintainer review and standard merge/check gating.
Security Cleared: The diff stays within SwiftUI settings, localization, changelog, and tests; no dependency, secret, CI, script, package, or code-execution path change was introduced.
Review details
Best possible solution:
Land the polished quota-warning settings UI with the dirty-draft save behavior and provider inheritance safeguards intact after ordinary maintainer review and standard check gating.
Do we have a high-confidence way to reproduce the issue?
Not applicable for the PR as a whole because this is settings polish rather than a standalone bug report. The prior provider-threshold blockers are source-checkable and now covered by focused SettingsStore and preferences smoke tests.
Is this the best way to solve the issue?
Yes. The current branch keeps the UI change narrow while preserving provider inheritance through a dedicated guard and dirty-draft commits, which is the maintainable path for this settings surface.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning high; reviewed against 7fdb1b9012a6.
Label changes
Label justifications:
P3: This is low-risk settings polish with focused regression coverage and no remaining concrete correctness blocker found.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): The PR includes before/after screenshots directly showing the quota-warning settings layout, plus a described signed-app live matrix for focus, outside-click, teardown, inheritance, and sanitization behavior.proof: sufficient: Contributor real behavior proof is sufficient. The PR includes before/after screenshots directly showing the quota-warning settings layout, plus a described signed-app live matrix for focus, outside-click, teardown, inheritance, and sanitization behavior.proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR includes before/after screenshots directly showing the quota-warning settings layout, plus a described signed-app live matrix for focus, outside-click, teardown, inheritance, and sanitization behavior.
Evidence reviewed
What I checked:
- Repository policy read: AGENTS.md was present, read fully, and applied for the CodexBar-specific guidance on focused settings tests, avoiding Keychain/provider live validation, and treating changelog edits conservatively. (
AGENTS.md:1, 7fdb1b9012a6) - PR metadata and prior review context: The PR is open, mergeable, labeled proof-sufficient/ready-for-maintainer-look/P3, and the latest ClawSweeper review cycle at the current head had no findings after the earlier provider-threshold blockers were addressed. (12f8b0136e09)
- Compact quota warning UI source: The current PR head renders global Session and Weekly quota threshold rows with Warning/Critical editors, percent suffixes, disabled-row dimming, and focus-aware commit behavior. (
Sources/CodexBar/QuotaWarningSettingsViews.swift:174, 12f8b0136e09) - Provider inheritance guard: setQuotaWarningThresholdsIfOverridden avoids recreating cleared overrides and avoids freezing inherited thresholds when a no-op editor teardown matches the inherited global thresholds. (
Sources/CodexBar/SettingsStore+Config.swift:52, 12f8b0136e09) - Focused regression coverage: The PR adds tests for stale provider-editor saves, inherited thresholds after no-op saves, independent global window thresholds, dirty draft behavior, disabled-window threshold preservation, and inherited multi-threshold summaries. (
Tests/CodexBarTests/SettingsStoreTests.swift:801, 12f8b0136e09) - Screenshot proof inspected: The downloaded after screenshot is a 1414x574 PNG showing the compact Session/Weekly Warning/Critical rows, percent labels, and disabled-row dimming claimed by the PR body. (12f8b0136e09)
Likely related people:
- Alekstodo: Authored the merged quota-warning controls and markers work that added the settings view, config helpers, defaults, and tests now being polished. (role: introduced behavior; confidence: high; commits: 18eb73dde236, 0769b9e0b33e; files:
Sources/CodexBar/QuotaWarningSettingsViews.swift,Sources/CodexBar/SettingsStore+Config.swift,Sources/CodexBar/SettingsStore+Defaults.swift) - steipete: Merged the original quota-warning controls work and recently touched SettingsStore defaults and current branch maintenance in the same settings surface. (role: merger and recent area contributor; confidence: high; commits: 18eb73dde236, 259ea90ec173, b76c34014cc0; files:
Sources/CodexBar/QuotaWarningSettingsViews.swift,Sources/CodexBar/SettingsStore+Defaults.swift,Tests/CodexBarTests/SettingsStoreTests.swift) - SAASEmpiree: Recently added the on-screen text alert option in the same quota warning settings/defaults area displayed next to this PR's edited controls. (role: adjacent contributor; confidence: medium; commits: d4f245e518fa; files:
Sources/CodexBar/QuotaWarningSettingsViews.swift,Sources/CodexBar/SettingsStore+Defaults.swift) - Zihao-Qi: Has prior merged current-main work in visual settings refresh behavior touching SettingsStore defaults, so the author is connected to adjacent settings persistence history beyond this PR. (role: recent adjacent contributor; confidence: medium; commits: 5c6e6f99847d, ced57db81fa7; files:
Sources/CodexBar/SettingsStore+Defaults.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-reviewcomments, 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-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto 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 explainto ask for more context, or@clawsweeper stopto stop active automation.
Review history (6 earlier review cycles)
- reviewed 2026-07-07T20:12:04.773Z sha 9718948dcdc158361f520ae5d107e944d0dcd828 :: needs maintainer review before merge. :: none
- reviewed 2026-07-07T20:23:13.685Z sha 9718948dcdc158361f520ae5d107e944d0dcd828 :: needs changes before merge. :: [P2] Skip teardown saves after provider override removal
- reviewed 2026-07-07T21:02:59.442Z sha daf7677335c440575b8dd0da89987c7ab0b1a5ea :: needs maintainer review before merge. :: none
- reviewed 2026-07-07T23:09:20.705Z sha 8aa7aeb385dc3134a854e7a006b3f68f4e48b8f3 :: needs changes before merge. :: [P1] Preserve inherited provider thresholds on teardown
- reviewed 2026-07-07T23:46:42.574Z sha e861467b5a25bc04a43a1fa08259ef7a3081eb6c :: needs maintainer review before merge. :: none
- reviewed 2026-07-09T11:54:17.773Z sha 12f8b0136e09896e9cc6228f41bfd0db223510d4 :: needs maintainer review before merge. :: none
Maintainer proof for exact head 12f8b013:
- focused quota-warning/settings coverage: 89 tests pass
make checkpasses;make testpasses all 49 local shards- branch-wide structured review: clean, no actionable findings
- Developer-ID signed debug app verified by deep/strict
codesignand Gatekeeper on macOS 27 build 26A5368g (arm64, Xcode 26.6 / SDK 26.5) - isolated live matrix with Keychain access disabled and one loopback-only provider:
- minimum-size English, German, Russian, and Arabic layouts stay aligned and unclipped; disabled row dims
- focus -> Tab -> outside click, Return, and window close each commit once and persist after reopening
- no-op focus/blur and no-op close produce zero provider requests
- removing customization while its editor is focused does not recreate the override
- enabled-only provider override remains threshold-free across close/relaunch and follows later global changes
- letters/overlong input plus a blank field normalize to the tested values
- independent source-blind behavior validation: PASS 8/8 on the behavior-changing candidate; report SHA-256
5b857a5a96b81f308ef36b9b6f09f888b2929310b82670bd4c98796a5b6640d4 - exact synced head re-packaged and re-proven:
CodexGitCommit=12f8b013, Developer-ID deep/strict signature valid, Gatekeeper accepted, binary SHA-2564bd196fc6a4c9b51ab58c8e2aa9dd9e83acd622d9174959201e1daea34d8a7ae - exact-head live smoke at the minimum 880x652 window: edited Session warning 98 -> 97 via focus/Tab/outside click, observed persisted defaults, restored 98, verified no-op focus/blur, closed/reopened Settings, and observed 98 again
- dependencies unchanged
Hosted exact-head CI: lint, Linux arm64/x64, all four macOS test shards, and GitGuardian green. The dependency-only Ubuntu aggregate job remains capacity-queued after all of its required jobs completed; it runs no additional build or test steps.