Skip to content

L0 Cards: route controls to a host-owned event channel - #62

Merged
guofoo merged 8 commits into
mainfrom
feat/app-card-runtime
Sep 30, 2026
Merged

guofoo merged 8 commits into
mainfrom
feat/app-card-runtime

Conversation

@guofoo

@guofoo guofoo commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Lets a Card host (App Hub's card-host and the Card runner in the OctoSense shells) receive a Card's L0 control events itself, instead of through the navigation callback.

  • to_makepad_l0_ui_with_events(root, channel) lowers an L0 tree like to_makepad_l0_ui, but a tapto whose target starts with l0: becomes agent.notify(<channel>, {target: …}). Other targets keep NAV(t: …). The host must check the mounted Card's identity before it dispatches a target.
  • to_makepad_l0_ui is unchanged (it passes no channel), so existing hosts see no difference.
  • Text fields keep main's on_change/on_return → NAV(t: …, v: text) wiring from Stateful mini-app inputs and CJK/emoji fonts; runtime makepad db4691d0 #46; only on_click routes through the channel.
  • The host rebuilds the Card from updated state with main's l0::prepare_with_state(card, data, state, dir).
  • runtime.json and Cargo.toml lock Octoscript 76032ed4 for bounded InstanceStore snapshots, which App Hub uses to restore Card state. The runtime's own code does not call them; the lock gives every consumer one OctoScript that has them.

Depends on OctoSense-org/OctoScript#51. 76032ed4 is on that PR's branch; the branch head after it only adds a fuzz lockfile line. Merge #51 first, with a merge commit, so the locked revision is on OctoScript main.

Checked locally on c2c6699b, with makepad a5a3cf5b and Octoscript 76032ed4 as siblings:

  • cargo test --release -p octoscript-node -p octoscript-render -p octoscript-makepad: pass, including the new l0_event_target_routes_to_a_host_owned_channel
  • python3 tools/runtime.py verify --cargo-manifest Cargo.toml: pass (one Makepad; Cargo.toml and runtime.json agree)

Bring the Card event channel onto runtime main 6881fb6 (makepad
6cf03859) so App Hub and OctoSense can pin one runtime.

- l0: keep main's prepare_with_state(card, data, state, dir) and move
  the L0 state test to that argument order.
- tapto: text fields keep main's on_change/on_return navigation
  callbacks; other taps route L0 event targets to the host channel.
- runtime.json: lock Octoscript 3c1c6bae (bounded state snapshots), the
  revision Cargo.toml already pins.
Follow runtime main to makepad 975c5630 (65d30a0).
Follow runtime main 019e6bf (makepad bf318136) and lock Octoscript 76032ed4, the bounded state snapshots on Octoscript main.
Follow runtime main 515acb4 (makepad a5a3cf5b), the runtime OctoSense main locks.
runtime.json locks Octoscript 76032ed4; tools/runtime.py prepare puts ../octoscript at that revision, as on main.
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