bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Rename `UiRect` to `Frame`

Open ickshonpe opened this issue 2 years ago • 6 comments

Objective

UiRect is confusingly named (nothing it represents is a rectangle) and we have a consensus (as far as I can tell) that Frame is the best alternative.

If Frame seems ambiguous (not so much internally but with concepts from foreign UI apis), UiFrame could also be okay.

Alternative proposal: #7710

Changelog

  • UiRect is renamed to Frame

Migration Guide

UiRect has been renamed to Frame.

ickshonpe avatar Mar 08 '23 10:03 ickshonpe

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy? It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

github-actions[bot] avatar Mar 08 '23 11:03 github-actions[bot]

@TimJentzsch @nicoburns for review please :)

alice-i-cecile avatar Mar 08 '23 14:03 alice-i-cecile

Not sure about Frame seems like it'd be confused with the frame as in frames per second. I don't think UiFrame fixes the issue either.

hymm avatar Mar 09 '23 19:03 hymm

Not sure about Frame seems like it'd be confused with the frame as in frames per second. I don't think UiFrame fixes the issue either.

I can see what you mean, but won't it be obvious from the context that it means a geometric frame?

ickshonpe avatar Mar 10 '23 12:03 ickshonpe

Cart's previously stated that "Bevy is treated as a global namespace", which I think that Frame runs a bit close to violating. I still think it's a much better name than UiRect. LayoutFrame would also be fine by me, but I'm increasingly leaning towards distinct types for margin/padding/border.

alice-i-cecile avatar Mar 10 '23 13:03 alice-i-cecile

Cart's previously stated that "Bevy is treated as a global namespace", which I think that Frame runs a bit close to violating. I still think it's a much better name than UiRect. LayoutFrame would also be fine by me, but I'm increasingly leaning towards distinct types for margin/padding/border.

Yeah I can see that in a global namespace Frame intuitively feels like it would be a type associated with animation and, although it might be workable now to have only one type, as taffy adds more features the margin, border, and padding interfaces will probably diverge even further making distinct types more desirable.

ickshonpe avatar Mar 10 '23 16:03 ickshonpe

I thought this would be an easily accepted non-controversial obvious improvement but I've come around to agreeing with hymm now.

@alice-i-cecile Do you think we should close this one, and just concentrate on #7710 (or an incremental step towards it, maybe just a separate Margin type to start with)?

ickshonpe avatar Mar 14 '23 13:03 ickshonpe

Thinking on it, maybe #7710 and #7569 don't make sense as distinct PRs and should be combined.

ickshonpe avatar Mar 14 '23 13:03 ickshonpe

I think close this out and merge the other two :)

alice-i-cecile avatar Mar 14 '23 14:03 alice-i-cecile