中文
用户问题
只发送 domain action 或只发送 store action 的组件事件已经很简洁。但 Save 这类事件目前需要 on_local handler 手动传递 domain owner,然后再更新 component store。这种写法正确,却让最重要的组件 transition 比普通 action 更难浏览。
面向用户的目标
让常见的“发送可序列化 domain intent,然后完成或重置本地组件状态”读起来像一个明确的 transition,同时避免为每一种 DOM event 与 target 组合新增 helper。
调研范围
验收标准
- 至少三个真实调用点共享该 abstraction 后,才将其提升为公共 API。
- Save/reply 一类组件代码更短,同时 domain action payload 仍保持可见。
- domain reducer/workflow 仍然不能读取或修改 child stores。
- transition 保持 action observation order,并且无需浏览器即可测试。
- 简单的 on_action、on_store 与确实需要定制的 on_local handler 仍然可用。
- 文档解释何时适合 local coordination,何时应该将 state 提升到 domain model。
非目标
- 用任意 callback 隐藏可序列化 actions。
- 为每一种 event kind 增加组合爆炸的 helper。
- 让业务 reducer 访问 runtime path 或 child state。
- 在 replay-store 实验明确 session completion 语义前启动这个 API。
English
User problem
A component event that only sends a domain action or only sends a store action is concise. Events such as Save currently need an on_local handler that manually threads the domain owner and then updates the component store. This is correct but makes the most important component transitions harder to scan than ordinary actions.
User-facing goal
Make the common sequence send serializable domain intent, then finish/reset local component state read like one deliberate transition, without introducing a helper for every DOM-event and target combination.
Investigation
Acceptance criteria
- At least three real call sites share the proposed abstraction before it becomes public API.
- Save/reply-style component code is shorter and keeps the domain action payload visible.
- Domain reducer/workflow still cannot read or mutate child stores.
- The transition preserves action observation order and remains testable without a browser.
- Simple on_action, on_store, and genuinely custom on_local handlers remain available.
- Documentation explains when local coordination is appropriate and when state belongs in the domain model.
Non-goals
- Hiding serializable actions behind arbitrary callbacks.
- Adding a combinatorial helper for every event kind.
- Letting business reducers access runtime paths or child state.
- Starting this API before the replay-store experiment establishes session-completion semantics.
中文
用户问题
只发送 domain action 或只发送 store action 的组件事件已经很简洁。但 Save 这类事件目前需要 on_local handler 手动传递 domain owner,然后再更新 component store。这种写法正确,却让最重要的组件 transition 比普通 action 更难浏览。
面向用户的目标
让常见的“发送可序列化 domain intent,然后完成或重置本地组件状态”读起来像一个明确的 transition,同时避免为每一种 DOM event 与 target 组合新增 helper。
调研范围
验收标准
非目标
English
User problem
A component event that only sends a domain action or only sends a store action is concise. Events such as Save currently need an on_local handler that manually threads the domain owner and then updates the component store. This is correct but makes the most important component transitions harder to scan than ordinary actions.
User-facing goal
Make the common sequence send serializable domain intent, then finish/reset local component state read like one deliberate transition, without introducing a helper for every DOM-event and target combination.
Investigation
Acceptance criteria
Non-goals