Skip to content

Conversation

@damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Aug 18, 2025

Currently both SelectableItem and OptionGroup use kind of a a "dual" style widget because, depending on the number of items, it could either use radio checkboxes or a combobox.
This is questionable choices as:

  • it makes a discrepency depending on the numer of item (lack of UX continuity)
  • a group of radio check boxes consumes more visual space without adding value
  • it makes the code more complex

Thus, I removed the radiobox option and clean a bit that part of the code:

  • radioDataWidget is now renamed as OptionGroupWidget.
  • the helps available in SelectableItem is now a tooltip instead of added with parenthesis in the name)... wich is a kind of hack
  • move both OptionGroupWidget and SelectableItemWidget are now in their own .h/.cpp files

Here is an example of how the UX for OptionGroup with less than 4 items (the three items):
image

Here is an example of the UX for an OptionGroup with more than 3 items (a ComboBox)):
image

NB: In case, a radio button choice selector is needed it is easy to re-implement it on a per-component basis using BaseData::setWidget/getWidget.

1) RadioDataWidget is now renamed as OptionGroupWidget.
2) Both OptionGroupWidget and SelectableItemWidget are now in their own .h/.cpp files
3) The switch of behavior depending on the number of alternative is removed
Because there is no reason justifying that a widget for a data field would totally change its
rendering/behavior depending on the number of alternatives.

If the Radio choices behavior is needed (which I doubt) it is easy to re-implement it on a per-component-data basis
using BaseData::setWidget/getWidget.

Signed-off-by: Damien Marchal <[email protected]>
@damienmarchal
Copy link
Contributor Author

The CI error is related to the PR, I will investigate so I pass it back to WIP.

@damienmarchal
Copy link
Contributor Author

@hugtalbot the compilation issue is fixed.

@bakpaul bakpaul merged commit e5dc8ca into sofa-framework:master Oct 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants