Skip to content

Make merged-Overview provider limit user-configurable - #2339

Closed
Vit129 wants to merge 6 commits into
steipete:mainfrom
Vit129:pr-configurable-overview-limit
Closed

Make merged-Overview provider limit user-configurable#2339
Vit129 wants to merge 6 commits into
steipete:mainfrom
Vit129:pr-configurable-overview-limit

Conversation

@Vit129

@Vit129 Vit129 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The merged-icon Overview tab's provider cap was hardcoded (docs/ui.md, issue Allow more than 3 providers in the Overview tab (compact density mode) #2107). This makes it user-configurable via a Settings stepper (1-12), backed by UserDefaults.
  • Rebased on current main, which already raised the hardcoded default from 3 to 6 — kept that as the new configurable default so existing users see no behavior change.

Test plan

  • swift build --product CodexBar -c debug succeeds
  • Manual: Settings > Menu Bar > "Overview tab limit" stepper changes how many providers render in the merged Overview icon

Was hardcoded to 3 (docs/ui.md, issue steipete#2107). Now backed by
UserDefaults (static var, since it's used as a default-parameter
value elsewhere and Swift disallows self in those) with a Settings
stepper (1-12, default 3 for no behavior change).

@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: 3017da8f53

ℹ️ 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".

private static let maxOverviewProviders = SettingsStore.mergedOverviewProviderLimit
private static var maxOverviewProviders: Int { SettingsStore.mergedOverviewProviderLimit }

@AppStorage("mergedOverviewProviderLimit") private var overviewProviderLimitSetting = 6

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 Invalidate menus when overview limit changes

When this setting changes after the merged Overview menu has already been rendered, only UserDefaults.standard is updated. StatusItemController invalidates/rebuilds menu content via observation of settings.menuObservationToken, and that token never reads this new key, so menuNeedsUpdate can consider the existing menu fresh and keep showing the old number of Overview rows until an unrelated observed setting/store change or app restart. Please route the limit through SettingsStore/defaultsState and include it in menu observation, or otherwise invalidate the merged menu when the value changes.

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. P2 Normal priority bug or improvement with limited blast radius. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 11:52 AM ET / 15:52 UTC.

ClawSweeper review

What this changes

Adds a persisted Settings stepper that lets users choose one to twelve providers for the merged Overview tab, while retaining six as the default.

Merge readiness

Blocked until real behavior proof is added - 5 items remain

Keep this PR open for a maintainer product-direction choice and fresh real-behavior proof. The code is a focused, plausible implementation, but the related Overview work now has competing per-provider-list and unified-card directions.

Likely related people

  • steipete — high-confidence recent owner of the merged-menu and Overview paths.

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

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and follows the app’s settings/observation patterns, but missing real behavior proof remains a merge gate.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR provides a build claim but no after-fix real-bundle proof; add redacted screenshots or a short recording showing the Settings stepper changes Overview rows, including an already-open menu, then update the PR body for re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides a build claim but no after-fix real-bundle proof; add redacted screenshots or a short recording showing the Settings stepper changes Overview rows, including an already-open menu, then update the PR body for re-review.
Evidence reviewed 5 items Current main still has a fixed cap: Current main defines SettingsStore.mergedOverviewProviderLimit as the fixed value 6; the resolver’s default parameter uses that static value, so the requested user-configurable behavior is not already implemented.
PR routes the preference through the configured settings store: The branch reads and writes the limit through self.userDefaults, exposes an observable revision for SwiftUI/menu invalidation, and passes the instance value to the Overview resolver and menu call sites.
Related work leaves the product direction open: The linked request frames a configurable cap as one possible lever alongside compact density, while the linked unified-card PR and its discussion propose replacing the per-provider list. Those are overlapping UI directions rather than duplicate implementations.
Findings None None.
Security None None.

How this fits together

The merged menu reads enabled providers and the user’s Overview selection, resolves a capped list, then renders it as Overview rows. This PR replaces the fixed cap with a setting stored in the app’s configured defaults store and observed by already-open menus.

flowchart LR
    A[Enabled providers] --> C[Overview selection resolver]
    B[Menu Bar settings stepper] --> D[Persisted provider limit]
    D --> C
    C --> E[Merged menu controller]
    E --> F[Overview provider rows]
    D --> G[Menu refresh observation]
    G --> E
Loading

Decision needed

Question Recommendation
Should the merged Overview continue to expose a configurable per-provider row cap, or should its next iteration instead follow the unified-card/layout decision under discussion? Decide the Overview layout first: Resolve the compact-list versus unified-card direction in #2578, then retain, adapt, or close this PR against that decision.

Why: The requested setting is technically bounded, but it controls a UI model that the linked work is actively reconsidering; code review cannot determine which long-lived user-facing configuration should exist.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides a build claim but no after-fix real-bundle proof; add redacted screenshots or a short recording showing the Settings stepper changes Overview rows, including an already-open menu, then update the PR body for re-review.
  • Resolve merge risk (P1) - A user-configurable cap may become unnecessary or confusing if maintainers choose the unified Overview-card direction discussed in Discussion: unified Overview card — how should the all-providers glance view look? #2578 and proposed by feat(overview): unified all-providers card with cross-provider totals #2577.
  • Resolve merge risk (P1) - The PR body has no after-fix real-bundle evidence that changing the stepper updates visible Overview rows, including an already-open merged menu.
  • Complete next step (P2) - A maintainer must choose the long-lived Overview configuration direction, and the contributor must provide real-bundle proof; neither is a safe automated repair task.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 12 files affected; 72 added, 25 removed One persisted UI setting is threaded through the settings store, observation token, six menu call sites, localization, and a smoke test.
Default compatibility 6 retained as default Existing users without the new defaults key retain the current visible-provider cap.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Choose the intended Overview layout first; if the per-provider list remains supported, land this narrow preference only after fresh-bundle proof shows the stepper updates both newly opened and already-open Overview menus.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Choose the intended Overview layout first; if the per-provider list remains supported, land this narrow preference only after fresh-bundle proof shows the stepper updates both newly opened and already-open Overview menus.

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

No. The PR body claims a debug build but leaves its manual verification unchecked, and it contains no screenshot, recording, runtime output, or redacted log showing the stepper changes actual Overview rows on a fresh bundle.

Is this the best way to solve the issue?

Unclear. The implementation is a narrow way to configure the current list, but #2107 and #2578 leave the durable Overview layout and configuration direction unresolved.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P3: This is an optional Overview ergonomics/configuration feature, not a regression or current user-blocking defect.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides a build claim but no after-fix real-bundle proof; add redacted screenshots or a short recording showing the Settings stepper changes Overview rows, including an already-open menu, then update the PR body for re-review.

Evidence

What I checked:

  • Current main still has a fixed cap: Current main defines SettingsStore.mergedOverviewProviderLimit as the fixed value 6; the resolver’s default parameter uses that static value, so the requested user-configurable behavior is not already implemented. (Sources/CodexBar/SettingsStore.swift:191, 2bd6a6c37eff)
  • PR routes the preference through the configured settings store: The branch reads and writes the limit through self.userDefaults, exposes an observable revision for SwiftUI/menu invalidation, and passes the instance value to the Overview resolver and menu call sites. (Sources/CodexBar/SettingsStore+Defaults.swift:821, 328bc81a9cf9)
  • Related work leaves the product direction open: The linked request frames a configurable cap as one possible lever alongside compact density, while the linked unified-card PR and its discussion propose replacing the per-provider list. Those are overlapping UI directions rather than duplicate implementations.
  • Repository policy applied: The repository guidance asks UI patches to include screenshots or GIFs and asks new logic to receive focused test coverage; this branch supplies a build claim but no completed manual proof in its PR body. (AGENTS.md:1, 2bd6a6c37eff)
  • Recent merged-menu ownership trail: Recent history across the central Overview resolver and menu controller shows repeated merged-menu refactors by Peter Steinberger, including menu payload and height-stability work immediately after this PR’s base. (Sources/CodexBar/StatusItemController+Menu.swift:1, cd49d30fad95)

Likely related people:

  • steipete: Peter Steinberger authored the recent current-main refactors to merged-menu payload switching, menu height stability, and Overview tab behavior in the same central resolver/menu files. (role: recent area contributor; confidence: high; commits: cd49d30fad95, 85bf75281a00, 2f692ee809d5; files: Sources/CodexBar/SettingsStore+Defaults.swift, Sources/CodexBar/StatusItemController+Menu.swift, Sources/CodexBar/PreferencesMenuBarPane.swift)

Rank-up moves

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

  • Add redacted fresh-bundle screenshots or a short recording showing a changed limit updates Overview rows in newly opened and already-open menus.
  • Obtain maintainer direction on the configurable-list approach versus the unified Overview direction before merge.

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 (8 earlier review cycles)
  • reviewed 2026-07-19T16:45:22.790Z sha 3017da8 :: needs real behavior proof before merge. :: [P2] Invalidate the merged menu when the Overview limit changes
  • reviewed 2026-07-30T01:48:38.780Z sha 3017da8 :: needs real behavior proof before merge. :: [P2] Route Overview limit through menu invalidation
  • reviewed 2026-08-01T13:54:25.915Z sha 86c6c55 :: needs real behavior proof before merge. :: [P2] Persist the limit through the configured settings store
  • reviewed 2026-08-01T14:38:36.073Z sha 8282755 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T06:32:31.565Z sha 12be194 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T11:30:22.942Z sha 12be194 :: needs real behavior proof before merge. :: [P2] Localize the new Overview-limit settings copy
  • reviewed 2026-08-02T12:38:06.390Z sha feafb63 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T14:23:03.260Z sha 328bc81 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 30, 2026
Vit129 added 2 commits August 1, 2026 20:50
…er changes

Addresses clawsweeper P2 finding on steipete#2339: the Overview-limit Stepper
wrote straight to UserDefaults via @AppStorage, bypassing SettingsStore
entirely, so menuObservationToken (which drives cached-menu
invalidation) never changed and an already-open Overview menu kept its
old row count.

Adds mergedOverviewProviderLimitRevision, an @Observable-tracked instance
counter bumped by a new instance accessor for the setting, and touches
it in menuObservationToken. The Stepper now binds through
settings.mergedOverviewProviderLimit instead of a raw @AppStorage.
…rDefaults

Addresses clawsweeper P2 finding on steipete#2339: mergedOverviewProviderLimit
read and wrote UserDefaults.standard directly instead of the store's
own configured userDefaults, so isolated test stores (and any future
non-standard suite) couldn't observe or reset it independently of the
real app.

Replaces the static get/set with a plain mergedOverviewProviderLimitDefault
constant (used only where Swift requires a self-independent default
parameter value) and routes every real read/write through the existing
mergedOverviewProviderLimit instance accessor, backed by self.userDefaults
like the rest of SettingsStore's persisted settings.
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 1, 2026
CI lint gate flagged spaceAroundOperators/wrapMultilineStatementBraces
on the overview-limit Stepper introduced in this PR.
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. P2 Normal priority bug or improvement with limited blast radius. labels Aug 2, 2026
The stepper's title/subtitle were raw English strings while every
adjacent Menu Bar settings row uses L(...) (ClawSweeper finding on
PR steipete#2339).
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 2, 2026
…er changes

Addresses clawsweeper P2 finding on steipete#2339: the Overview-limit Stepper
wrote straight to UserDefaults via @AppStorage, bypassing SettingsStore
entirely, so menuObservationToken (which drives cached-menu
invalidation) never changed and an already-open Overview menu kept its
old row count.

Adds mergedOverviewProviderLimitRevision, an @Observable-tracked instance
counter bumped by a new instance accessor for the setting, and touches
it in menuObservationToken. The Stepper now binds through
settings.mergedOverviewProviderLimit instead of a raw @AppStorage.
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 2, 2026
…rDefaults

Addresses clawsweeper P2 finding on steipete#2339: mergedOverviewProviderLimit
read and wrote UserDefaults.standard directly instead of the store's
own configured userDefaults, so isolated test stores (and any future
non-standard suite) couldn't observe or reset it independently of the
real app.

Replaces the static get/set with a plain mergedOverviewProviderLimitDefault
constant (used only where Swift requires a self-independent default
parameter value) and routes every real read/write through the existing
mergedOverviewProviderLimit instance accessor, backed by self.userDefaults
like the rest of SettingsStore's persisted settings.
Vit129 added a commit to Vit129/CodexBar that referenced this pull request Aug 2, 2026
The stepper's title/subtitle were raw English strings while every
adjacent Menu Bar settings row uses L(...) (ClawSweeper finding on
PR steipete#2339).
Manual testing found the stepper completely unresponsive. Root cause:
mergedOverviewProviderLimit's getter read straight from
self.userDefaults, which is @ObservationIgnored — so SwiftUI recorded
zero dependencies for that read and never re-rendered the Stepper/Text
after a click updated the stored value. Reading the already-tracked
mergedOverviewProviderLimitRevision first gives the getter an
observable dependency, same technique already used in
menuObservationToken.

Also moves the stepper's numeric readout out of the Stepper's own
label into a LabeledContent accessory (matching CostHistoryDaysEditor's
existing pattern) so the +/- hit target isn't sharing space with a
three-line label.
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 2, 2026
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Closing: main already raised the merged-Overview cap to six (#2314), and the remaining ask in #2107 is a compact density mode rather than a configurable cap — this PR doesn't address that half, and the Overview redesign discussion in #2578 supersedes the direction. Thanks @Vit129.

@steipete steipete closed this Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

2 participants