Repository navigation
Ariadne: room chat and direct messages for the conference, text_view and message_input widgets - #972
Merged
Merged
Conversation
…essage_input (WIP)
…om them, widget tests
transfix
marked this pull request as ready for review
November 2, 2026 07:14
…ient run, snapshot stops on quit
…atches up; e2e driver fixes
# Conflicts: # docs/ARIADNE.md # examples/ariadne/documents/conference_roster.ari # inc/cvc/ariadne/widget.h # inc/cvc/state/state_transport_grpc.h # inc/cvc/state/state_transport_ws.h # src/arigl/main.cpp # src/arisrv/main.cpp # src/cvc/CMakeLists.txt # src/cvc/ariadne/components/INDEX.ari # src/cvc/ariadne/loader.cpp
# Conflicts: # docs/ARIADNE.md
Tried in cyprty (headless Chrome, two and three clients through a local arisrv): at a 1600x900 browser window the canvas is 729 px tall, and the 420-px Chat window put its message field below it. 320 px keeps it on screen. The Users window clipped "1 new" beside a person's message button; the message column takes 12 px from the down and up columns.
This was referenced Nov 2, 2026
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Room chat and direct messages for the Ariadne conference client (the browser page and arigl natively), two new widgets (
text_view:andmessage_input:), and the chat window and users list as reusable components. The design is in docs/roadmap/ARIADNE_CHAT.md.Design
Why the messages are not plain room-tree writes
The relay sends its whole
conftree to every client: in a joiner's admit snapshot, in the WebSocket re-broadcast, and in its forwarding of each client's participant writes. The S7 filters narrow this only for a participant that has joined and been given a filter. An observer, a connection whose admission hold timed out, or any client under--aoi offgets everything. Kept in the shared tree, history would reach every client in full, and so would a DM.So the relay keeps the history in memory:
state_messagewithttl_hops = 0on the client's ownparticipants.<pid>.chatpath. Bound writes already limit a client to its own path.ttl_hops == 0stays at the relay; master now has the same rule for Conference: avatar poses as compact per-viewer snapshots at up to 60 Hz #951's lane signaling. The room write gate refuses a chat message with any otherttl_hops.push_snapshot_to_holder, a new variant ofpush_snapshot_to. It writes only to the connection that holds the pid under bound writes, never to a second connection that claims the same pid.State layout
What a client holds under
conf.rooms.<room>.chat:epoch,room.head,room.firstroom.m.<seq>dms,dm.<peer>.{head,first,m.<seq>}error,revA message is one JSON leaf. A client reads
revandroom.headonce per tick and looks further into the tree only when one of them moves.Pagination
text_viewreaches its top, it asks for the page before the oldest message held. One request per channel is in flight at a time, and it is sent again after 3 s.DMs and permissions
chat.error): empty or over-long text, a DM to someone absent or to yourself, more than 64 conversations, and posts over the rate limit (a burst of 10, refilled at 2/s). With--bind-writes off, DMs are off.What changed
room_chat.h/.cpp, withroom_chat_relay(in arisrv, with stats in the room-debug log) androom_chat_client. The new DSL verbs arechat-post,chat-info,chat-messages,chat-more,chat-conversationsandchat-rev. arigl and the example host set the shard's transport, so the chat messages leave.push_snapshot_to_holderon WS and gRPC, and the gate's chat rule.text_view:andmessage_input:in the core, ImGui and FTXUI. tvision draws FTXUI's widgets. In ImGui,text_viewdraws only the lines in view. It follows new lines, keeps its place when older lines are added above, and with height 0 fills the window less what is under it.message_inputsends on Enter, takes Shift+Enter for a new line, keeps focus, and grows tomax_lines. In a terminal, a new line is Alt+Enter or Ctrl+J. arigl on a phone: UI size, windows in view, the system keyboard #967's phone keyboard coversmessage_inputtoo, since it keys off ImGui's IME data.components/chat.ari(unitschatandchat_panel, pluschat-ui-*functions) andcomponents/room_users.ari(the conference's Users window, now with a message button, plusroom_users_compactandroom-users-step). Both are listed in INDEX.ari.conference_roster.ariis built from them, and Ariadne: a closed peer camera window comes back from the View menu #962's camera-window state still follows the person. The browser page embeds the component library.arigl snapshotnow stops at the frame where the document quits, asari's does.Testing (Windows: native, and the browser page in Chrome)
New tests:
room_chat_test(14): relay rules, privacy, pagination, a late joiner paging back, lost-push recovery, epochs, the DSL verbs.*PushToHolder*and*TtlZero*tests.cvcgl_imgui_chat_widgets: keys, Shift+Enter, focus, the wheel to the top, prepend anchoring, the fill height.ari test src/ari/tests/chat_component.ari(10), as ctestari_chat_component: the components' DSL with the room verbs stubbed.Existing suites on merged master: ariadne_loader 214, ariadne_runtime 250, ariadne_ftxui 79, room_intrinsics 15, state_transport_ws 42, state_transport_grpc 48, room_relay_integration 16. All pass.
End to end:
src/arigl/tests/chat_two_clients.shruns a local arisrv and scripted arigl clients over gRPC, each drawing the shipped Chat and Users windows offscreen:All three report OK, and a fourth client on the real
conference_roster.arishows the Chat window with the history.In the browser: the conference page built for wasm from this branch, a local arisrv over WebSocket, and headless Chrome clients driven through DevTools (trusted mouse and wheel events; text through the page's system-keyboard queue), on the real conference document:
Fixed from the browser run: in a 1600x900 browser window the canvas is 729 px tall, and the 420-px Chat window put its message field below it. It is 320 px now, and the Users window's message column no longer clips "1 new". Both were checked again in a relinked browser build.
Not fixed here: the browser page lays its windows out against arigl's starting 1024x768 render window, before the canvas takes the page's size, so on a smaller canvas the "opens inside the view" rule (§5.8) never moves them in. That holds for every window in the document (the Avatar window is cut off too), and it is a separate fix.