@buaa_smat/hometrans 26.0.5 → 26.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +249 -279
  2. package/agents/code-reviewer.md +1 -1
  3. package/dist/cli/editors.json +20 -0
  4. package/dist/platform/registry.js +1 -0
  5. package/dist/platform/validate.js +2 -1
  6. package/i18n/agents/code-reviewer.md +1 -1
  7. package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  8. package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  9. package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  10. package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  11. package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  12. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  13. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  14. package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  15. package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  16. package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  17. package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  18. package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
  19. package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
  20. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
  21. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  22. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  23. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
  24. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  25. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  26. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  27. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  28. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
  29. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  30. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  31. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  32. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  33. package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
  34. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  35. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  36. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  37. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  42. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  43. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  44. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  45. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  46. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  53. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  54. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  55. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  56. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  57. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  58. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  59. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  60. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  61. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  79. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  81. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  82. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  83. package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
  84. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
  85. package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
  86. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  87. package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
  88. package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
  89. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
  90. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  91. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  92. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
  93. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  94. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  95. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
  96. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
  97. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  98. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
  99. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  100. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
  101. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
  102. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
  103. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
  104. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
  105. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
  106. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  107. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  108. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
  109. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
  110. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
  111. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
  112. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
  113. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  114. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  116. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  117. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  118. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
  120. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
  122. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  123. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
  124. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
  126. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  127. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
  128. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  129. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  131. package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
  132. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  133. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  134. package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  135. package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  136. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
  137. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  138. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  139. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  140. package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  141. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  142. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
  143. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  144. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  145. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  146. package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
  147. package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
  148. package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
  149. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
  150. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  151. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  152. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  153. package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  154. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  155. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
  156. package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
  157. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  158. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  159. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  160. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  161. package/package.json +2 -1
  162. package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  163. package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  164. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
  165. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
  166. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
  167. package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
  168. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
  169. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  170. package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  171. package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  172. package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
  173. package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
  174. package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
  175. package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
  176. package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
  177. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  178. package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
  179. package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
  180. package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
  181. package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
  182. package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
  183. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  184. package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  185. package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  186. package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  187. package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  188. package/skills/a2h-app-migrate/SKILL.md +31 -14
  189. package/skills/a2h-app-migrate/references/stage-map.md +4 -2
  190. package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
  191. package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
  192. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
  193. package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
  194. package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
  195. package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
  196. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  197. package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
  198. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
  199. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  200. package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
  201. package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
  202. package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
  203. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
  204. package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  205. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  206. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  207. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
  208. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  209. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
  210. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
  211. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  212. package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  213. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  214. package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  215. package/skills/a2h-batch-ui-align/SKILL.md +14 -12
  216. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  217. package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  218. package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  219. package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  220. package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  221. package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  222. package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  223. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  224. package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  225. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  226. package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  227. package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  228. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  229. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  230. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  231. package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
  232. package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  233. package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  234. package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  235. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  236. package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
  237. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  238. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
  239. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
  240. package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
  241. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  242. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  243. package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
  244. package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
  245. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  246. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  247. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
  248. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  249. package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  250. package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  251. package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  252. package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  253. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  254. package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  255. package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  256. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  257. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  258. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  259. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  260. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  261. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  262. package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  263. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  264. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  265. package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  266. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  267. package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  268. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
  269. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
  270. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
  271. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
  272. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
  273. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  274. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  275. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
  276. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
  277. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
  278. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
  279. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  280. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
  281. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
  282. package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
  283. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
  284. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
  285. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
  286. package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
  287. package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
  288. package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
  289. package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  290. package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
  291. package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
  292. package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
  293. package/skills/a2h-page-specgen/SKILL.md +36 -5
  294. package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
  295. package/skills/a2h-page-specgen/references/evidence.md +2 -1
  296. package/skills/a2h-page-specgen/references/execution-model.md +13 -5
  297. package/skills/a2h-page-specgen/references/gates.md +33 -7
  298. package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  299. package/skills/a2h-page-specgen/references/spec-example.md +166 -32
  300. package/skills/a2h-page-specgen/references/spec-template.md +8 -5
  301. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
  302. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  303. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  304. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
  305. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  306. package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
  307. package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  308. package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
  309. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
  310. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  311. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
  312. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
  313. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  314. package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
  315. package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
  316. package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
  317. package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
  318. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
  319. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
  320. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
  321. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
  322. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
  323. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  324. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  325. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
  326. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
  327. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
  328. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
  329. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
  330. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  331. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  332. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  333. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  334. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  335. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  336. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
  337. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  338. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
  339. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  340. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
  341. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  342. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
  343. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
  344. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  345. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
  346. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  347. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  348. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
  349. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  350. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
  351. package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
  352. package/skills/a2h-resource-convert/SKILL.md +1 -1
  353. package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
  354. package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
  355. package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
  356. package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
  357. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  358. package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
  359. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  360. package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  361. package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  362. package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
  363. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  364. package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
  365. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
  366. package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  367. package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  368. package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  369. package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  370. package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
  371. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
  372. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  373. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
  374. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  375. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  376. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
  377. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
  378. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
  379. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
  380. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
  381. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
  382. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
  383. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
  384. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
  385. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
  386. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
  387. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
  388. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
  389. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
  390. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
  391. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
  392. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
  393. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
  394. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  395. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  396. package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
  397. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
  398. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
  399. package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
  400. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  401. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
  402. package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
  403. package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
  404. package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
  405. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
  406. package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
  407. package/skills/a2h-spec-generate/references/input-formats.md +1 -1
  408. package/skills/a2h-utg-explorer/SKILL.md +11 -5
  409. package/skills/a2h-utg-explorer/references/architecture.md +37 -19
  410. package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
  411. package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
  412. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
  413. package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
  414. package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  415. package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
  416. package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
  417. package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
  418. package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
  419. package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
  420. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  421. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
  422. package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
  423. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
  424. package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
  425. package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
  426. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
  427. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
  428. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
  429. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
  430. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  431. package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  432. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
  433. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
  434. package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
  435. package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
  436. package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
  437. package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
  438. package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
  439. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
  440. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
  441. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
  442. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
  443. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
  444. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
  445. package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
  446. package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
  447. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
  448. package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
  449. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  450. package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
  451. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
  452. package/skills/a2h-utg-static/SKILL.md +3 -3
  453. package/skills/a2h-utg-static/references/extractors.md +7 -0
  454. package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  455. package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  456. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
  457. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  458. package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
  459. package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
  460. package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
  461. package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
  462. package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  463. package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
  464. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  465. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
  466. package/resource/convert_pipeline_process.svg +0 -114
  467. package/resource/project_architecture.svg +0 -120
  468. package/resource/set_environment.png +0 -0
  469. package/resource/set_multimodel.png +0 -0
  470. package/skills/a2h-app-migrate/references/specs.example.json +0 -19
  471. package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  472. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
@@ -67,6 +67,186 @@ test('pct-width-with-hmargin', () => {
67
67
  .margin({ top: 16 })`) } });
68
68
  });
69
69
 
70
+ // measured: Scroll (spacer + cards) under a header overlay driven by the scroll progress, header root paints nothing
71
+ const header = (rootAttrs) => `import { Header } from '../components/Header';
72
+ @Entry
73
+ @ComponentV2
74
+ struct P {
75
+ @Local progress: number = 0;
76
+ private scroller: Scroller = new Scroller();
77
+ build() {
78
+ Stack({ alignContent: Alignment.TopStart }) {
79
+ Scroll(this.scroller) { Column() { Column().width('100%').height(346); Text('cards') } }
80
+ .onDidScroll(() => { this.progress = Math.min(1, this.scroller.currentOffset().yOffset / 228); })
81
+ Header({ progress: this.progress })
82
+ }
83
+ }
84
+ }
85
+ `;
86
+ const headerComp = (rootAttrs) => `@ComponentV2
87
+ export struct Header {
88
+ @Param progress: number = 0;
89
+ build() {
90
+ Stack() { Text('0°').fontSize(112 - 55 * this.progress) }
91
+ .width('100%')
92
+ .height(346 - 228 * this.progress)${rootAttrs}
93
+ }
94
+ }
95
+ `;
96
+
97
+ test('scroll-driven-overlay-see-through', () => {
98
+ fires('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': header(), 'components/Header.ets': headerComp('\n .hitTestBehavior(HitTestMode.Transparent)') } });
99
+ // the header root paints its own layer: opaque, no hit
100
+ silent('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': header(), 'components/Header.ets': headerComp("\n .backgroundColor('#E2D3FA')") } });
101
+ // a built-in overlay driven by the scroll and painting nothing fires too; with a background it does not
102
+ const inline = (attrs) => page(` Stack() {
103
+ Scroll(this.scroller) { Column() { Text('cards') } }
104
+ .onDidScroll(() => { this.offset = this.scroller.currentOffset().yOffset; })
105
+ Row() { Text('title') }
106
+ .width('100%')
107
+ .height(Math.max(56, 200 - this.offset))${attrs}
108
+ }`, '@ComponentV2', ' @Local offset: number = 0;\n private scroller: Scroller = new Scroller();');
109
+ fires('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': inline('') } });
110
+ silent('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': inline("\n .backgroundColor(Color.White)") } });
111
+ // an overlay that does not read the scroll state (a fixed FAB layer) is not a collapsing header
112
+ silent('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': page(` Stack() {
113
+ Scroll(this.scroller) { Column() { Text('cards') } }
114
+ .onDidScroll(() => { this.offset = this.scroller.currentOffset().yOffset; })
115
+ Row() { Text('fab') }.width(56).height(56)
116
+ }`, '@ComponentV2', ' @Local offset: number = 0;\n private scroller: Scroller = new Scroller();') } });
117
+ // the marker states why Android lets the content show through
118
+ silent('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': inline('').replace(' Row() { Text', ' // SEE-THROUGH-OK: fragment_x.xml:12 transparent toolbar over content\n Row() { Text') } });
119
+ // the header root Stack draws its backdrop as a full-width first child (header image): opaque, no hit
120
+ const imageBackdrop = headerComp('').replace("Stack() { Text('0°')", "Stack() { Image($r('app.media.header_bg')).width('100%').height('100%'); Text('0°')");
121
+ silent('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': header(), 'components/Header.ets': imageBackdrop } });
122
+ // a small first child (an icon) is no backdrop: still fires
123
+ const iconFirst = headerComp('').replace("Stack() { Text('0°')", "Stack() { Image($r('app.media.ic_back')).width(24).height(24); Text('0°')");
124
+ fires('scroll-driven-overlay-see-through', { ets: { 'pages/P.ets': header(), 'components/Header.ets': iconFirst } });
125
+ });
126
+
127
+ // measured in a chart component — Java `int / int` copied as an ArkTS float division
128
+ const JAVA_CHART = `class F {
129
+ void build(List<Float> temps) {
130
+ for (int i = 0; i <= temps.size(); i += 6) {
131
+ int dayIndex = i / 24 + 1;
132
+ float hourFraction = (i % 24) / 24.0f;
133
+ float x = dayIndex + hourFraction - 0.5f;
134
+ }
135
+ }
136
+ }
137
+ `;
138
+ const chartEts = (expr) => page(` Column() {}`, '@ComponentV2', ` /** x per TodayWeatherFragment.java:4-6 */
139
+ private xs(size: number): number[] {
140
+ const out: number[] = [];
141
+ for (let i = 0; i <= size; i += 6) {
142
+ out.push(${expr});
143
+ }
144
+ return out;
145
+ }`);
146
+
147
+ test('java-int-division-not-truncated', () => {
148
+ const android = { 'app/src/main/java/a/TodayWeatherFragment.java': JAVA_CHART };
149
+ fires('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('(i / 24 + 1) + (i % 24) / 24 - 0.5') }, android });
150
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('(Math.trunc(i / 24) + 1) + (i % 24) / 24 - 0.5') }, android });
151
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('Math.floor((i / 24)) + 1') }, android });
152
+ // `(i % 24) / 24.0f` is a float division in Java: the same text in ArkTS is right
153
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('(i % 24) / 24') }, android });
154
+ // without the citation the rule does not guess which Java line was ported
155
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('i / 24 + 1').replace('TodayWeatherFragment.java:4-6', 'the fragment') }, android });
156
+ // Kotlin: `for (i in 0..n step 6)` makes i an Int
157
+ const kt = { 'app/src/main/java/a/TodayWeatherFragment.kt': 'fun b(n: Int) {\n for (i in 0..n step 6) {\n val day = i / 24 + 1\n }\n}\n' };
158
+ fires('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('i / 24 + 1').replace('.java:4-6', '.kt:2-3') }, android: kt });
159
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('i / 24 + 1').replace(' out.push', ' // INT-DIV-OK: i is fractional here\n out.push') }, android });
160
+ // `1.5f * i / 24` is `(1.5f * i) / 24` in Java: a float division, not `i / 24`
161
+ const floatFirst = { 'app/src/main/java/a/TodayWeatherFragment.java': 'class F {\n void b(int i) {\n float x = 1.5f * i / 24;\n }\n}\n' };
162
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('1.5 * i / 24').replace('.java:4-6', '.java:2-3') }, android: floatFirst });
163
+ // Kotlin `val alpha = 1 - p` starts with an integer literal but is no Int
164
+ const ktFloat = { 'app/src/main/java/a/TodayWeatherFragment.kt': 'fun b(p: Float) {\n val alpha = 1 - p\n val y = alpha / 2\n}\n' };
165
+ silent('java-int-division-not-truncated', { ets: { 'pages/P.ets': chartEts('alpha / 2').replace('.java:4-6', '.kt:2-3') }, android: ktFloat });
166
+ });
167
+
168
+ test('lottie-load-before-canvas-ready', () => {
169
+ const comp = (where) => `@ComponentV2
170
+ struct L {
171
+ private ctx: CanvasRenderingContext2D = new CanvasRenderingContext2D(new RenderingContextSettings(true));
172
+ ${where === 'appear' ? 'aboutToAppear(): void { lottie.loadAnimation({ container: this.ctx, path: \'lottie/a.json\' }); }' : ''}
173
+ build() {
174
+ Canvas(this.ctx)
175
+ .width(30).height(30)
176
+ ${where === 'ready' ? '.onReady(() => { lottie.loadAnimation({ container: this.ctx, path: \'lottie/a.json\' }); })' : ''}
177
+ }
178
+ }
179
+ `;
180
+ fires('lottie-load-before-canvas-ready', { ets: { 'pages/L.ets': comp('appear') } });
181
+ silent('lottie-load-before-canvas-ready', { ets: { 'pages/L.ets': comp('ready') } });
182
+ });
183
+
184
+ test('collapsing-toolbar-not-nested-scroll', () => {
185
+ const comp = (fontExpr) => `@ComponentV2
186
+ struct T {
187
+ @Local collapse: number = 0;
188
+ private scroller: Scroller = new Scroller();
189
+ build() {
190
+ Column() {
191
+ Text('title').fontSize(${fontExpr})
192
+ Scroll(this.scroller) {
193
+ Column() { Text('body') }
194
+ }
195
+ .onDidScroll(() => { this.collapse = this.scroller.currentOffset().yOffset / 48; })
196
+ }
197
+ }
198
+ }
199
+ `;
200
+ fires('collapsing-toolbar-not-nested-scroll', { ets: { 'pages/T.ets': comp('30 - 14 * this.collapse') } });
201
+ silent('collapsing-toolbar-not-nested-scroll', { ets: { 'pages/T.ets': comp('16') } });
202
+ });
203
+
204
+ test('border-object-resets-radius', () => {
205
+ fires('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
206
+ .borderRadius(24)
207
+ .border({ width: 1, color: Color.Gray })`) } });
208
+ // radius inside the border object, or border before borderRadius, or radius 0: all fine.
209
+ silent('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
210
+ .borderRadius(24)
211
+ .border({ width: 1, color: Color.Gray, radius: 24 })`) } });
212
+ silent('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
213
+ .border({ width: 1, color: Color.Gray })
214
+ .borderRadius(24)`) } });
215
+ });
216
+
217
+ test('pct-size-in-hugging-or-scroll-parent', () => {
218
+ // Family 1 (GATE): width '100%' inside a horizontal Scroll with nothing definite between.
219
+ fires('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': page(` Scroll() {
220
+ Row() {
221
+ Column() { Text('a') }
222
+ .width('100%')
223
+ }
224
+ }
225
+ .scrollable(ScrollDirection.Horizontal)`) } });
226
+ // Silent: a vertical Scroll constrains the child width to the viewport.
227
+ silent('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': page(` Scroll() {
228
+ Row() {
229
+ Column() { Text('a') }
230
+ .width('100%')
231
+ }
232
+ }`) } });
233
+ // Family 2 (CAND): a childless '100%' background layer inside a width-less Stack.
234
+ fires('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': page(` Stack() {
235
+ Column()
236
+ .width('100%')
237
+ .backgroundColor('#11223344')
238
+ Text('a')
239
+ }`) } });
240
+ // Silent: the Stack has a definite width, so its childless layer does not drive it.
241
+ silent('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': page(` Stack() {
242
+ Column()
243
+ .width('100%')
244
+ .backgroundColor('#11223344')
245
+ Text('a')
246
+ }
247
+ .width(100)`) } });
248
+ });
249
+
70
250
  test('fullsize-container', () => {
71
251
  // A conditional overlay over a button: GATE until it opts out of hit testing or is marked.
72
252
  const overlay = (extra) => page(` Stack() {
@@ -236,6 +416,16 @@ test('fillcolor-on-full-viewport-path', () => {
236
416
  // A stroked full-size rect is a visible border, not a bounding box
237
417
  silent('fillcolor-on-full-viewport-path', { ets: { 'pages/P.ets': usesIcon },
238
418
  media: { icon: SVG('<rect fill="none" stroke="#000" stroke-width="2" width="24" height="24"/>') } });
419
+ // measured on a converted CheckCircleOutline: the doubled guard box, and the H0V0z / comma / l spellings
420
+ for (const d of ['M0 0h24v24H0V0zm0 0h24v24H0V0z', 'M0 0h24v24H0V0z', 'M0,0H24V24H0Z', 'M0 0l24 0 0 24 -24 0z', 'm0 0h24v24h-24z']) {
421
+ fires('fillcolor-on-full-viewport-path', { ets: { 'pages/P.ets': usesIcon },
422
+ media: { icon: SVG(`<path d="${d}" fill="none"/><path d="M16.59 7.58L10 14.17z"/>`) } });
423
+ }
424
+ // fill="none" paths that are not the whole viewBox: a guard box plus a real shape, a smaller box, a curve
425
+ for (const d of ['M0 0h24v24H0zM4 4h2v2H4z', 'M0 0h20v20H0z', 'M0 0h24v24H0c0 0 0 0 0 0z']) {
426
+ silent('fillcolor-on-full-viewport-path', { ets: { 'pages/P.ets': usesIcon },
427
+ media: { icon: SVG(`<path d="${d}" fill="none"/>`) } });
428
+ }
239
429
  });
240
430
 
241
431
  test('fillcolor-on-full-viewport-path: <rect> hit points at the converter, not at res/drawable', () => {
@@ -246,6 +436,9 @@ test('fillcolor-on-full-viewport-path: <rect> hit points at the converter, not a
246
436
  const pathOut = run({ ets: { 'pages/P.ets': usesIcon },
247
437
  media: { icon: SVG('<path d="M0 0h24v24H0z" fill="none"/><path d="M4 4L20 20Z" fill="#000"/>') } });
248
438
  assert.match(pathOut, /res\/drawable/);
439
+ // a converted Compose icon can carry the path too: the message names the converter and says to delete it
440
+ assert.match(pathOut, /code_vector_icons\.ts/);
441
+ assert.match(pathOut, /delete this element/);
249
442
  });
250
443
 
251
444
  test('string-quote-leak', () => {
@@ -267,3 +460,223 @@ test('every registered rule is named in some test file', () => {
267
460
  .map((f) => fs.readFileSync(path.join(HERE, f), 'utf8')).join('\n');
268
461
  assert.deepEqual(RULES.map((r) => r.id).filter((id) => !text.includes(`'${id}'`)), []);
269
462
  });
463
+
464
+ /** Hits of one rule inside the [GATE] section only (the section runs until the next `[...]` header). */
465
+ const gateHits = (out, rule) => {
466
+ const sec = /^\[GATE\][^\n]*\n([\s\S]*?)(?=^\[|$(?![\s\S]))/m.exec(out);
467
+ return sec === null ? [] : hits(sec[1], rule);
468
+ };
469
+
470
+ test('pct-size-in-hugging-or-scroll-parent: 100% only, paging exempt, WIDTH-FILL downgrades', () => {
471
+ const list = (attrs, w = '100%', mark = '') => page(` List() {
472
+ ListItem() {${mark}
473
+ Column() { Text('a') }
474
+ .width('${w}')
475
+ }
476
+ }
477
+ .listDirection(Axis.Horizontal)${attrs}`);
478
+ assert.ok(gateHits(run({ ets: { 'pages/P.ets': list('') } }), 'pct-size-in-hugging-or-scroll-parent').length > 0);
479
+ // A fraction below 100% is a deliberate viewport share (two cards per screen).
480
+ silent('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': list('', '50%') } });
481
+ // A paging / snapping carousel wants one item per viewport.
482
+ silent('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': list('\n .scrollSnapAlign(ScrollSnapAlign.START)') } });
483
+ // The marker downgrades the GATE to CAND (still listed, no longer blocking).
484
+ const out = run({ ets: { 'pages/P.ets': list('', '100%', '\n // WIDTH-FILL: one tab per screen by design') } });
485
+ assert.ok(hits(out, 'pct-size-in-hugging-or-scroll-parent').length > 0);
486
+ assert.deepEqual(gateHits(out, 'pct-size-in-hugging-or-scroll-parent'), []);
487
+ });
488
+
489
+ test('border-object-resets-radius: borderRadius restated after border is fine', () => {
490
+ silent('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
491
+ .borderRadius(24)
492
+ .border({ width: 1, color: Color.Gray })
493
+ .borderRadius(24)`) } });
494
+ });
495
+
496
+ test('stack-swallows-taps single-axis: centered title over a back-button row', () => {
497
+ const bar = (rowExtra = '', titleExtra = '', title = `Text('Title').width('100%')`) => page(` Stack() {
498
+ Row() {
499
+ Image($r('app.media.a')).width(24).height(24).onClick(() => {})
500
+ }
501
+ .width('100%').height(56)${rowExtra}
502
+ ${title}${titleExtra}
503
+ }
504
+ .width('100%').height(56)`);
505
+ assert.ok(gateHits(run({ ets: { 'pages/P.ets': bar() } }), 'stack-swallows-taps').length > 0);
506
+ silent('stack-swallows-taps', { ets: { 'pages/P.ets': bar('', '.hitTestBehavior(HitTestMode.None)') } });
507
+ // zIndex reorders the layers: not provable, so not a GATE.
508
+ silent('stack-swallows-taps', { ets: { 'pages/P.ets': bar('.zIndex(2)') } });
509
+ // A layer whose own subtree takes input covers rather than swallows: not a GATE.
510
+ silent('stack-swallows-taps', { ets: { 'pages/P.ets': bar('', '', `Row() {
511
+ Blank()
512
+ Button('Save').onClick(() => {})
513
+ }
514
+ .width('100%')`) } });
515
+ });
516
+
517
+ test('lottie-load-before-canvas-ready: async aboutToAppear is caught too', () => {
518
+ fires('lottie-load-before-canvas-ready', { ets: { 'pages/L.ets': `@ComponentV2
519
+ struct L {
520
+ private ctx: CanvasRenderingContext2D = new CanvasRenderingContext2D(new RenderingContextSettings(true));
521
+ async aboutToAppear(): Promise<void> { lottie.loadAnimation({ container: this.ctx, path: 'lottie/a.json' }); }
522
+ build() {
523
+ Canvas(this.ctx).width(30).height(30)
524
+ }
525
+ }
526
+ ` } });
527
+ });
528
+
529
+ test('collapsing-toolbar-not-nested-scroll: only scroll-offset callbacks, only Text, per struct', () => {
530
+ // A pagination flag set in onReachEnd is not a scroll offset.
531
+ silent('collapsing-toolbar-not-nested-scroll', { ets: { 'pages/T.ets': `@ComponentV2
532
+ struct Feed {
533
+ @Local loading: boolean = false;
534
+ build() {
535
+ Column() {
536
+ Text('more').fontSize(this.loading ? 12 : 14)
537
+ List() {}
538
+ .onReachEnd(() => { this.loading = true; })
539
+ }
540
+ }
541
+ }
542
+ ` } });
543
+ // A scroll-driven .scale() on an Image is a zoom effect, not a collapsing title.
544
+ silent('collapsing-toolbar-not-nested-scroll', { ets: { 'pages/U.ets': `@ComponentV2
545
+ struct Hero {
546
+ @Local zoom: number = 1;
547
+ private scroller: Scroller = new Scroller();
548
+ build() {
549
+ Stack() {
550
+ Image($r('app.media.a')).scale({ x: this.zoom, y: this.zoom })
551
+ Scroll(this.scroller) { Column() {} }
552
+ .onDidScroll(() => { this.zoom = 1 + this.scroller.currentOffset().yOffset / 500; })
553
+ }
554
+ }
555
+ }
556
+ ` } });
557
+ // A same-named field in another struct of the file is a different field.
558
+ silent('collapsing-toolbar-not-nested-scroll', { ets: { 'pages/V.ets': `@ComponentV2
559
+ struct A1 {
560
+ @Local collapse: number = 0;
561
+ private scroller: Scroller = new Scroller();
562
+ build() {
563
+ Scroll(this.scroller) { Column() {} }
564
+ .onDidScroll(() => { this.collapse = 1; })
565
+ }
566
+ }
567
+ @ComponentV2
568
+ struct A2 {
569
+ @Param collapse: number = 0;
570
+ build() {
571
+ Text('x').fontSize(16 + this.collapse)
572
+ }
573
+ }
574
+ ` } });
575
+ });
576
+
577
+ test('stack-child-align-noop: .size() counts as the axis size', () => {
578
+ const stack = (size) => page(` Stack({ alignContent: Alignment.TopStart }) {
579
+ Text('a')
580
+ Column() { Text('bar') }
581
+ .size(${size})
582
+ .align(Alignment.Bottom)
583
+ }
584
+ .width('100%').height('100%')`);
585
+ // Full height through .size(): the child fills the axis and .align() arranges its content.
586
+ silent('stack-child-align-noop', { ets: { 'pages/P.ets': stack("{ width: '100%', height: '100%' }") } });
587
+ // .size() without a height still wraps on that axis.
588
+ fires('stack-child-align-noop', { ets: { 'pages/P.ets': stack("{ width: '100%' }") } });
589
+ });
590
+
591
+ const candHits = (out, rule) => {
592
+ const sec = out.split(/^\[CANDIDATES\]/m)[1] ?? '';
593
+ return hits(sec, rule);
594
+ };
595
+
596
+ test('pct-size-in-hugging-or-scroll-parent: a Stack that writes its own width is not hugging', () => {
597
+ silent('pct-size-in-hugging-or-scroll-parent', { ets: { 'pages/P.ets': page(` Column() {
598
+ Stack() {
599
+ Column() {}.width('100%').height('100%').backgroundColor(Color.Red)
600
+ Text('hello')
601
+ }.width('100%').height(48)
602
+ }`) } });
603
+ // '1100%' is not '100%': it never enters the horizontal-scroll family.
604
+ assert.deepEqual(gateHits(run({ ets: { 'pages/P.ets': page(` Scroll() {
605
+ Row() { Text('a') }.width('1100%')
606
+ }.scrollable(ScrollDirection.Horizontal)`) } }), 'pct-size-in-hugging-or-scroll-parent'), []);
607
+ });
608
+
609
+ test('lottie-load-before-canvas-ready: a load deferred in a closure / callback is only CAND', () => {
610
+ const comp = (appear) => `@ComponentV2
611
+ struct L {
612
+ private ctx: CanvasRenderingContext2D = new CanvasRenderingContext2D(new RenderingContextSettings(true));
613
+ private load?: () => void;
614
+ aboutToAppear(): void { ${appear} }
615
+ build() {
616
+ Canvas(this.ctx).width(30).height(30).onReady(() => { this.load?.(); })
617
+ }
618
+ }
619
+ `;
620
+ for (const appear of [
621
+ "this.load = () => { lottie.loadAnimation({ container: this.ctx, path: 'lottie/a.json' }); };",
622
+ "this.load = () => lottie.loadAnimation({ container: this.ctx, path: 'lottie/a.json' });",
623
+ "setTimeout(() => { lottie.loadAnimation({ container: this.ctx, path: 'lottie/a.json' }); }, 0);",
624
+ ]) {
625
+ const out = run({ ets: { 'pages/L.ets': comp(appear) } });
626
+ assert.deepEqual(gateHits(out, 'lottie-load-before-canvas-ready'), [], appear);
627
+ assert.ok(candHits(out, 'lottie-load-before-canvas-ready').length > 0, appear);
628
+ }
629
+ // Inside a plain if block it still runs before build(): GATE.
630
+ assert.ok(gateHits(run({ ets: { 'pages/L.ets': comp("if (this.ctx) { lottie.loadAnimation({ container: this.ctx, path: 'lottie/a.json' }); }") } }),
631
+ 'lottie-load-before-canvas-ready').length > 0);
632
+ });
633
+
634
+ test('stack-child-align-noop: a custom component with no call-site size is only CAND', () => {
635
+ const out = run({ ets: { 'pages/P.ets': page(` Stack({ alignContent: Alignment.TopStart }) {
636
+ Text('top')
637
+ BottomBar().align(Alignment.Bottom)
638
+ }.width('100%').height('100%')`) + `
639
+ @ComponentV2
640
+ struct BottomBar { build() { Row() { Text('b') }.width('100%').height('100%') } }
641
+ ` } });
642
+ assert.deepEqual(gateHits(out, 'stack-child-align-noop'), []);
643
+ assert.ok(candHits(out, 'stack-child-align-noop').length > 0);
644
+ });
645
+
646
+ test('border-object-resets-radius: every .border() is judged in order', () => {
647
+ // The second .border() resets the radius restored in between.
648
+ fires('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
649
+ .border({ width: 1, color: Color.Gray, radius: 8 })
650
+ .borderRadius(24)
651
+ .border({ width: 1, color: Color.Gray })`) } });
652
+ // borderRadius($r(...)) with nested parens is read whole; restated after border it is fine.
653
+ silent('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
654
+ .borderRadius($r('app.float.r'))
655
+ .border({ width: 1, color: Color.Gray })
656
+ .borderRadius($r('app.float.r'))`) } });
657
+ fires('border-object-resets-radius', { ets: { 'pages/P.ets': page(` Column() { Text('a') }
658
+ .borderRadius($r('app.float.r'))
659
+ .border({ width: 1, color: Color.Gray })`) } });
660
+ });
661
+
662
+ test('collapsing-toolbar-not-nested-scroll: a ternary call site is not taken for the method body', () => {
663
+ const out = run({ ets: { 'pages/T.ets': `@ComponentV2
664
+ struct T {
665
+ @Local collapse: number = 0;
666
+ @Local other: number = 0;
667
+ private scroller: Scroller = new Scroller();
668
+ onChange(): void { this.collapse = this.scroller.currentOffset().yOffset / 48; }
669
+ build() {
670
+ Column() {
671
+ Text('title').fontSize(30 - 14 * this.collapse)
672
+ Text('x').fontSize(this.other > 0 ? this.onChange() : 0)
673
+ Scroll(this.scroller) { Column() { Text('body') } }
674
+ .onDidScroll(() => { this.onChange(); })
675
+ }
676
+ }
677
+ }
678
+ ` } });
679
+ const lines = candHits(out, 'collapsing-toolbar-not-nested-scroll');
680
+ assert.deepEqual(lines, ['pages/T.ets:9']);
681
+ assert.match(out, /scroll-offset field \(collapse\)/);
682
+ });
@@ -344,3 +344,162 @@ struct Orders {
344
344
  `;
345
345
  assert.deepEqual(hits(run({ 'pages/Orders.ets': src }), 'swiper-index-unbound'), ['pages/Orders.ets:11']);
346
346
  });
347
+
348
+ // ---------------------------------------------------------------- relative-container-anchor-cycle
349
+
350
+ // ds-1125-weather MainPage.ets:198 (bc17d89) MetricCard: icon centers on the text column vertically, the column sits
351
+ // right of the icon horizontally -> the container draws no children (empty pink capsule, children: []).
352
+ const METRIC_CARD = (iconCenter, cornerExtra = '') => `@Entry
353
+ @ComponentV2
354
+ struct MainPage {
355
+ @Builder
356
+ MetricCard(title: string) {
357
+ RelativeContainer() {
358
+ Image($r('app.media.icon'))
359
+ .width(28)
360
+ .height(28)
361
+ .id('metricIcon')
362
+ .alignRules({
363
+ left: { anchor: '__container__', align: HorizontalAlign.Start },
364
+ ${iconCenter}
365
+ })
366
+ Column() {
367
+ Text(title)
368
+ Text('12 km/h')
369
+ }
370
+ .id('metricCol')
371
+ .alignRules({ left: { anchor: 'metricIcon', align: HorizontalAlign.End } })
372
+ Row() {
373
+ Text('+1')
374
+ }
375
+ .id('metricCorner')
376
+ .alignRules({
377
+ right: { anchor: '__container__', align: HorizontalAlign.End },
378
+ bottom: { anchor: 'metricCol', align: VerticalAlign.Bottom }${cornerExtra}
379
+ })
380
+ }
381
+ .height('auto')
382
+ .layoutWeight(1)
383
+ }
384
+ build() {
385
+ Row() {
386
+ this.MetricCard('Wind')
387
+ }
388
+ }
389
+ }
390
+ `;
391
+ const CENTER_ON_COL = " center: { anchor: 'metricCol', align: VerticalAlign.Center }";
392
+
393
+ test('cross_axis_mutual_sibling_anchors_are_gate', () => {
394
+ assert.deepEqual(hits(run({ 'pages/MainPage.ets': METRIC_CARD(CENTER_ON_COL) }), 'relative-container-anchor-cycle'),
395
+ ['pages/MainPage.ets:6']);
396
+ });
397
+
398
+ test('longer_cycle_is_gate', () => {
399
+ // icon -> corner -> col -> icon
400
+ const src = METRIC_CARD(" center: { anchor: 'metricCorner', align: VerticalAlign.Center }");
401
+ assert.deepEqual(hits(run({ 'pages/MainPage.ets': src }), 'relative-container-anchor-cycle'), ['pages/MainPage.ets:6']);
402
+ });
403
+
404
+ test('one_way_sibling_anchors_are_clean', () => {
405
+ const src = METRIC_CARD(" top: { anchor: '__container__', align: VerticalAlign.Top }");
406
+ assert.deepEqual(hits(run({ 'pages/MainPage.ets': src }), 'relative-container-anchor-cycle'), []);
407
+ });
408
+
409
+ test('anchors_between_exclusive_branches_are_clean', () => {
410
+ const src = `@Entry
411
+ @ComponentV2
412
+ struct P {
413
+ @Local on: boolean = false;
414
+ build() {
415
+ RelativeContainer() {
416
+ if (this.on) {
417
+ Text('a').id('a').alignRules({ top: { anchor: 'b', align: VerticalAlign.Bottom } })
418
+ } else {
419
+ Text('b').id('b').alignRules({ top: { anchor: 'a', align: VerticalAlign.Bottom } })
420
+ }
421
+ }
422
+ }
423
+ }
424
+ `;
425
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), []);
426
+ });
427
+
428
+ const RC = (kids) => `@Entry
429
+ @ComponentV2
430
+ struct P {
431
+ build() {
432
+ RelativeContainer() {
433
+ ${kids}
434
+ }
435
+ .width('100%')
436
+ .height(60)
437
+ }
438
+ }
439
+ `;
440
+
441
+ // RelativeContainer doc: anchors must not form a dependency cycle, except for a chain.
442
+ test('horizontal_chain_is_clean', () => {
443
+ const src = RC(` Text('A').id('a')
444
+ .alignRules({
445
+ left: { anchor: '__container__', align: HorizontalAlign.Start },
446
+ right: { anchor: 'b', align: HorizontalAlign.Start }
447
+ })
448
+ .chainMode(Axis.Horizontal, ChainStyle.SPREAD)
449
+ Text('B').id('b')
450
+ .alignRules({
451
+ left: { anchor: 'a', align: HorizontalAlign.End },
452
+ right: { anchor: 'c', align: HorizontalAlign.Start }
453
+ })
454
+ Text('C').id('c')
455
+ .alignRules({
456
+ left: { anchor: 'b', align: HorizontalAlign.End },
457
+ right: { anchor: '__container__', align: HorizontalAlign.End }
458
+ })`);
459
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), []);
460
+ });
461
+
462
+ test('vertical_chain_is_clean', () => {
463
+ const src = RC(` Text('A').id('a')
464
+ .alignRules({
465
+ top: { anchor: '__container__', align: VerticalAlign.Top },
466
+ bottom: { anchor: 'b', align: VerticalAlign.Top }
467
+ })
468
+ .chainMode(Axis.Vertical, ChainStyle.PACKED)
469
+ Text('B').id('b')
470
+ .alignRules({
471
+ top: { anchor: 'a', align: VerticalAlign.Bottom },
472
+ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }
473
+ })`);
474
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), []);
475
+ });
476
+
477
+ test('chain_pair_plus_cross_axis_back_anchor_is_gate', () => {
478
+ // a <-> b is a chain link, but c centers on a while a's top anchors c: still a cycle
479
+ const src = RC(` Text('A').id('a')
480
+ .alignRules({
481
+ right: { anchor: 'b', align: HorizontalAlign.Start },
482
+ top: { anchor: 'c', align: VerticalAlign.Bottom }
483
+ })
484
+ .chainMode(Axis.Horizontal, ChainStyle.SPREAD)
485
+ Text('B').id('b')
486
+ .alignRules({ left: { anchor: 'a', align: HorizontalAlign.End } })
487
+ Text('C').id('c')
488
+ .alignRules({ center: { anchor: 'a', align: VerticalAlign.Center } })`);
489
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), ['pages/P.ets:5']);
490
+ });
491
+
492
+ test('mutual_anchor_on_same_edge_is_not_a_chain', () => {
493
+ // both right edges anchor each other's Start: not end-to-start both ways
494
+ const src = RC(` Text('A').id('a')
495
+ .alignRules({ right: { anchor: 'b', align: HorizontalAlign.Start } })
496
+ Text('B').id('b')
497
+ .alignRules({ right: { anchor: 'a', align: HorizontalAlign.Start } })`);
498
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), ['pages/P.ets:5']);
499
+ });
500
+
501
+ test('self_anchor_is_gate', () => {
502
+ const src = RC(` Text('A').id('a')
503
+ .alignRules({ top: { anchor: 'a', align: VerticalAlign.Bottom } })`);
504
+ assert.deepEqual(hits(run({ 'pages/P.ets': src }), 'relative-container-anchor-cycle'), ['pages/P.ets:5']);
505
+ });