Callback Model
Vektra builder callbacks have two forms:
- Standard
on_click,on_change,on_focus, andon_blurforms receiveApp-level callbacks and suit logic that does not need host Entity state. on_click_in,on_change_in,on_focus_in, andon_blur_inreceive a&Context<T>. They useContext::listenerinternally, so handlers can mutate&mut Tand callcx.notify().
_in is Vektra's host-Entity binding convention. It is neither DOM capture/bubble nor GPUI's subtree on_focus_in semantics. Component callbacks execute synchronously.
After the host Entity is destroyed, the weak reference held by Context::listener no longer upgrades, so the callback safely stops running. Start asynchronous work from an Entity-bound callback with GPUI task APIs and let the host own task lifecycle.
Changeable<T> uses on_change for a user-requested next controlled value. It carries no ClickEvent and does not imply that the component committed state.
Input is the explicit exception: its caller-owned InputState also implements EventEmitter<InputEvent>. Builder callbacks and Changed, Focused, Blurred, and Submitted events share one semantic path rather than two editing implementations. Programmatic set_value, clear, and reset never produce Changed.