bevyengine / bevyengine/bevy

Feathers checkbox and slider should auto-update

Open
#24,881 7 comments 0 reactions 0 assignees View on GitHub
A-UI C-Bug S-Needs-Design X-Needs-SME
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Discussion

When creating an interface with feathers there are a couple of gotchas because of the `controlled` nature of the feathers architecture. However other controls (for example button, number input) entirely self manage their linking of display and underlying state.

I can see good reasons why self update might not always be wanted (which is the intention of leaving them unlinked), but by default it should be called itself. I would suggest that a property be added to both controls `self_update` which when true (default) automatically adds:

on(checkbox_self_update)

or

on(slider_self_update)

## What you currently need for a checkbox

```
@FeathersCheckbox {
@caption: bsn! {
caption("Checkbox")
}
}
on(checkbox_self_update) // <<< without this the control silently fails to operate
```

## What you would need after

```
@FeathersCheckbox {
@caption: bsn! {
caption("Checkbox")
}
}
```

## How you would achieve the current behaviour

```
@FeathersCheckbox {
@caption: bsn! {
caption("Checkbox")
}
@self_update: false,
}
```

(same examples for slider)

Note - this would be a breaking change requiring upgrade but I think it is worth it to set up feathers for usability.

## Other Controls that this same change would be good for

- radio (radio_self_update added to group not to individuals)
- list box (listbox_update_selection)
- toggle (uses checkbox_self_update)

Contributor guide

Open the contributing guide

Research direction

Start by locating the FeathersCheckbox and slider controls and tracing the existing checkbox_self_update and slider_self_update behavior. Compare them with the self-managed button and number input controls, then verify that the proposed default behavior works while the self_update false path preserves current behavior for checkbox and slider, including the related radio, list box, and toggle cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend, game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.