ui: Improve submenu rendering when there's not enough space (#54773)

This PR makes the submenu render on the left of the trigger if there's
not enough space (200px of available width) on the right. This improves
the rendering overall, I believe, as it's better than the submenu
rendering _on top_ of the parent menu.

Release Notes:

- N/A
77805330c0Danilo Leal committed on 4/24/2026, 12:47:36 PM· committed by GitHubparent442790c
1 file changedLine totals unavailable