Skip to content

arigl on a phone: windows as a list, labels in view - #974

Merged
transfix merged 1 commit into
masterfrom
feat/arigl-phone-followups
Nov 2, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/arigl-phone-followups

Conversation

@transfix

@transfix transfix commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Follow-up to #967 (arigl on a phone). I drove cyprty, built from master, as a phone: headless Chrome over the DevTools protocol, 390 × 844 CSS px at pixel ratio 3, touch emulation on, and real (trusted) touch events. #967's pieces work there, but two things were wrong.

The conference's windows piled up

The conference document lays its windows out for a laptop: My Camera at (20, 40), Users at (390, 40), Avatar at (20, 610). #967 moves each window into the view, and on a phone that put them all on the same spot, the front one translucent over the others.

Now: on a phone, a window whose authored place or size doesn't fit opens collapsed.

  • Its title bar goes under the others' from the top of the view. Opening the panels shows a list of titles over the scene, to open one at a time.
  • Opened (title arrow or a double tap), it unfolds from its title, as wide as the view and no taller than the room below.

What counts as a phone: a view under 500 CSS px on its short side, either way up. Today's phones are 360 to 430; a tablet or a laptop window is well over.

What is unchanged:

  • windows that fit where they were put;
  • windows with no pos: (the flow, §5.8);
  • every view wider than a phone. The goldens render at 960 × 720.

Labels were cut off in windows that fit their widgets

In the Controls window, "UI size", "Sensitivity" and "Camera distance" showed as "UI", "Sen" and "Car".

Why: ImGui makes a widget 16 lines wide in a window that fits its widgets, which is most of a phone's width at its UI size. reserve_label_width skipped such windows on the grounds that the window grows to the label. #967 now stops the window at the view's edge, so it can't grow any more.

Now: the widget leaves its label room up to the widest the window can be: the view, less ImGui's safe-area padding on each side. That bound doesn't depend on the window's own size, so it holds still from frame to frame. On a wide view it never applies.

Checked on the emulated phone (cyprty from this branch, against a master relay)

  • The page loads with the panels hidden. The corner button opens them as a list: My Camera, Avatar, Users, with the room visible below.
  • Each window opens from its title. My Camera is 560 px tall with the room below it; Avatar runs to the bottom of the view.
  • Settings > Controls… shows UI size: 125%, the touch default. This is the first time it has been seen in a browser since arigl on a phone: UI size, windows in view, the system keyboard #967's UiSettings fix. All three labels are now whole.
  • The system keyboard path:
    • A tap on Name focuses the hidden <input> and moves it to the field's caret.
    • Typed text (Input.insertText, which is what a soft keyboard does) arrives in the field; Backspace deletes.
    • Enter commits, puts the input away and gives the canvas its keys back.
    • The new name reaches the room: the Users list shows it, at 13 ms ping.
  • Typing "www" into the field never moved the avatar. The relay showed it still at (4.00, 0.00), "intent none".

Not covered by the emulation: iOS's rule that only a focus made inside a user gesture raises its keyboard. Chrome focuses outside a gesture too. That still wants a real iPhone.

Tests

cvcgl_imgui_ui_size now also checks:

  • on a phone, the four laptop-layout windows open collapsed, their titles stacked from the top;
  • opened, My Camera and Card unfold from their titles at the view's width;
  • a slider in a fitting window has nothing to scroll to;
  • on a laptop, nothing opens collapsed.

Windows (MSVC 14.44, shared, RelWithDebInfo):

  • 98 cvcgl, cvcMedia and Ariadne ctest tests pass;
  • ariadne_runtime_test: 248 passed;
  • ariadne_loader_test: 213 passed, 2 skipped.

The cyprty wasm builds and links.

Driving cyprty as a phone (headless Chrome: 390 x 844 CSS px at pixel
ratio 3, real touch events) after #967 showed two things wrong.

The conference's windows piled up. The document lays them out for a
laptop (My Camera at 20,40, Users at 390,40, Avatar at 20,610), and on a
phone each was moved into the view, all onto the same spot, the front one
translucent over the others. On a phone (a view under 500 CSS px on its
short side) a window whose authored place or size does not fit now opens
collapsed, its title bar under the others' from the top of the view: a
list of titles over the scene, to open one at a time. Opened, it unfolds
from its title, as wide as the view and no taller than the room below.
Windows that fit, those with no pos: (the flow), and every view wider
than a phone are as before.

Labels were cut off in a window that fits its widgets (the Controls
window: "UI", "Sen", "Car"). ImGui gives such a window's widgets 16
lines' width, most of a phone's at its UI size, and #967 stops the window
at the view's edge, so reserve_label_width's "the window grows to the
label" no longer held. There the widget now leaves its label room up to
the widest the window can be (the view less ImGui's safe-area padding),
which does not depend on the window's own size, so it holds still.

cvcgl_imgui_ui_size covers both: the stacked titles, the windows
unfolding from them, a slider in a fitting window with nothing to scroll
to, and a laptop where nothing opens collapsed.
@transfix
transfix merged commit baa01bf into master Nov 2, 2026
27 checks passed
@transfix
transfix deleted the feat/arigl-phone-followups branch November 2, 2026 23:10
transfix added a commit that referenced this pull request Nov 2, 2026
#974 (windows as a list of titles on a phone) and this branch both
changed where ImGuiBackend::begin_window opens a window. Both stay:
a window that does not fit a phone's view opens collapsed in the list,
and one moved in anywhere else keeps its home. A window in the list
gets no home: one would pull it back out of the list, on the phone and
again when the view grows. reset_layout clears the list count, the last
views and the homes.

cvcgl_imgui_view_shrink gains the case (it fails without the rule), and
section 5.8 says a window in a phone's list stays there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant