Skip to content

fix(app): hide server default controls with one server - #50256

Open
Hona wants to merge 1 commit into
anomalyco:v2from
Hona:single-server-default
Open

Hona wants to merge 1 commit into
anomalyco:v2from
Hona:single-server-default

Conversation

@Hona

@Hona Hona commented Sep 21, 2026

Copy link
Copy Markdown
Member

Hides the server "Set as default" / "Remove default" menu items and the "Default" badge when only one server is registered. The default only affects startup selection and list ordering, both of which are no-ops with a single server, so the control was a confusing toy.

Before After

defaults.available() is the one gate every menu and badge already reads, so the count check lives there:

// packages/app/src/servers/registry/controller.ts
function useDefaultServer(count: () => number) {
  ...
  available: createMemo(() => !!platform.getDefaultServer && !!platform.setDefaultServer && count() > 1),
}

const defaults = useDefaultServer(() => server.list.length)

Why it's a no-op with one server (the only readers of the stored key):

  • sortServerConnections – orders the default first
  • availableStartupServerdefaultServer ?? "sidecar", resolves to the only server either way
  • ServersProvider.defaultServer – accepted but unused in init

The stored key is retained, so adding a second server later restores "Remove default" on the one that was already chosen.

Copilot AI lite review requested due to automatic review settings September 21, 2026 00:52
@Hona
Hona requested a review from Brendonovich as a code owner September 21, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants