Skip to content

Ariadne: clickable groups (on_click, hover: highlight, on_hover_end), and {i} in a repeated row's handlers - #1063

Merged
transfix merged 2 commits into
masterfrom
feat/ariadne-group-click
Nov 8, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/ariadne-group-click

Conversation

@transfix

@transfix transfix commented Nov 8, 2026

Copy link
Copy Markdown
Owner

A feed's card can now be clicked as a whole, in every stock backend, and {i} reaches a repeated row's handlers. This is for nicotina's TX.WTF client: clicking a post opens it.

{i} in handlers (a fix). substitute_index() filled {i} into id, label, bind, on, the predicates, tooltip and pictures. It missed on_click, on_hover, on_drag, on_drag_start, on_drag_end, on_top, hint and send, so their programs saw a literal {i}. room_users.ari's name cells opened tree.cam_{i}, not the row's camera.

A group with on_click: is one item. This covers a group with on_click:, on_hover:, on_hover_end: or hover: highlight. Until now a group had no item of its own. In ImGui its on_click was its last child's (or a table's, or a backdrop's). In the terminals it was nothing, because text and pictures take no focus.

  • The Backend API gets begin_item_group / end_item_group around the group's children. After the bracket, the group is the last item, so item_clicked, item_hovered, item_pointer and set_tooltip cover all of it.
  • ImGui: an InvisibleButton over the group once it is laid out.
    • A button, checkbox or field inside it takes the hover first, so it keeps its own click.
    • A click is a tap: released over the group, not dragged past the drag threshold. A finger scrolling a feed opens nothing (TouchScroll lets go of the press as before).
    • hover: highlight fills the area with the header-hover colour, on a draw-list channel under the content.
  • FTXUI / tvision: the group is an item.
    • A press on its text or pictures is the group's.
    • One with on_click: takes focus: Tab reaches it before its widgets, and Enter or Space fires it.
    • A one-column gutter marks it: ▌ and a grey background for focus, │ for hover: highlight. It is always reserved, so the layout never shifts.
  • The innermost taker keeps a click. A child with its own on_click:, a fullscreen picture or a button fires, and the group doesn't.
  • on_hover_end: (any widget) runs once when the pointer leaves, or when the widget goes.
  • Capability token ui.group_click (Capabilities::item_groups).

Docs: ARIADNE.md §5.19 (new), §6.5 (what {i} covers), and the §5.7 token table.

Tests:

  • ariadne_ftxui_test: RepeatedRowsHandlersSeeTheirOwnIndex, GroupClickCoversTheCardButNotItsButton, GroupClickGoesToTheInnermostHandler, GroupHoverHighlightsAndReportsTheEnd.
  • New cvcgl_imgui_group_click: tap, button, drag and hover through ImGui's own input.
  • Locally on Windows (FTXUI on): ariadne_ftxui_test (89), ariadne_loader_test, ariadne_requires_test and all 15 cvcgl_imgui_* tests pass. tvision isn't buildable on that box; CI covers it.

…nt and send

substitute_index() filled {i} into a repeat instance's id, label, bind, on, predicates,
tooltip and pictures, but not into on_click, on_hover, on_drag, on_drag_start,
on_drag_end, on_top, hint or send, so their programs saw a literal "{i}": room_users'
name cells opened tree.cam_{i} instead of the row's camera window. ARIADNE.md §6.5 now
lists what {i} covers, and ariadne_ftxui_test clicks and hovers rows of a repeat.
…over: highlight

A feed's card could not be clicked as a whole: a group had no item of its own, so its
on_click was its last child's in ImGui (or a table's, or a backdrop's), and nothing at
all in the terminals, where text and pictures take no focus.

Backend gets begin_item_group / end_item_group around such a group's children (one
with on_click, on_hover, on_hover_end or hover: highlight); after it the group is the
last item, so item_clicked, item_hovered, item_pointer and set_tooltip cover all of it.
- ImGui: an InvisibleButton over the group once it is laid out. A button, checkbox or
  field inside it took the hover first and keeps its click. A click is a tap (released
  over it, not dragged past the threshold), so a finger scrolling a feed opens nothing.
  hover: highlight fills its area with the header-hover colour on a channel under it.
- FTXUI / tvision: the group is an item. A press on its text or pictures is its own,
  and one with on_click takes focus: Tab reaches it before its widgets, Enter or Space
  fires it. A one-column gutter marks it (focus: a half block and a grey background;
  hover: highlight: a bar), always reserved so the layout never shifts.
- The core keeps a click with the innermost taker: a widget with its own on_click, or a
  button, inside a clickable group fires and the group does not.
- on_hover_end (any widget): once, when the pointer leaves or the widget goes.

Capabilities::item_groups backs the new token ui.group_click. ARIADNE.md §5.19 documents
it; ariadne_ftxui_test's GroupClick* / GroupHover* tests drive it by mouse and keys.
@transfix
transfix merged commit 9731b81 into master Nov 8, 2026
28 checks passed
@transfix
transfix deleted the feat/ariadne-group-click branch November 8, 2026 23:53
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