Skip to content

Fix setup host confirmation preserving selected host#175

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-93e4
Draft

Fix setup host confirmation preserving selected host#175
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-93e4

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 16, 2026

Summary

Fixes a setup regression introduced in the recent filesystem/setup flow changes where clicking Next could persist an empty host even though the host dropdown displayed the currently configured host.

Bug and impact:

  • Trigger: a user has a config directory with discovered hosts and an existing/default host in the store, then clicks Next without changing the dropdown.
  • Impact: the app calls saveHost(""), clearing the persisted host and routing the user back into setup with a broken/empty host selection.

Root cause:

  • The Select display was controlled by host, but the Next button persisted selectedHost, which initializes to an empty string and only changes on dropdown interaction.

Fix:

  • Persist the effective host (selectedHost || host) and disable Next when no host is available.
  • Added a regression test for clicking Next without changing the dropdown, plus coverage that an empty host cannot be persisted.

Test Plan

  • bun install
  • bun --filter native test:unit -- src/components/widget/steps/setup-step.test.tsx

Docs

  • No docs update needed
Open in Web View Automation 

Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Warnings
⚠️ PR is marked WIP / draft — do not merge until ready for review.
⚠️ Please assign this PR to someone (usually yourself).

📋 PR Overview

Lines changed 75 (+74 / -1)
Files 1 added, 1 modified, 0 deleted
Draft / WIP yes
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests yes (1)
package.json touched no
Cargo.toml touched no
Infra / CI touched no

Generated by 🚫 dangerJS against f215ccb

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.

1 participant