Skip to content

feat(ddui): reactive forms, safe navigation and lifecycle cleanup - #10

Draft
XiaoYangx666 wants to merge 16 commits into
devfrom
feat/ddui-reactive-forms
Draft

XiaoYangx666 wants to merge 16 commits into
devfrom
feat/ddui-reactive-forms

Conversation

@XiaoYangx666

@XiaoYangx666 XiaoYangx666 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Add DDUI reactive CustomForm pages, lifecycle-owned subscriptions and mixed legacy/DDUI navigation.
  • Handle ClientClosed on nested DDUI pages as back navigation, while root close exits the stack.
  • Fix native Minecraft EventSignal unsubscription (subscribe may return the callback, not a cleanup function).
  • Guard stale async handler / beforeBuild and inactive contexts from mutating a newer or background form stack without storing a circular reference to the stack.
  • Prevent a late legacy show() resolution from clearing the current legacy form visibility marker.
  • Remove one-shot timeout cleanup entries immediately after they execute, avoiding retained callback closures on long-lived pages.

Verification

  • GitHub Actions passed on 70a11d136f4023c168930e6e0d256dcd3f352f6b: 10 test files / 219 tests passed (40 DDUI page tests + 6 WriteGuard tests); beta & stable TypeScript typechecking and both package builds passed.
  • CI run
  • Real Minecraft client/runtime memory behavior remains unverified; PR stays draft until in-game smoke testing.

XiaoYangx666 and others added 14 commits November 14, 2026 14:25
- 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.
@XiaoYangx666 XiaoYangx666 changed the title feat(ddui): reactive forms and native event lifecycle fixes feat(ddui): reactive forms, safe navigation and lifecycle cleanup Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant