Skip to content

Ariadne: a bound widget's on: runs after its committed write - #902

Merged
transfix merged 1 commit into
masterfrom
fix/ariadne-combo-on
Oct 30, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/ariadne-combo-on

Conversation

@transfix

Copy link
Copy Markdown
Owner

Problem

Found by the cypkg tmux tests: a combo: with on: (state-set "x" "1") changed its bound key when picked, but the on: program never ran, and ari check said nothing.

  • loader.cpp: the combo branch never called action(n), so on: was dropped (unlike input_text, input_int and tf_editor).
  • ariadne.cpp: Kind::Combo wrote the value but never called enqueue(w.on).

checkbox, slider_int, slider_float, color and a bound menu_item (menu_item + bind:) had the same gap in both places.

Fix

  • The loader keeps on: for each of those widgets.
  • The runtime enqueues on: after the committed write, the way input_text already does, so the handler reads the new value from state:
    • combo: on each pick
    • checkbox, color, bound menu_item: on each committed edit
    • sliders: once per commit (drag end or key step), not on every live frame of a drag, even though a live slider still writes on every frame
  • Widget::on's comment and the roadmap's widget section now describe on: on bound widgets.

No .ari file in the repo puts on: on any of these widgets (I scanned every tracked .ari), so no existing document behaves differently.

Tests

  • AriadneLoader.BoundWidgetsKeepTheirOn: each bound widget keeps its on:, with no load warnings.
  • AriadneRuntime.ComboPickFiresOnAfterTheWrite: a pick writes the key, and the program runs at drain (not during the walk) and sees the new value.
  • AriadneRuntime.BoundWidgetsFireOnOnCommit: a live slider frame writes without firing; on the commit edge, every widget fires once.
  • AriadneFtxui.ComboPickRunsItsOn: Tab focuses the combo, Right picks the next option, and the (state-set "x" "1") program runs.

All four fail without the fix. Locally (Release, Linux), the loader (201), runtime (202), ftxui (67), bind (19) and host (21) suites all pass.

A combo with on: wrote its key when picked but never ran the on:
program: the loader dropped on: for combo, and the runtime had no
enqueue after the combo's write. checkbox, slider_int, slider_float,
color and a bound menu_item had the same gap.

The loader now keeps on: for each of them, and the runtime enqueues it
after the committed write, as input_text, input_int and tf_editor
already did. A slider fires once per commit (drag end or key step), not
on every live frame of a drag.

Tests: a loader test, two runtime tests and an FTXUI test that focuses
a combo, presses Right and checks that its program ran.
transfix added a commit to cy-pca/cypkg that referenced this pull request Oct 30, 2026
#902 runs a combo's on:, #904 runs a load:ed module's on_tick and #905
grants a hole's subtree. All six PRs merge cleanly onto master in this
order (#904 is stacked on #900), and tests/run.sh passes unchanged on
the ari built from them.
@transfix
transfix merged commit 5d933ec into master Oct 30, 2026
20 of 26 checks passed
@transfix
transfix deleted the fix/ariadne-combo-on branch October 30, 2026 17:52
transfix added a commit to cy-pca/cypkg that referenced this pull request Nov 12, 2026
…rch once; frames for ari 3.7.13 (#11)

* search: the filter combos ask for the search; a request reads its search once

- The Platform, Arch and Link combos search again from the first row in their
  on:, as the query field does. on_tick no longer compares the filters with the
  ones it last sent: a combo's on: has fired since transfix/libcvc#902.
- on_tick read the search's key at its top and took the request further down.
  A tick can run over frames, so a query typed in between was searched under
  the key from before it: the reply counted as no new query, and the status
  kept the old package count. The request now reads the query and the filters
  once as it is taken, for the key, the request and the prefetch alike.
  (search_test caught it on ari 3.7.13 once the filter compare was gone.)
- search_test sets a filter as the combo's on: does; tests/interactive.sh picks
  one with the keyboard in both terminal backends. ROADMAP's L15 is done.

* tests: ari 3.7.13 draws a window's maximize marker in its title

transfix/libcvc#1086 gave windows a maximize button; FTXUI draws it as [↑] in
the title bar. The six unit frames with a window title take it. Only the first
line of each changes. tests/run.sh had not run on 3.7.13 before: the scheduled
runs skip it.

* tests: the whole-document frames carry ari 3.7.13's maximize marker too

The previous commit moved the unit frames to ari 3.7.13's window titles
([↑] after the title, transfix/libcvc#1086). The snapshots in
tests/expected/ draw the same windows: the cypkg window, and the
Builders, Builds, Activity and Account windows over it. Only those title
lines change.

* tests: the integration filter tests ask for the search as a combo does

A filter combo's on: sets the offset to 0 and req.search (views.ari); a
state-set on search.platform, .arch or .link alone no longer searches.
The integration copy of the filter tests set the filters alone, so each
waited for a search that never came (max_steps_exceeded). They now do
what the combos do, as tests/modules/search_test.ari already does.

* tests: the integration frames carry the maximize marker too

The integration step's snapshots against a local cvcpkg-server
(tests/integration/expected/) draw the same cypkg window as
tests/expected/; its title line gains ari 3.7.13's [↑]. Nothing else in
those frames changes.
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