Skip to content

feat(switch): integrate interactive picker into wt switch#894

Merged
max-sixty merged 9 commits intomainfrom
switch-select
Feb 2, 2026
Merged

feat(switch): integrate interactive picker into wt switch#894
max-sixty merged 9 commits intomainfrom
switch-select

Conversation

@max-sixty
Copy link
Owner

Summary

  • wt switch without arguments now opens the interactive picker (previously wt select)
  • wt select remains as a deprecated hidden alias with deprecation warning
  • --branches and --remotes flags added to wt switch for picker customization
  • Removed the separate wt select docs page; functionality documented under wt switch
  • The [select] config section is preserved for backward compatibility

Test plan

  • wt switch without args opens interactive picker (Unix)
  • wt switch without args shows error on Windows
  • wt select shows deprecation warning then works
  • wt switch --branches / wt switch --remotes work
  • All tests pass (cargo run -- hook pre-merge --yes)
  • Shell completions no longer show select

Closes #890

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

max-sixty and others added 3 commits January 28, 2026 17:10
`wt switch` without arguments now opens the interactive picker (previously
`wt select`). This simplifies the mental model: one command for all switching.

- `wt switch` → opens interactive picker (Unix) or shows error (Windows)
- `wt switch --branches/--remotes` → customizes picker
- `wt select` → deprecated hidden alias with warning

Removes the separate `wt select` docs page since the functionality is now
documented under `wt switch`. The `[select]` config section is preserved
for backward compatibility with a TODO to rename once migration is confirmed.

Closes #890

Co-Authored-By: Claude <noreply@anthropic.com>
The test expects the Unix error message ("Interactive picker requires
an interactive terminal") but Windows shows a different message
("Interactive picker is not available on Windows").

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…r --clobber

These flags only make sense when switching to a specific branch, not when
opening the interactive picker. Previously, running `wt switch --create`
would silently ignore the flag and open the picker instead.

Now clap properly enforces that these flags require a branch argument:

    $ wt switch --create
    error: the following required arguments were not provided:
      <BRANCH>

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty
Copy link
Owner Author

max-sixty commented Jan 29, 2026

Decent observation, thanks! Fixed in 92cf72a — flags like --create, --base, --execute, and --clobber now properly require a branch argument via clap's requires = "branch".

[CC on behalf of Max]

@max-sixty
Copy link
Owner Author

@juice928 what reviewer are you? I thought this was good!

max-sixty and others added 5 commits January 30, 2026 15:29
# Conflicts:
#	tests/snapshots/integration__integration_tests__approval_ui__select_fails_in_non_tty.snap
#	tests/snapshots/integration__integration_tests__help__help_config_create.snap
#	tests/snapshots/integration__integration_tests__help__help_list_long.snap
#	tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
#	tests/snapshots/integration__integration_tests__help__help_md_root.snap
#	tests/snapshots/integration__integration_tests__help__help_no_args.snap
#	tests/snapshots/integration__integration_tests__help__help_root_long.snap
#	tests/snapshots/integration__integration_tests__help__help_root_short.snap
#	tests/snapshots/integration__integration_tests__help__help_switch_long.snap
#	tests/snapshots/integration__integration_tests__help__help_switch_short.snap
#	tests/snapshots/integration__integration_tests__switch__switch_missing_argument_hints.snap
The snapshot was stale after integrating `wt select` into `wt switch`.
Now `wt switch` without args shows the picker error, not clap's missing
argument message.

Co-Authored-By: Claude <noreply@anthropic.com>
The picker is a navigation method (like shortcuts), not an afterthought.
New order: Shortcuts → Interactive picker → GitHub/GitLab PRs → Troubleshooting

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 0c9e020 into main Feb 2, 2026
21 checks passed
@max-sixty max-sixty deleted the switch-select branch February 2, 2026 14:05
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.

Proposal for UX discussion - combine switch and select into switch

1 participant