已开启
ui: subscribe to animation ticks with OnStateChange #271
Konstantin Chukharev创建于 5 天前
ui: subscribe to animation ticks with OnStateChange #271
已开启
Konstantin Chukharev创建于 5 天前
Konstantin Chukharev
Konstantin Chukharev成员
5 天前

This PR moves the animation tick subscriptions in ShaderSurface and PageSwipe to direct OnStateChange calls.

Changes

  • ShaderSurface subscribes once with OnStateChange and keeps a remembered ShaderEffectRef, so a changed effect is visible to the listener.
  • PageSwipe subscribes once with OnStateChange and marks its stable node.
  • Both listeners guard node.disposed before touching the node.
  • Remove the useFramePump helper and its test. OnStateChange already owns the subscription; a @memo wrapper only adds a positional scope and a lambda.
  • Document the subscription contract in the second brain: Animation_System.md, State_Management.md, and Coding_Standards.md.
  • Fix two test assumptions exposed by the current toolchain: a2ui uses an unlisted font family, and llm reads the reader's extracted content instead of wrapping it again or parsing it as JSON.

Verification

  • arkui3 test --no-run in arktsx/framework/packages/test: build passed.
  • arkui3 test --no-build in arktsx/framework/packages/test: 335 tests passed.
  • npx kh2 test-arktsx.llm: passed.
  • npx kh2 check-vault: passed.
  • npx kh2 test:arkts is red in arktsx/http-server, arktsx/cdp, and arktsx/preso, all outside this change.

ShaderSurface and PageSwipe are compile-checked; this PR adds no golden render test.

likedislike
合并受阻
Konstantin ChukharevKonstantin Chukharev成员
5 天前 修改了pull request 的描述
Konstantin ChukharevKonstantin Chukharev成员
5 天前 推送  1 个提交:bb094173-test: cover the conditional frame pump
Konstantin ChukharevKonstantin Chukharev成员
5 天前 修改了pull request 的描述
Konstantin ChukharevKonstantin Chukharev成员
5 天前 推送  1 个提交:474b1b7c-ui: guard the frame pump against disposed nodes
Konstantin ChukharevKonstantin Chukharev成员
5 天前 修改了pull request 的描述
此处折叠了50条消息 查看更多
Konstantin ChukharevKonstantin Chukharev成员
1 天前 强制推送  28 个提交:c8b2b336-5 commits from branch rri_opensource/arkui3:master,81580563-ui: share the animation frame pump,b7068dfe-test: cover the conditional frame pump,e087c2cf-ui: guard the frame pump against disposed nodes,21799229-ui: check disposal before the pump predicate,d95a57c8-docs: show the node-targeted frame pump,4d696ffc-test: cover painted and disposed pump branches,8e10f886-test: skip the predicate for a disposed pump,3ba6e94c-test: keep frame pump probes in a test instance,8950cd47-ui: separate frame pump tick work from the paint predicate,227bbc40-test: require a second frame pump mark,f6cd94cd-test: cover disposed pump tick work,0f1b548f-ui: subscribe the frame pump through OnStateChange,2d8f12ca-test(a2ui): use an unlisted font family,4ab6ee7f-test(llm): read extracted reader content directly,cb9673e7-docs: link the shader surface note,3cd91e64-docs: require a stable frame pump clock,7d4c217e-docs: state the pump clock contract for both helpers,4e81657a-ui: keep only the frame pump the components use,c55e827b-ui: trim the frame pump to one remembered target,5e8cf653-ui: update the frame pump target on rebuild,fff2ec5b-test(llm): drop unused reader imports,75bdfda3-ui: subscribe directly with OnStateChange,aa5ed816-docs: place OnStateChange with the memo API
Konstantin ChukharevKonstantin Chukharev成员
1 天前 修改了pull request 的描述
Konstantin ChukharevKonstantin Chukharev成员
1 天前 推送  1 个提交:bf011446-docs: explain the shader effect ref
Konstantin ChukharevKonstantin Chukharev成员
1 天前 推送  1 个提交:441b4011-docs: name the changing shader effect caller
Konstantin ChukharevKonstantin Chukharev成员
1 天前 推送  1 个提交:18c3cba5-docs: name OnStateChange in PageSwipe