fix(debug-ui): use a tabbed layout on small viewports #1108

Merged
SakulFlee merged 2 commits from sakulflee/fix-debug-ui-mobile-layout into main 2026-11-12 00:16:27 +00:00 AGit
Owner

Closes #1082.

What changed

  • The debug overlay now chooses its layout from the logical viewport size rather than the platform. When the four floating windows cannot fit (below 1260x880 logical pixels: phones in portrait and landscape, small desktop windows, or a large display with high scaling), it draws one full-screen panel at a time with a Performance / ECS / Console / Rendering tab strip and a Hide button. Large viewports keep the existing floating windows.
  • Floating windows are clamped to the window on every layout and while dragging. A resize, rotation, or a drag toward an edge can no longer move a title bar and its close button off-screen.
  • Panel views no longer check per-panel visibility themselves. The floating window's visibility predicate already does that, and the tabbed layout needs to render the active panel even when its window was closed earlier.
  • Frame-timing history stays enabled while the overlay is open, so the Performance tab still has graph and table data after switching layouts.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -p orbital_debug_ui -p orbital_iced -- -D warnings
  • cargo test -p orbital_debug_ui -p orbital_iced (96 tests)
  • Ran template_all_in_one at 1280x720 logical pixels with the overlay open and confirmed the tabbed layout fills the window with all four tabs and the Hide action visible and reachable.
Closes #1082. ## What changed - The debug overlay now chooses its layout from the logical viewport size rather than the platform. When the four floating windows cannot fit (below 1260x880 logical pixels: phones in portrait and landscape, small desktop windows, or a large display with high scaling), it draws one full-screen panel at a time with a Performance / ECS / Console / Rendering tab strip and a Hide button. Large viewports keep the existing floating windows. - Floating windows are clamped to the window on every layout and while dragging. A resize, rotation, or a drag toward an edge can no longer move a title bar and its close button off-screen. - Panel views no longer check per-panel visibility themselves. The floating window's visibility predicate already does that, and the tabbed layout needs to render the active panel even when its window was closed earlier. - Frame-timing history stays enabled while the overlay is open, so the Performance tab still has graph and table data after switching layouts. ## Verification - `cargo fmt --all -- --check` - `cargo clippy -p orbital_debug_ui -p orbital_iced -- -D warnings` - `cargo test -p orbital_debug_ui -p orbital_iced` (96 tests) - Ran `template_all_in_one` at 1280x720 logical pixels with the overlay open and confirmed the tabbed layout fills the window with all four tabs and the Hide action visible and reachable.
Clamp a panel's position to the window on every layout and while dragging. The title bar, drag area and close button therefore stay reachable after a resize, a rotation, or a drag toward an edge, instead of leaving a window's close button off-screen.
fix(debug-ui): use a tabbed layout on small viewports
All checks were successful
Lint / lint (pull_request) Successful in 1m36s
PR / test (pull_request) Successful in 11m2s
033afc2d79
The four floating debug windows need roughly 1260x880 logical pixels, so on a phone or a small desktop window some of them were unreachable and the mobile Debug toggle could stay hidden behind an off-screen but still visible panel.

Switch to a single full-screen panel with a Performance/ECS/Console/Rendering tab strip whenever the viewport cannot fit the floating windows. The strip stays on screen, so every panel is reachable and a Hide button always closes the overlay. Layout selection is viewport-based, not platform-based, so a small desktop window behaves like a phone.

Panel views no longer hide themselves based on per-panel visibility; the floating window's visibility predicate already does that, and the tabbed layout needs to render the active panel regardless of which windows were closed earlier.

Keep frame-timing history while the overlay is open so the Performance tab has data after switching layouts.

Smart test results

Result: PASS

Scope: orbital_debug_ui, orbital_iced

Reason: directly changed crates

Elapsed: 10m 2s

Workflow run

Overall: 97 tests, 96 passed, 0 failed, 1 skipped

Nextest: 96 tests, 96 passed, 0 failed, 0 skipped
Doctests: 1 tests, 0 passed, 0 failed, 1 skipped

Outcome charts are split between nextest and doctests. The timing chart covers nextest only.

Crate Nextest Passed Failed Skipped Doctests Time
orbital_debug_ui 66 66 0 0 0/1 0.37s
orbital_iced 30 30 0 0 - 0.17s
pie showData
    title Nextest outcomes
    "Passed" : 96
pie showData
    title Doctest outcomes
    "Skipped" : 1
xychart-beta
    title "Slowest crates (nextest seconds)"
    x-axis ["orbital_debug_ui", "orbital_iced"]
    y-axis "Seconds" 0 --> 1
    bar [0.37, 0.17]
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** orbital_debug_ui, orbital_iced **Reason:** directly changed crates **Elapsed:** 10m 2s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/1282) **Overall:** 97 tests, 96 passed, 0 failed, 1 skipped **Nextest:** 96 tests, 96 passed, 0 failed, 0 skipped **Doctests:** 1 tests, 0 passed, 0 failed, 1 skipped _Outcome charts are split between nextest and doctests. The timing chart covers nextest only._ | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital_debug_ui | 66 | 66 | 0 | 0 | 0/1 | 0.37s | | orbital_iced | 30 | 30 | 0 | 0 | - | 0.17s | ```mermaid pie showData title Nextest outcomes "Passed" : 96 ``` ```mermaid pie showData title Doctest outcomes "Skipped" : 1 ``` ```mermaid xychart-beta title "Slowest crates (nextest seconds)" x-axis ["orbital_debug_ui", "orbital_iced"] y-axis "Seconds" 0 --> 1 bar [0.37, 0.17] ```
Sign in to join this conversation.
No description provided.