Repository navigation
Ariadne: a spinner widget that turns by the host's frame clock - #915
Merged
Merged
Conversation
`spinner:` shows that something is under way when there is no amount to show (a request, a search). The host turns it by its own frame clock, not by state, so it keeps moving while the document's programs are parked: a program waiting on http-get still has a turning spinner beside it. - Runtime::frame_clock(): the steady clock read at the top of each render(), or the host's pinned time (set_frame_clock). ari snapshot pins frame f at f / fps; arigl's fixed clock advances it by frame()'s dt, so snapshots are reproducible and still step. - Kind::Spinner calls Backend::spinner(label, seconds, ascii): label from the key or from bind: (state path or computed), still while disabled, hidden by visible_when as any widget. - Terminal backends (FTXUI, and tvision through it): ten braille dots a second, then the label; | / - \ with glyphs: ascii, and by themselves on the Linux console and dumb / vt* terminals (Backend::unicode_glyphs). ImGui: a drawn arc a text line high, one turn a second, so it needs no glyph from the font (the browser build's is ASCII). - A spinner kind rather than progress with indeterminate: progress is a bound quantity over [lo, hi]; an activity indicator is one inline glyph with nothing to bind. - terminal_tour.ari's Status window has one. Tests: AriadneSpinner (glyph cycle, the frame clock pinned and real, turning while the document's program is parked, disabled / hidden / bind), AriadneLoader.Spinner, AriadneFtxui.SpinnerTurnsByTheFrameClock, cvcgl_imgui_spinner (the arc turns, comes round after a second, stands still disabled), and ari_spinner (tests/spinner_test.sh: ari snapshot frame 1 against frame 3, then ari run under tmux for FTXUI and tvision, the screen taken twice). Docs: ARIADNE.md 4.
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 30, 2026
While ui.busy is set, libcvc's spinner widget (transfix/libcvc#915) turns beside the status line (Signing in..., Checking the code..., Refreshing...) and beside Connecting to ... at start-up. It turns by the host's frame clock, so it keeps moving while the controller is parked on the request. A host without the widget keeps the text alone: each spinner is gated on (has? "spinner"), and main.ari lists it as an optional requirement. The stub's mary takes 3 s to load and slowpoke 12 s. tests/run.sh checks the spinner in a snapshot, and in tmux under FTXUI and tvision that its glyph changes while mary signs in; it skips those checks on an ari without the widget.
Owner
Author
|
Local ctest on this branch, rebased on master 297876c (Linux GCC, Release, cvcGL + ImGui + tvision + arigl; filter |
transfix
added a commit
to cy-pca/nicotina
that referenced
this pull request
Oct 31, 2026
…igl, launchers, tests) (#1) * M0: sign in to a TX.WTF instance, then show the profile and SCRIP balance share/nicotina/main.ari runs in stock ari (FTXUI or tvision) and arigl. It signs in with POST /user/login and capture_auth, so the host keeps the token and the document never sees it; GET /user/ and /billing/scrip/balance name the credential with auth:. It handles the emailed second factor (/user/login/2fa), a wrong password, force_password_change (change it in the web app first) and an expired token (sign in again), and signs out with /user/logout and net-auth-forget. requires: net and net.auth, so a host without --net refuses it. The windows (ui/signin.ari, ui/home.ari) are laid out for an 80x24 terminal; ImGui adds a Details window. The instance comes in as --instance (default https://tx.wtf); --user fills in the form. * Launchers: bin/nicotina (POSIX sh) and bin/nicotina.cmd They find the prefix from their own path and run share/nicotina/main.ari in arigl, or in ari in a terminal (--terminal, --backend ftxui|tvision, or no display: no DISPLAY/WAYLAND_DISPLAY, or SSH without X forwarding). The host gets --net --net-allow <the instance's origin> and a credential store in $XDG_CONFIG_HOME/nicotina (%APPDATA% on Windows). Other options go to the host, arguments after -- to the document; --dry-run prints the command. web/ariadne.config.json is the arigl-web and ari pages' config for an instance that serves the documents at /apps/nicotina/. * Tests: a stub TX.WTF instance, snapshots and tmux runs tests/stub_txwtf.py answers the five endpoints M0 uses with txwtf's shapes. tests/run.sh checks the launcher's choices, ari check without --net, ari snapshot in both backends (sign-in form, resumed session, expired session, an instance that doesn't answer), arigl snapshot, and bin/nicotina in a tmux pane in both backends typed at like a person: sign in, restart signed in, sign out, a wrong password, the emailed code, a forced password change. No output may contain a session token. * README and roadmap: running M0 from a local libcvc build How to build ari and arigl from the four open libcvc pull requests, run the client and its tests, and serve it in the browser; the cvcpkg way once the packages publish. The roadmap gains L11, a masked text input, which M0 needs. * tests: remove the tmux socket a killed server leaves * tests: no bytecode in the tree; the stub follows tx.wtf's live schema Remove the committed tests/__pycache__, ignore __pycache__/ and *.pyc, and run Python with -B in tests/run.sh. The stub's replies now follow https://tx.wtf/openapi.json (txwtf 0.4.0): ResponseSchema for /user/logout, a validation error's loc/msg/type, the User fields a login reply requires. Its errors are the ones tx.wtf answers: 401 Not authenticated without a token (not 403), 401 Invalid token for one it doesn't know. * web: --instance {origin}, so one page config serves every instance transfix/libcvc#887 (0f627c9e) replaces {origin} in a page config's args as well as its flags. * tests/live.sh: the client against a live instance, as a test account tests/live.sh signs in to a live TX.WTF instance (dev.tx.wtf) with a test account from an owner-only env file outside the repository, in both terminal backends: a wrong password, the profile and balance, resuming the stored session in ari and arigl snapshots and on restart, and sign-out. The password is typed through a tmux buffer, and no output may hold it or the session token. The helpers both scripts use move to tests/lib.sh. * tests/local.sh: the client against a real txwtf instance from cvcpkg tests/local.sh starts txwtf's own server (txwtf-cp312 from a cvcpkg prefix) on a fresh SQLite database and drives the client against it in both terminal backends. tests/txwtf_local.py makes the accounts with txwtf's core functions: SCRIP minted, the emailed second factor on, a forced password change. tests/smtp_sink.py takes the instance's mail, so grace signs in with the code from the real email. It also checks that the server refuses a token after sign-out, the client's answer to txwtf's 429 once its login rate limit is used up, and a server that has gone away. The README lists the three suites: the stub (CI), a local txwtf, and a live test instance. * tests: run the local txwtf from the work directory, which keeps uploads/ out of the tree txwtf makes an uploads/ directory wherever it runs, init-db included. tests/lib.sh makes $out, $ARI and $ARIGL absolute so a script may change directory. * README: the browser builds on cyberpcangel.com In the browser: the pages are public at cyberpcangel.com/nicotina and /nicotina-term, published by the deploy-cyberpcangel workflow (#2). Why that origin needs its own page config and tx.wtf's CORS (atx-crypto-club/txwtf#312), and what the pages do until then. The same-origin /apps/ setup still waits on txwtf T2. * Home: the full handle, @user@instance, before the display name The header shows the handle with the instance's host (no scheme, path or default port), e.g. @[email protected]. A brokered account keeps the home instance its txwtf username already carries (<user>@<home domain>); GET /user/ has no other field for it. The display name is cut to fit the window's 60 columns. ImGui's Details window lists the handle too. The stub gains a long display name and a brokered account, and tolerates an instance below a path; tests/run.sh checks the cut, the brokered handle, a path and a default port, and every suite expects the full handle. * Home: no placeholder email for a brokered account; a long email cut to fit txwtf gives a brokered account a local email in .invalid (its real address belongs to its home instance), so the row shows '-' for one. Others are cut to the value column's 51 characters. * A Refreshing... status, and a TODO for the spinner Refresh now says so while its requests are out, as sign-in and the code check do, so each request has a status line a spinner can sit beside. The spinner itself waits on libcvc's widget, which animates from the host's frame clock: the controller is parked during a request, so no state it writes could drive one. tests/run.sh presses Refresh in both terminal backends. * A spinner beside the status line while a request is out While ui.busy is set, libcvc's spinner widget (transfix/libcvc#915) turns beside the status line (Signing in..., Checking the code..., Refreshing...) and beside Connecting to ... at start-up. It turns by the host's frame clock, so it keeps moving while the controller is parked on the request. A host without the widget keeps the text alone: each spinner is gated on (has? "spinner"), and main.ari lists it as an optional requirement. The stub's mary takes 3 s to load and slowpoke 12 s. tests/run.sh checks the spinner in a snapshot, and in tmux under FTXUI and tvision that its glyph changes while mary signs in; it skips those checks on an ari without the widget. * README: the tests run in CI; point to ci/README.md
added 2 commits
October 30, 2026 20:13
# Conflicts: # src/ari/CMakeLists.txt
# Conflicts: # src/cvc/ariadne/ariadne.cpp
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.
A generic activity indicator for Ariadne documents:
spinner:. It shows something is under way (a request, a search) and keeps turning while the document's programs are parked, because the host's frame clock drives it, not state. Asked for by nicotina (show it whileui.busyis set) alongside L4 (#914), which keeps the single-threaded browser pages drawing while a request is out.Why a
spinnerkind rather thanprogresswithindeterminate: trueprogressis a quantity: it requiresbind:(the loader warns without one), and itslo/hi/overlaymean nothing with no amount to show.progress's contract as it is. It also makes the "animates by the host clock, not by state" rule specific to this widget, where it is the whole point.What it does
Frame clock:
Runtime::frame_clock()is the steady clock read at the top of eachrender(). A host that renders frames with no real time between them pins it withset_frame_clock(t):ari snapshotpins framefatf / fps(default 20);frame()'s dt.So snapshots are reproducible and still step from frame to frame.
Walker (
Kind::Spinner): callsBackend::spinner(label, seconds, ascii). The label is the widget's key, orbind:(state path or computed). Disabled, it getsseconds = 0(stands still), inside the usual disabled scope.visible_whenhides it as for any widget.Terminal backends (FTXUI, tvision): the default
Backend::spinnerdraws a text line: ten braille dots a second (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏, spelled as UTF-8 bytes for MSVC), then the label. They fall back to| / - \:glyphs: ascii;dumb/vt*terminals, which have no braille (Backend::unicode_glyphs(), read fromTERMonce).tvision draws through
FtxuiBackend, so it gets the same.ImGui (arigl): a drawn arc (three quarters of a circle a text line high, one turn a second, in the text colour, dimmed when disabled), then the label. It needs no glyph from the font; the browser build's font is ASCII.
Browser pages:
ari.html(FTXUI over xterm.js) shows the braille; arigl's page uses the ImGui arc.Example:
examples/ariadne/terminal/terminal_tour.ari's Status window has one, so the publishedari.htmland arigl's tour show it.Docs: ARIADNE.md §4.
Tests
ariadne_runtime_test,AriadneSpinner:msg-recv;visible_whenhides it,bind:gives the label (state path and computed).ariadne_loader_test,AriadneLoader.Spinner: the key,glyphs: ascii, a bare- spinner, a warning for an unknownglyphs.ariadne_ftxui_test,AriadneFtxui.SpinnerTurnsByTheFrameClock: braille, then the next glyph, in the FTXUI text snapshot.cvcgl_imgui_spinner(bare ImGui context, no GL): the arc turns a quarter second on and comes round after a second; disabled it stands still; the label sits on its line.ari_spinner(src/ari/tests/spinner_test.sh):ari snapshotframe 1 against frame 3 (⠋ → ⠙,|→/). Thenari runin a tmux pane under each terminal backend, its screen taken twice 0.4 s apart while the program is parked. Locally: FTXUI ⠋ → ⠼, tvision ⠋ → ⠼. Without tmux only the snapshots run.ari.htmlfrom a single-threaded wasm build (emsdk 5.0.7) runs the baked tour in Chrome. Pixel comparison of crops 250 ms apart: the glyph cells change (17–29 px differ), the label's don't (0).cvcgl_imgui_spinner, and this PR'sarigl-webCI job builds that page with it.For nicotina
Put it next to the status line. It keeps turning while the request is out; in the single-threaded browser pages that needs #914.