Repository navigation
收敛 domain 与 component-store transition / Simplify domain and component-store transitions - #15
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a small public helper in explore/react/state to express the common “dispatch one complete domain action, then optionally advance one component store action” pattern as a reusable, DOM-event-independent transition. It then migrates existing Todo/Lab handlers to this abstraction, and documents the intended decision/ordering contract.
Changes:
- Add
action_store_transition(...)as an event-independent builder for domain → (optional) component-store transitions, preserving explicit ordering. - Refactor Todo and Lab view handlers to reuse the new transition instead of handwritten owner-threading closures.
- Add documentation and a browser-independent test that asserts observation ordering and
store_when = Falsebehavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new transition helper and clarifies when to use it vs on_local_*. |
| PLAN.md | Updates the authoring/API plan and status notes to reflect the new abstraction and rollout. |
| explore/react/state.kk | Adds action_store_transition(...) implementation alongside existing on_action_* / on_store_* helpers. |
| docs/action-store-transitions.md | New decision guide + ordering contract in Chinese and English with examples. |
| demo/todo/view.kk | Replaces start/save/cancel edit closures with action_store_transition(...) usage. |
| demo/tests/statecases.kk | Adds action_store_transition_test() to verify domain→component observation ordering and store_when semantics. |
| demo/tests.kk | Registers the new transition test in the demo test suite. |
| demo/lab/view.kk | Refactors send-reply handler to the new transition helper. |
| Agents.md | Updates contributor guidance to recommend action_store_transition(...) for the 1 domain + 1 store pattern. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
使用者可见结果
顺序与边界
文档
验证
English
User-visible outcome
Ordering and boundaries
Documentation
Verification
Closes #12