Repository navigation
feat(ddui): reactive forms, safe navigation and lifecycle cleanup - #10
Draft
XiaoYangx666 wants to merge 16 commits into
Draft
XiaoYangx666 wants to merge 16 commits into
XiaoYangx666 wants to merge 16 commits into
Conversation
- DDUI.page / DDUI.open:页面级 scope 托管订阅、定时器与 retain,支持 computed 派生状态 - 与传统表单共用同一个表单栈,导航用 push/back/replace/reopen/reset/close - 表单栈用代际令牌丢弃过期的异步展示,跳转立即释放旧页面 - 页面上下文不再持有表单栈,消除 stack[] ↔ context 引用环导致的关闭残留 - 顶层关闭时重置表单栈;UserBusy 不再自动重试;默认 0 tick 调度 - 补充 tutorial/ddui.md、skill 参考与 DDUI 回归测试
A closed page left SAPIProFormContext.args pointing at its page arguments, so a pending or recently settled show() reaction could keep the piano runtime and block alive. Clear args/_dduiSession/_form (and player when no further navigation is queued) once the context has left the form stack; queued parent contexts keep their args so push/back/reopen still rebuild correctly. Button handlers now keep onClick in a scope-owned holder that is emptied on dispose, and release() drops the owner wrapper.
ESC / the client close button resolves show() with ClientClosed. Previously every closed DDUI page finished and reset the whole form stack, so a subpage "close" exited the entire UI instead of returning to its parent. Now a ClientClosed page with stack depth > 1 pops one level and lets the form manager rebuild the previous page; only the root page closes everything. Programmatic navigation (ServerClosed) is unchanged.
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.
Changes
ClientClosedon nested DDUI pages as back navigation, while root close exits the stack.subscribemay return the callback, not a cleanup function).handler/beforeBuildand inactive contexts from mutating a newer or background form stack without storing a circular reference to the stack.show()resolution from clearing the current legacy form visibility marker.Verification
70a11d136f4023c168930e6e0d256dcd3f352f6b: 10 test files / 219 tests passed (40 DDUI page tests + 6 WriteGuard tests); beta & stable TypeScript typechecking and both package builds passed.