fix(onboard): correct channel selector default to 'Done' item

The hardcoded .default(11) became stale when Lark/Feishu was
added at index 11, shifting 'Done — finish setup' to index 12.
The wizard now pre-selects the wrong channel instead of 'Done'.

Use options.len() - 1 so the default always tracks the last
item regardless of how many channels exist.

Fixes #913

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Alex Gorevski 2026-02-19 07:19:20 -08:00
parent 3a19d6cd98
commit 8f8641d9fb

View file

@ -2695,7 +2695,7 @@ fn setup_channels() -> Result<ChannelsConfig> {
let choice = Select::new() let choice = Select::new()
.with_prompt(" Connect a channel (or Done to continue)") .with_prompt(" Connect a channel (or Done to continue)")
.items(&options) .items(&options)
.default(11) .default(options.len() - 1)
.interact()?; .interact()?;
match choice { match choice {