Skip to content

fix: show all enabled providers in merged switcher#525

Merged
ratulsarna merged 2 commits intosteipete:mainfrom
Astro-Han:worktree-fix-203-switcher-display
Mar 14, 2026
Merged

fix: show all enabled providers in merged switcher#525
ratulsarna merged 2 commits intosteipete:mainfrom
Astro-Han:worktree-fix-203-switcher-display

Conversation

@Astro-Han
Copy link
Copy Markdown
Contributor

Summary

  • Adds enabledProvidersForDisplay() to UsageStore that returns enabled providers without filtering by credential availability
  • Switcher data source (populateMenu) and merge-icons logic (shouldMergeIcons) now use the display list, so all user-enabled providers appear in the merged menu regardless of whether their credentials are configured
  • Providers without credentials show "No usage yet" when selected (existing behavior)

Context

The merged menu switcher previously used enabledProviders(), which filters out providers whose credentials aren't configured via isProviderAvailable(). This silently hid user-enabled providers from the switcher UI, making it appear that adding a provider had no effect.

This is a minimal, defensive fix — data fetch, animations, widgets, and separate-mode logic continue to use the availability-filtered list.

Closes #203

Test plan

  • swift build passes
  • swift test passes (8 pre-existing keychain-related failures on CI/local, unrelated)
  • Manual: enable N providers (including some without credentials), verify all appear in merged switcher
  • Manual: select a provider without credentials, verify "No usage yet" appears

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: 7af0ea42b8

ℹ️ 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/StatusItemController.swift
The merged menu switcher, merge-icons logic, icon visibility, and
animation state filtered providers by credential availability via
enabledProviders(), silently hiding user-enabled providers that
lacked configured credentials.

Add enabledProvidersForDisplay() that skips availability filtering
and use it across the UI pipeline (switcher data source, merged-mode
detection, icon visibility, animation state, menu card width, and
provider resolution fallbacks). Data paths (refresh, snapshots,
widgets, CLI) retain availability filtering. fallbackProvider
intentionally keeps the filtered list so the codex fallback icon
appears when no provider has credentials.

Closes #203
Comment thread Sources/CodexBar/StatusItemController+Menu.swift
Comment thread Sources/CodexBar/StatusItemController+Animation.swift Outdated
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: 151085d8ed

ℹ️ 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/StatusItemController+Menu.swift
Comment thread Sources/CodexBar/StatusItemController+Animation.swift Outdated
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: 151085d8ed

ℹ️ 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/StatusItemController+Animation.swift Outdated
- primaryProviderForUnifiedIcon: revert fallback to enabledProviders()
  so animation continues while available providers are still loading
- resolvedMenuProvider: prefer isProviderAvailable() match so default
  menu content aligns with the status bar icon

Addresses review feedback from ratulsarna on PR #525.
@ratulsarna ratulsarna merged commit fa59e39 into steipete:main Mar 14, 2026
4 checks passed
@ratulsarna
Copy link
Copy Markdown
Collaborator

Thanks @Astro-Han !

@Astro-Han Astro-Han deleted the worktree-fix-203-switcher-display branch March 24, 2026 00:02
pablogtzgileta pushed a commit to pablogtzgileta/CodexBar that referenced this pull request Apr 8, 2026
* fix: show all enabled providers in switcher regardless of availability

The merged menu switcher, merge-icons logic, icon visibility, and
animation state filtered providers by credential availability via
enabledProviders(), silently hiding user-enabled providers that
lacked configured credentials.

Add enabledProvidersForDisplay() that skips availability filtering
and use it across the UI pipeline (switcher data source, merged-mode
detection, icon visibility, animation state, menu card width, and
provider resolution fallbacks). Data paths (refresh, snapshots,
widgets, CLI) retain availability filtering. fallbackProvider
intentionally keeps the filtered list so the codex fallback icon
appears when no provider has credentials.

Closes steipete#203

* fix: prefer available provider in merged-mode fallbacks

- primaryProviderForUnifiedIcon: revert fallback to enabledProviders()
  so animation continues while available providers are still loading
- resolvedMenuProvider: prefer isProviderAvailable() match so default
  menu content aligns with the status bar icon

Addresses review feedback from ratulsarna on PR steipete#525.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Max Provider View Issue

2 participants