Skip to content

Ariadne on a phone: a drag over a picture isn't its click, the password keyboard, pictures kept while hidden - #1364

Merged
transfix merged 3 commits into
masterfrom
fix/ariadne-phone-input-and-pictures
Nov 19, 2026
Merged

transfix merged 3 commits into
masterfrom
fix/ariadne-phone-input-and-pictures

Conversation

@transfix

Copy link
Copy Markdown
Owner

Three bugs in nicotina on a phone (arigl-web 4.0.0), all in libcvc:

A drag that starts on a picture or video opens it. ImGuiBackend::item_clicked was ImGui::IsItemClicked(), which fires on the press. A widget's own on_click (nicotina's picture and video tiles) ran before TouchScroll took the drag. Item groups were already a tap (end_item_group). Now a widget's on_click is a tap too: the release is over the item, the press was inside it, and the pointer moved no more than MouseDragThreshold.

The password shows in the phone keyboard's suggestions. ImGuiOverlay's hidden <input> (the one the system keyboard types into) was always type=text. While the password field was active it held the password, and it still held it after sign-in. Now Platform_SetImeDataFn reads InputTextState.Flags & ImGuiInputTextFlags_Password for the active field. The input becomes type=password for a password field and text otherwise, and it is emptied on each type change and when it closes.

Pictures are fetched again after the page is hidden. ImageCache dropped a picture that hadn't been asked for in 30 s of wall time. A hidden tab draws about once a minute, so every hidden frame dropped every other picture and fetched it again (38 refetches per picture over ~40 min in a stub log). Retention now runs on a drawing clock that advances at most 1 s between requests, so a pause in drawing drops nothing. Failed fetches still retry on wall time, since that's how the jobs stamp them.

Tests:

  • cvcgl_imgui_group_click covers a widget with its own on_click:
    • a press alone runs nothing;
    • a release unmoved runs it;
    • a press that drags doesn't;
    • a press that went down elsewhere doesn't.
  • ariadne_media_test MediaCache.APauseInDrawingDropsNothing:
    • a 1.5 s gap with idle 1.2 s drops nothing and refetches nothing;
    • drawing time past idle still drops.
  • docs/ARIADNE.md:
    • §5.19: on_click is a tap;
    • §5.14: password fields and the system keyboard;
    • picture retention is in drawing time.

Verification:

  • Both tests pass in a local native build.
  • The wasm build of this branch was checked in headless Chrome as a phone (390×844 at 3×, touch emulation, soft-keyboard text through Input.insertText), against nicotina main and the stub server:
    • a drag starting on the feed's video, or on a picture, scrolls the feed and opens nothing;
    • a tap on the picture opens the viewer;
    • the hidden input is type=password with the password field active, and text with the username field;
    • after sign-in it is text and emptied.
  • The same steps on 4.0.0 opened the viewer on a drag, and left the password in the input.

Not covered: a real phone. The feed's glide is separate.

…rd keyboard, pictures kept while the page is hidden

- A widget's on_click (§4.6) is a tap in ImGui, as an item group's is: the button released over
  the item it went down on, not dragged past the drag threshold. It was IsItemClicked, the press,
  so a finger landing on a feed's picture or video to scroll opened the viewer (or paused the
  video) before TouchScroll made the drag a scroll.
- The phone keyboard's hidden input is type=password while ImGui's active field is a password
  field (input_text with password: true). As type=text with autocomplete off, a phone keyboard
  still showed the password in its suggestion strip and learned it. What was typed is cleared
  from it when its type changes and when the keyboard closes; it used to stay in the page.
- The picture cache counts idle in drawing time, not the wall's: the clock moves with the time
  between two requests, at most a second at a time. A hidden browser tab draws about once a
  minute, so every frame came more than idle_seconds (30) after the last, and each dropped every
  other picture and fetched it again (and once more on return to the page). A failure's retry
  stays on the wall.

Tests: cvcgl_imgui_group_click (a widget's on_click: the press runs nothing, a tap runs it, a
press that drags or went down elsewhere doesn't); ariadne_media_test's
MediaCache.APauseInDrawingDropsNothing.
@transfix
transfix merged commit 89f986f into master Nov 19, 2026
29 checks passed
@transfix
transfix deleted the fix/ariadne-phone-input-and-pictures branch November 19, 2026 20:46
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