Skip to content

ui: Do not selected an index for the ToggleButtonGroup by default#43751

Closed
bnjjj wants to merge 1 commit intozed-industries:mainfrom
bnjjj:bnjjj/fix_toggle_button_selected_index
Closed

ui: Do not selected an index for the ToggleButtonGroup by default#43751
bnjjj wants to merge 1 commit intozed-industries:mainfrom
bnjjj:bnjjj/fix_toggle_button_selected_index

Conversation

@bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Nov 28, 2025

ToggleButtonGroup: Changed default behavior to not pre-select any button index

  • Changed selected_index field from usize to Option<usize>, defaulting to None instead of 0
  • This prevents the first button (index 0) from being automatically selected when no explicit selection is made

Release Notes:

  • Fixed: changed default behavior to ToggleButtonGroup to not pre-select any button index

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 28, 2025
@danilo-leal
Copy link
Member

Hey @bnjjj, thanks for the PR! I'm curious, what is the scenario you're trying to fix where having an option selected by default isn't desirable?

@MrSubidubi MrSubidubi changed the title fix(ToggleButtonGroup): do not selected an index by default ui: Do not selected an index for the ToggleButtonGroup by default Nov 28, 2025
@bnjjj
Copy link
Contributor Author

bnjjj commented Nov 29, 2025

@danilo-leal in this pr #42819 I have a button to filter by git remotes in branch picker

@danilo-leal
Copy link
Member

Gotcha. Given that is just a filter that selects one option, we could use a regular Button for that, similar to the many toggle/filter buttons in the project search, for example. It makes sense to me to preserve the toggle button behavior where there's always a selected option by default... therefore, will close the PR due to that. (Also, we might change that branch picker design, too—we've been discussing internally about unifying the remote, branch, and worktree pickers into one). Thank you!

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

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants