registerAction

fun registerAction(actionId: String, action: () -> Unit): ToolbarSubscription

Register a click handler for the action identified by actionId.

One lambda per actionId — calling this again with the same actionId replaces the previous registration (last-write-wins). The returned subscription only removes the registration if it is still pointing at the lambda this call installed; closing a stale subscription after another binder has taken over is a safe no-op. This is what lets producers (binders) rotate without coordinated teardown.

Producers must re-register after a state restore — saved state preserves which actionIds exist and their visual state, but lambdas are never persisted (ADR-Toolbar-4). See STATE-2b.