Skip to content

Migrate clustered_decals example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)#25064

Merged
alice-i-cecile merged 9 commits into
bevyengine:mainfrom
kfc35:24112_migrate_clustered_decals
Jul 20, 2026
Merged

Migrate clustered_decals example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)#25064
alice-i-cecile merged 9 commits into
bevyengine:mainfrom
kfc35:24112_migrate_clustered_decals

Conversation

@kfc35

@kfc35 kfc35 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Objective

Solution

  • Spawn a ui similar to the ssr example migration, with FeathersRadioButtons made via the radio.rs util and some more custom FeathersNumberInputs (with greater learning on my part on what could possibly be extracted as common logic for FeathersNumberInputs in examples).
  • The pointer interaction with scale and roll was updated from a vague dragging off a button on the side to number inputs that still allow dragging, but enable more precision to the user.

Testing

  • cargo run --example clustered_decals --features="pbr_clustered_decals bevy_feathers” has better UX improvement when compared to main.

Showcase

Video of the example
Screen.Recording.2026-07-19.at.12.49.55.AM.mov

Don’t mind the slower drag speed for the number inputs — it moves slower when screen recording for some reason

@kfc35 kfc35 added C-Examples An addition or correction to our examples A-UI Graphical user interfaces, styles, layouts, and widgets D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 19, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Jul 19, 2026
@kfc35
kfc35 requested a review from viridia July 19, 2026 04:24
@kfc35
kfc35 force-pushed the 24112_migrate_clustered_decals branch from 38b1bd9 to 2351028 Compare July 19, 2026 04:26
@kfc35 kfc35 changed the title Migrate clustered_decal example to use FeathersRadioButton and FeathersNumberInput Migrate clustered_decal example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3) Jul 19, 2026
@kfc35
kfc35 force-pushed the 24112_migrate_clustered_decals branch from 322d7b0 to 985c90d Compare July 19, 2026 04:41
@viridia

viridia commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Just FYI I have planned major work for FeathersNumberInput, although this should not affect the API. Mainly, the way that number input handles focus is a huge hack that I need to deal with.

Comment thread examples/3d/clustered_decals.rs Outdated
Comment thread examples/helpers/radio.rs
}

/// Creates a basic feathers theme props for the radio buttons.
pub fn basic_radio_button_theme() -> ThemeProps {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context: I had to move theme out since there was a compiler complaint about an unused function. clustered_decals uses the dark theme since it looked ok to use for this particular example

));
]),
number_input("Scale Multiplier", 1.0, 0.05..10., AppNumberInput::Scale),
number_input("Roll (-π to π)", 0.0, -PI..PI, AppNumberInput::Roll),

@taearls taearls Jul 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an inclusive range

number_input("Roll (-π to π)", 0.0, -PI..=PI, AppNumberInput::Roll),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So a bit oddly, HardLimit in Feathers only takes a Range and not an inclusive one, and you can’t convert an inclusive range into a regular old Range.

So I tried to compromise by just adding epsilon to the end, but for roll specifically, if you go a little above PI, switch decals, and then switch back, the value gets turned into (essentially) -PI because the roll is recalculated to be within the range of -PI and PI. My opinion is that the number changing like that is undesired UX.

So for those reasons, I’m going to keep this as is. However, the fact that HardLimit doesn’t have the option to accept an inclusive Range is a legitimate thing to ask about and question whether we should do something about it outside of this PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to revisiting hard and soft limit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! That is surprising. Is it worth filing a separate issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please if you’d like to create it 😄 No problem/question is too small for an issue I say

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'll try to do that tonight or tomorrow when I have time. 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gentle reminder @taearls :) I'm merging now, so it's easy to forget.

],
));
]),
number_input("Scale Multiplier", 1.0, 0.05..10., AppNumberInput::Scale),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

            number_input("Scale Multiplier", 1.0, 0.05..=10., AppNumberInput::Scale),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to #25064 (comment)

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 19, 2026
@kfc35 kfc35 changed the title Migrate clustered_decal example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3) Migrate clustered_decals example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3) Jul 20, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Jul 20, 2026
@alice-i-cecile
alice-i-cecile removed this pull request from the merge queue due to a manual request Jul 20, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Jul 20, 2026
Merged via the queue into bevyengine:main with commit 790c3ee Jul 20, 2026
44 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Examples An addition or correction to our examples D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants