@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.
- package/README.md +249 -279
- package/agents/code-reviewer.md +1 -1
- package/dist/cli/editors.json +20 -0
- package/dist/platform/registry.js +1 -0
- package/dist/platform/validate.js +2 -1
- package/i18n/agents/code-reviewer.md +1 -1
- package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
- package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
- package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/package.json +2 -1
- package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -14
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
- package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- 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
- package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
- package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
- package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
- package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
- package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
- package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
- package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
- package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
- package/skills/a2h-page-specgen/SKILL.md +36 -5
- package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
- package/skills/a2h-page-specgen/references/evidence.md +2 -1
- package/skills/a2h-page-specgen/references/execution-model.md +13 -5
- package/skills/a2h-page-specgen/references/gates.md +33 -7
- package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
- package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
- package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
- package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
- package/skills/a2h-resource-convert/SKILL.md +1 -1
- package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
- package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
- package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
- package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
- package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
- package/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
- package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
- package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
- package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
- package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
- package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
- package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
- package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
- package/skills/a2h-utg-static/SKILL.md +3 -3
- package/skills/a2h-utg-static/references/extractors.md +7 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
- package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
|
@@ -137,7 +137,7 @@ Read `REFERENCE_VIEW_TREES` and build a structured understanding: root layout, t
|
|
|
137
137
|
|
|
138
138
|
If `view_scroll_n.xml` (n=1,2,...) exists: the Android UI was too long and was captured by scrolling; read them in order 1→n and merge all `view_scroll_n.xml` **with `view.xml` as the root** into a merged structure. In full mode these frames come from the explorer's whole-page scroll capture, and `meta.json.scroll_completeness` states how far the evidence covers: `complete` means it was proven to reach the bottom; any other value (`truncated`/`aborted`/`no-container`/`not-swept`, etc.) means there is uncaptured content after the last frame, which must be completed from the static layout and noted in the report. `view_loaded.xml` (present only when `view.xml` is a scroll origin captured before the data arrived or under FLAG_SECURE) is a capture of the same state with the data loaded; it is not part of the scroll sequence and must not be merged as scrolling. Take the page data from it.
|
|
139
139
|
|
|
140
|
-
**Frames captured before loading do not represent the page's appearance**: when `meta.json.content_loading` is present, the views listed in `views[]` were captured before the data came back; their text is the default value of the layout's `android:text` (e.g. `
|
|
140
|
+
**Frames captured before loading do not represent the page's appearance**: when `meta.json.content_loading` is present, the views listed in `views[]` were captured before the data came back; their text is the default value of the layout's `android:text` (e.g. `Total %1$d`, `%s items`, a placeholder name), not what the page actually displays. `texts` gives the unformatted placeholders detected. The page's appearance (text, values, icons, number of list rows) follows the frames in `loaded_views[]`; `primary: true` means `view.xml` / `screenshot.png` itself is a pre-load frame. When `loaded_views` is empty, derive the data state from the source's binding code (`setText(getString(id, args))`, adapter) and note "capture has only pre-load frames" in the report. These placeholder strings **must not** be written into ArkTS display text or default values, and the ViewModel **must not** skip data binding on the grounds that "the screenshot shows the default value". Layout geometry is unaffected; the bounds of pre-load frames can be used as usual.
|
|
141
141
|
|
|
142
142
|
**Nodes covered by an upper layer do not belong to this page**: in single-Activity apps a new Fragment is often stacked on top of an old one, and the old Fragment's nodes remain in the view tree with `visible-to-user="true"`. Regions in `measure_pack.json` carrying `occludedBy` are exactly such nodes (the "occluded" line in the summary names the upper node covering them): they are invisible in the screenshot, must not be converted as this page's structure, and their sizes or colors must not be cited; this page's structure is the subtree of the upper node `occludedBy` points to. `clickable_elements` in `meta.json` marks such widgets `occluded: true` by the same criterion (the count is in `clickable_occluded`), and they likewise do not belong to this page. The criterion does not know whether the upper layer is transparent, so it only marks, never deletes: if it contradicts the screenshot (the element is clearly visible), the screenshot wins.
|
|
143
143
|
|
|
@@ -173,13 +173,14 @@ Criterion (mechanical): when the conclusion text contains words like "built in /
|
|
|
173
173
|
**Architecture**:
|
|
174
174
|
- MVVM: page/component uses the viewmodel, the viewmodel uses the model
|
|
175
175
|
- Before converting, scan `{harmony_project_dir}` for reusable components/VMs/Models; extract shared components such as the toolbar into components for reuse; merge and reuse related models/viewmodels instead of creating a new one per page
|
|
176
|
+
- When the source shows a whole page Composable scaled down with `graphicsLayer { scaleX/scaleY }` (city cards, a background-edit preview), reuse the converted page and apply `.scale()`; do not write a simplified look-alike component (see the "Whole-page thumbnail" row of the atomic mapping table)
|
|
176
177
|
- **Choose decorators by the paradigm decided in Phase 2.0 and keep to the same set throughout; never mix**:
|
|
177
178
|
- **V1**: `@Component` components; component state `@State`, parent-child `@Prop` (one-way) / `@Link` (two-way), cross-level `@Provide`/`@Consume`; ViewModel/Model classes use `@Observed` + `@Track` on properties; side-effect watching `@Watch`
|
|
178
179
|
- **V2**: `@ComponentV2` components; component state `@Local`, parent-to-child input `@Param` (+ optional `@Once`), child-to-parent `@Event` (with `!!` two-way binding), cross-level `@Provider`/`@Consumer`; ViewModel/Model classes use `@ObservedV2` + `@Trace` on properties; watching `@Monitor`, computed properties `@Computed`
|
|
179
180
|
|
|
180
181
|
**Resources**: every resource referenced by the HarmonyOS UI (images/strings/colors/dimensions, etc.) must be explored and used by semantic match against the resources already converted in the HarmonyOS project.
|
|
181
182
|
|
|
182
|
-
**String resource values, color arithmetic, icon source tiers L1–L3, ShapeDrawable, Visible Resource Closure** → `cards/resources.md`.
|
|
183
|
+
**String resource values, color arithmetic, image source classification (data-bound vs asset) and icon source tiers L1–L3, ShapeDrawable, Visible Resource Closure** → `cards/resources.md`.
|
|
183
184
|
|
|
184
185
|
**Layout**: look up the layout mapping ref.
|
|
185
186
|
|
|
@@ -194,7 +195,7 @@ Criterion (mechanical): when the conclusion text contains words like "built in /
|
|
|
194
195
|
- `bounds` differences are only for computing region ratios and verifying relative layout, never used directly as vp; intrinsic dp/sp sizes follow Android XML/dimens
|
|
195
196
|
- Resources use `$r('app.color.xxx')` / `$r('app.string.xxx')` / `$r('app.media.xxx')`
|
|
196
197
|
|
|
197
|
-
**When several call sites become one `@Builder` / component, merge only what every call site has**: compare the arguments of each similar Android call (e.g. two cards whose title rows are both `AppListItem(leadingContent = TitleWithLine(...))`) before deciding the builder's shape. Only content every call site passes may be hard-coded in the builder; content only some call sites have (a `trailingContent`, icon, arrow or badge present in one place) becomes a parameter (an optional `@Builder` slot or a boolean), and each call site passes its own Android argument. The test: for each call site, ask "expanded here, does every node the builder adds or drops exist at this Android call".
|
|
198
|
+
**When several call sites become one `@Builder` / component, merge only what every call site has**: compare the arguments of each similar Android call (e.g. two cards whose title rows are both `AppListItem(leadingContent = TitleWithLine(...))`) before deciding the builder's shape. Only content every call site passes may be hard-coded in the builder; content only some call sites have (a `trailingContent`, icon, arrow or badge present in one place) becomes a parameter (an optional `@Builder` slot or a boolean), and each call site passes its own Android argument. The test: for each call site, ask "expanded here, does every node the builder adds or drops exist at this Android call". One app's two similar card groups: one group's title rows carry an icon the other group's lack; merged into one `TitleRow` with the icon hard-coded, the icon-less group's titles gained an extra icon. A source-only page has no screenshot to compare against, so only this per-call-site comparison catches it. In Phase 5 visible-resource closure, list for every builder with several call sites "call site → `file:line` of the matching Android call → optional parts present / absent there".
|
|
198
199
|
|
|
199
200
|
**Routing**: implement the routing relations between the UI and components.
|
|
200
201
|
|
|
@@ -209,6 +210,8 @@ Criterion (mechanical): when the conclusion text contains words like "built in /
|
|
|
209
210
|
Projects without a `Shell hosts` section are not subject to this exception; follow the rules above.
|
|
210
211
|
- State switches (dialog/menu/toggle) → managed with `@State`
|
|
211
212
|
- **Prefer the real implementation**: before mocking, search `{harmony_project_dir}` for whether the target page/component .ets exists; if it does, wire the real `router.pushUrl()`; **only when the target is not yet implemented** mock it + `console.info('TODO: ...')`
|
|
213
|
+
- **Never disable an entry silently**: when the Android handler is not empty but its target is not in the conversion set, keep the node clickable, do not write `.hitTestBehavior(HitTestMode.None)` (GATE `click-handler-untestable`), write `// UNWIRED: <Android handler file:line> — <reason>` in the handler (a comment-only handler is GATE `empty-click-handler`; with this marker it is downgraded to CAND `unwired-handler`), and list each one under `UNWIRED entries` in the report. An empty `onClick` that absorbs taps on purpose (a popup card area that keeps the scrim from dismissing) gets `// CLICK-SINK: <basis>`.
|
|
214
|
+
- **Overlay host effects**: when `SOURCE_PACK` has an "Overlay host effects" section, opening / dismissing the overlay does more than switch the overlay's own visibility flag: implement each effect in the code that opens / dismisses it (from its `resolved` statements, e.g. `contentOpacity = 0` fading the cards out) and write `// EFFECT: <id>` on the implementing statement or up to 3 lines above it; an effect that must not be ported gets `// EFFECT-OMIT: <id> — <basis>`.
|
|
212
215
|
- **Mocks must not reference unreachable addresses**: images/icons in mocks must not use made-up URLs (e.g. `https://mock.weather.icon/…`, `example.com`); they are bound to fail to load and render as blank cells, unlike the reference. Use a semantically equivalent resource already converted in the project (`$r('app.media.…')`); if there is none, register `degraded` and leave an empty placeholder; list remote icons delivered by operations in the report as "takes effect once the data layer is wired up".
|
|
213
216
|
- **Mock data must reproduce the visible state of the reference screenshot**: mock/placeholder data is not a free value. The **values, count, start/end and order** of every visible item in the reference screenshot must be faithfully reproduced by the mock (while the real data layer is not converted, the mock should be **reverse-engineered** from the reference screenshot). If the visible state the implementation produces differs from the reference, you **must not** pass it on the grounds that "this is mock data and it will heal itself once real data is wired up" — first prove the rule layer is correct, then discuss the data source. A rule-layer error (selection rule, sequence start, item count) is just as wrong with real data.
|
|
214
217
|
|
|
@@ -247,10 +250,6 @@ Two tiers:
|
|
|
247
250
|
**Tier A — the report must spell out the full derivation** (5 items):
|
|
248
251
|
`Window Mode Evidence`, `Transition Implementation Evidence`, `Duplicate Decoration Check`, `Visible Resource Closure`, `Position Anchor Evidence`.
|
|
249
252
|
|
|
250
|
-
The miss pattern of these 5 items is always "two individually correct rules combining into an error" (`fill="none"` and `.fillColor()` being duals,
|
|
251
|
-
view-tree parts versus the atomic component's built-in decorations, ① misjudged from a screenshot + ④ confirmed by "consistent with the baseline"…).
|
|
252
|
-
Such errors **can only be self-detected by laying the reasoning chain out in writing**; compressing it into a one-sentence conclusion is bound to let them through.
|
|
253
|
-
|
|
254
253
|
**Tier B — the report gives only "conclusion + `file:line` pointer"** (all other items):
|
|
255
254
|
the derivation is left as a structured comment in the corresponding `.ets`, in a fixed format:
|
|
256
255
|
|
|
@@ -272,11 +271,6 @@ What gets compressed is repetition and narration, **not evidence** — every nee
|
|
|
272
271
|
- `Reference Input Evidence` needs just one line listing paths; the other items do not restate which files were read.
|
|
273
272
|
- **The full derivation of Tier A items is written only in the report**; if an anchor is wanted in the `.ets`, leave just one line ≤ 200 characters: `EVIDENCE(<name>): <conclusion> —— derivation in report`. Writing the full derivation in both places violates the previous rule.
|
|
274
273
|
|
|
275
|
-
Without constraints, EVIDENCE comments take up a considerable share of the characters in the generated `.ets`, and every character is generated token by token.
|
|
276
|
-
|
|
277
|
-
The by-product is worth more than the time saved: a uniform marker turns the parent's review from "reading prose" into "running grep" —
|
|
278
|
-
`grep -rn "EVIDENCE(" <ets dir>` lists every evidence location for item-by-item comparison.
|
|
279
|
-
|
|
280
274
|
**Report Structure and Size.** The report is also generated token by token, and its size is mostly spent on the Tier B item-by-item index, round logs and narration. The report contains only the following sections, in this order, and the heading `## REPORT <GID>` appears only once:
|
|
281
275
|
|
|
282
276
|
| Section | Write | Do not write |
|
|
@@ -289,6 +283,7 @@ The by-product is worth more than the time saved: a uniform marker turns the par
|
|
|
289
283
|
| CANDIDATES | One line per item: source and conclusion | Restating the phase5_check output |
|
|
290
284
|
| Uncalibrated Items / degraded | Residuals of source-only and transitional states, one line each | |
|
|
291
285
|
| registry_requests / shell requests | The JSON structure from Step 5.3 rule 7 | |
|
|
286
|
+
| UNWIRED entries | One line per `// UNWIRED:` marker: the `.ets` file:line, the Android handler file:line, the missing target (page / overlay). The parent carries them verbatim into Step 7's Manual Follow-up TODOs as upstream UTG gaps | Omit the section when there are none; never report them as done |
|
|
292
287
|
| Rounds | One line per round: `Round N: blocking <n>, changed <files or 0>` | A running log of findings and changes per round |
|
|
293
288
|
|
|
294
289
|
The Tier A derivation chain skips no step: what is compressed is the form of expression and repetition, not the reasoning.
|
|
@@ -307,7 +302,7 @@ List every layout/component/resource reference in the converted HarmonyOS UI and
|
|
|
307
302
|
- **Compute every state branch, not only the captured frame**: for each source branch that makes this region taller (rows added after a selection, an expanded state, an error hint, a block shown only `if (x != null)`), add its extra height from the state-branch list and compute again. A fixed bottom block (button row, input bar) must stay on screen in every branch: the scrolling region takes `layoutWeight(1)` (or `flexShrink(1)`) under a parent with a height bound, and the fixed block comes after it. Proving "it fits" with one frame's numbers (e.g. `759 < 783.6`) while the source has a taller branch fails this item.
|
|
308
303
|
- **A size computed from the window stays computed from the window**: a bound Android derives from `LocalWindowInfo` / `LocalConfiguration.screenHeightDp` / `displayMetrics` (e.g. `heightIn(max = screen height − 380dp)`) reads the runtime window size on HarmonyOS, or becomes the flexible layout above. It is never the constant worked out on the capture device (`914.29 − 380 = 534`), which is right only on that screen. GATE `window-size-frozen-constant`.
|
|
309
304
|
- For text that is **single-line** `wrap_content` in the reference view tree (height ≈ one line of text), find its available width on the HarmonyOS side (parent width − width taken by same-row siblings − padding) and estimate from the font size that the text fits; if it does not fit while it fits on Android, the structure has spread siblings into the same row (the "two-dimensional constraints" row of the ConstraintLayout rewrite table in `cards/geometry.md`) — change the structure; do not mask it by shrinking the font or truncating with `maxLines(1)`.
|
|
310
|
-
- **Interaction Reachability Evidence**: for each clickable element, list its **z-order** in the parent `Stack`/layered structure and confirm that **no** sibling after it covers its visible rectangle. **Also** list every container on this page with `width('100%')` and `height('100%')` (or equivalent fill) and label each as interactive or as having declared `hitTestBehavior(HitTestMode.None)`. "No visual overlap" and "hits not blocked" are two different things: a transparent or bottom-pinned container does not count as covering in a visual check, yet it can swallow every click beneath it. The typical sign of missing this item is an element that looks normal but does nothing at all when tapped (not even console output), because the event is consumed by an upper node that has no `onClick` of its own. Whether a filling layer swallows taps is decided by the checker from the layer structure: a `stack-swallows-taps` / `fullsize-container` GATE closes only by fixing the code or by a `// HIT-TEST:` marker the checker verifies, not by the evidence written here; this item only annotates the remaining CANDs one by one.
|
|
305
|
+
- **Interaction Reachability Evidence**: for each clickable element, list its **z-order** in the parent `Stack`/layered structure and confirm that **no** sibling after it covers its visible rectangle. **Also** list every container on this page with `width('100%')` and `height('100%')` (or equivalent fill) and label each as interactive or as having declared `hitTestBehavior(HitTestMode.None)`. "No visual overlap" and "hits not blocked" are two different things: a transparent or bottom-pinned container does not count as covering in a visual check, yet it can swallow every click beneath it. The typical sign of missing this item is an element that looks normal but does nothing at all when tapped (not even console output), because the event is consumed by an upper node that has no `onClick` of its own. Whether a filling layer swallows taps is decided by the checker from the layer structure: a `stack-swallows-taps` / `fullsize-container` GATE closes only by fixing the code or by a `// HIT-TEST:` marker the checker verifies, not by the evidence written here; this item only annotates the remaining CANDs one by one. **Also** (mechanical gate, click handlers and overlay effects): a handler on a node with a constant `HitTestMode.None` (`click-handler-untestable`) and an empty or comment-only handler (`empty-click-handler`; `// CLICK-SINK:` / `// UNWIRED:` see Phase 4) are decided by the static check; every host effect of this group's overlay edges (`SOURCE_PACK` "Overlay host effects") needs a `// EFFECT: <id>` attached to its implementing statement or a `// EFFECT-OMIT: <id> — <basis>` with a basis, decided by the `[effects]` section of `phase5_check`; `overlay-effect-uncovered` / `effect-marker-detached` block, and EVIDENCE text cannot close them.
|
|
311
306
|
|
|
312
307
|
- **Missing Observation Decorators** (per the paradigm branch decided in Phase 2.0):
|
|
313
308
|
List the read surface of build() item by item; criteria in `cards/state.md`, and additionally `cards/state-v1.md` for V1 projects.
|
|
@@ -317,7 +312,7 @@ List every layout/component/resource reference in the converted HarmonyOS UI and
|
|
|
317
312
|
Criteria (the horizontal axis of the two containers, looking at the parent container, `Scroll.align`, Compose `Box` child alignment) → `cards/alignment.md`.
|
|
318
313
|
- **Horizontal Inset Evidence**: "Text Alignment Evidence" only governs alignment direction (Start/Center/End), not **how much it is indented** — left-aligned but 72vp off on the left margin still passes. This item checks the left margin of every visible `Text`, one by one:
|
|
319
314
|
Criteria (matches the measurement, same group same indent, right edge likewise) → `cards/alignment.md`.
|
|
320
|
-
- **Icon Source Tier Evidence**:
|
|
315
|
+
- **Icon Source Tier Evidence**: first classify the source of every visible image (`cards/resources.md` "Classify the image source first"): a data-bound one (`AsyncImage(model = <expression>)`, a URL loaded by Coil / Glide / Picasso, an ImageView fed from a model field) is written `data-bound <Android file:line> → Image(<field>)`, and confirm `.objectFit` matches `contentScale`/`scaleType`, placeholder/error images are copied, `ohos.permission.INTERNET` is in `module.json5` or in `shell requests`, and the mock field is a non-empty representative URL with `// TODO(data-layer)`; **a data-bound image decided as L3, written as an empty `Row()`/placeholder with no `Image`, or given an empty mock URL, is a failure**. For the remaining asset icons, label which tier of Phase 4.3 each belongs to — L1 / L2 / L2.5 / L3; L2 must give the library and symbol name, L2.5 the original web path and (for Remote) the absolute URL, L3 the downgrade explanation. **An unregistered L3 is a failure; deciding L3 without first checking the two Hybrid-Shell sections is likewise a failure**. Also confirm one by one that none of the three forbidden downgrades was used (emoji/text glyphs, substituting a semantically mismatched drawable, hand-writing SVG from memory). **And** (mechanical gate, icon coverage): every key of `icon_inventory` needs `// ICON: <key>` (comma-separated for several; a note may follow the keys) on the `Image`/`SymbolGlyph` line that renders it or within 3 lines above. **Copy the key from measure_pack output** (the summary "icons" lines or `icon_inventory[].key`): the resource-id without the package when there is one (e.g. `search_mag_icon`), else the content-desc (when it is ASCII letters and digits only), else `node<idx>`, and `s<N>_node<idx>` for one seen only in scroll frame N (changes with the view tree, never derive it yourself); rows sharing an id (list items) merge into one key, visible when any row is. Besides ImageView/ImageButton the inventory holds 16–96dp, roughly square leaf nodes without text (Compose `Image`/`Icon`/`AsyncImage` appear in the view tree as a childless `android.view.View`), and it covers every `view_scroll_N.xml` scroll frame. When there is a real reason not to implement it, write `// ICON-OMIT: <key> — <basis>`, but the checker refuses it when the icon is measured with ink on a solid background. Judged by the `[icons]` section of `phase5_check --group`; `icon-uncovered` / `icon-omit-refused` / `icon-marker-detached` block, and EVIDENCE text cannot close them.
|
|
321
316
|
An icon the host or a shared component draws (a Fragment host's Toolbar back / overflow, the bottom navigation): put the `// ICON: <key>` marker on the Image line in that shared component; it covers every page group that uses it. Do not add a fake marker on an unrelated Image in this group.
|
|
322
317
|
- **Misused Resource References**: do the resource references match the Android UI; nonexistent resources must be looked up again for the right name; "no emoji or hard-coded icons of any kind are allowed".
|
|
323
318
|
SVG content sub-checks (clip-path, fill/stroke, viewBox, tint channel, bounding-box path, `?attr`, placeholder SVG, duplicate attributes) → `cards/resources.md`.
|
|
@@ -359,9 +354,6 @@ node <skill>/scripts/arkts_static_check.ts --ets <harmony_project_dir>/entry/src
|
|
|
359
354
|
|
|
360
355
|
### Common Mistranslations Cheat Sheet (undetectable at compile time; self-check each one)
|
|
361
356
|
|
|
362
|
-
The common trait of the defects below: **syntactically valid, compiles, zero warnings**, and the static reference checks all pass too —
|
|
363
|
-
they only surface when reading the code's semantics or running on a real device. Avoid them while generating code rather than patching afterwards.
|
|
364
|
-
|
|
365
357
|
Rows whose full derivation is written elsewhere keep just one sentence, pointing to the detailed location (after "→") and the mechanical backstop rule; when self-checking, go through the referenced check item.
|
|
366
358
|
|
|
367
359
|
Each entry has been merged by topic into the "Common Mistranslations" table at the end of the corresponding knowledge card (geometry, alignment, window, widgets, resources, Canvas, state, SDK). Compare card by card before generating code, and self-check card by card again before Phase 5 ends.
|
|
@@ -420,5 +412,6 @@ Applies to: (1) pages with `EVIDENCE_TIER == source-only`; (2) uncaptured (`unca
|
|
|
420
412
|
- Leave `// TODO:` comments for: business logic, ViewModel data binding, unconverted target Activities, mock data
|
|
421
413
|
- Responsive layout: prefer percentage widths + Flex; use fixed sizes sparingly
|
|
422
414
|
- Accessibility: `content-desc` → `.accessibilityText()` **+** `.accessibilityDescription()` (same value; `uitest` only exports the latter's `description` field, so an icon-only control that writes only the former has no readable label at runtime); meaningful `text` → the correct label; the selected state of segmented controls/tabs/chips → `.accessibilitySelected(<the same state that drives the visual selection>)`. An Image's `contentDescription` is **not** `.alt()` (that is a placeholder image). Check each GATE `a11y-content-desc-unobservable` against the Android view tree
|
|
415
|
+
- **Translate Java/Kotlin arithmetic by its numeric meaning, not character by character**: ArkTS has a single `number`, and `/` is always a floating-point division. When both Java/Kotlin operands are integers (`int`/`long`/`Int`/`Long` variables, the index of `for (int i …)` / `for (i in 0..n)`, `.size`, or integer literals), `a / b` truncates, and ArkTS must write `Math.trunc(a / b)`. As soon as one side is `float`/`double` or a literal like `.0f`, it is a floating-point division and can be copied as is. Also check against Java semantics: the sign of `%` with negative operands, integer overflow (`Integer.MAX_VALUE + 1`), `(int)` casts (= `Math.trunc`), and how `Math.round` treats `.5`. Cite the Android `file:line` in a comment on the line with the arithmetic, and GATE `java-int-division-not-truncated` compares against those lines. Measured: the Java `int dayIndex = i / 24 + 1` was copied as `(i / 24 + 1) + …`; the fraction of the day counted twice, the x coordinate ran backwards, and the curve looped at every day. **Keep constant sub-expressions in interpolation and opacity formulas as written; do not simplify them by hand**: in `(1 - (p - 0.9f) / (0.9f - 1.0f))` the denominator is -0.1, and simplifying it to `/ 0.1` drops the sign, so the element shows before the header collapses. Copy it as `(0.9 - 1.0)` with a trailing comment citing the Android `file:line`, then compute the values at p = 0 and p = 1 per `cards/dynamics.md` "End-point substitution".
|
|
423
416
|
- When nesting exceeds 5 levels, split the related UI into `@Component` subcomponents
|
|
424
417
|
- If any mapping file is missing/empty: continue with built-in knowledge and note it in the report
|
|
@@ -44,7 +44,6 @@ The best mechanical approximation of a semantic module is **the set of pages rea
|
|
|
44
44
|
A real UTG is essentially strongly connected (every page can get back to the home page), so the spread **must have stop rules**:
|
|
45
45
|
|
|
46
46
|
1. **High in-degree global pages (cross-cutting pages such as login / share / settings) are included by default**, as long as they are reached from a page inside the module through a trigger edge inside the module. Mark them `cross-cutting` when including them, and hand them to I4 for pruning.
|
|
47
|
-
> This rule is deliberately loose: when the user says "all pages of the short-video module", they usually expect the share panel that pops up from the player page to be included. Excluding it by default silently drops it, whereas including it costs the user only one line of confirmation to prune.
|
|
48
47
|
2. **Stop on hitting an anchor of another semantic domain.** Decide in reverse with the same signals as I1: if a page's label / strings / class name clearly belongs to another domain (e.g. "Settings"), it is not a member of this module, and **the spread does not continue from it**.
|
|
49
48
|
3. **Nodes whose `kind` is `dialog` / `sheet` / `menu` are included with their host** and do not consume hops — they are states of the host page, not independent pages.
|
|
50
49
|
4. **The hop limit defaults to 3** (seeds are hop 0). Nodes at the limit are listed by name only, not included.
|
|
@@ -119,7 +118,7 @@ Only the `screenshot.png` + `view.xml` + `meta.json` of the pages in `SCOPE` are
|
|
|
119
118
|
|
|
120
119
|
**The two lists on disk** (the conclusions of I3 / I4, written at I4's confirmation; every later plan rebuild uses them. Changing `scope.json` later changes `scope_id` and makes it a different run):
|
|
121
120
|
- `${harmony_project_dir}/.hometrans/incremental/scope.json`: with no "Supplement" member, write v1 as before: `{"scope": [<utg node ids in SCOPE whose action is "Convert" or "Re-migrate">]}`. **With any "Supplement" member, write v2**: write a draft first (one feature per member: Convert / Re-migrate → `{"type": "NEW", "page": <id>}`; Supplement → `{"type": "SUP", "page": <id>, "missing": <that page's page_gap.mjs JSON>}`), then produce the file with `node <skills_root>/a2h-app-migrate/scripts/scope_model.mjs write --from <draft> --out <scope.json>` (it derives `pages` and `scope_id`, so the three lanes agree). Members graded `exists` / `exists?` and skipped are not written. A supplemented page's missing list reaches its group's `supplement` through `build_conversion_set.mjs`, and the group pack has the converter add only those items.
|
|
122
|
-
- `${harmony_project_dir}/.hometrans/incremental/existing.json`: written in I3 by `list_existing.mjs --out`; `existing` lists the existing .ets files (relative to the ETS root, e.g. `"pages/MainPage.ets"`, `"viewmodel/MainViewModel.ets"`). `build_conversion_set.mjs` reads only `existing
|
|
121
|
+
- `${harmony_project_dir}/.hometrans/incremental/existing.json`: written in I3 by `list_existing.mjs --out`; `existing` lists the existing .ets files (relative to the ETS root, e.g. `"pages/MainPage.ets"`, `"viewmodel/MainViewModel.ets"`). `build_conversion_set.mjs` reads `files` first (each row names its `module`), so a write is compared only with files of its own module; without `files` it reads `existing` and takes those paths as UI-module files; given `--scope` without `--existing` it prints a `[WARN]`.
|
|
123
122
|
|
|
124
123
|
**Reuse existing snapshots first**: members that already exist under `ui_info_root`, pass the exact-path check of [step4-prepare.md](step4-prepare.md) Step 4.1, and whose `meta.json.static_node` is in `scope.json` do not need capturing again. When a new scope uses a new campaign, `export_ui_info.mjs` records in `export_manifest.json` `earlier` the pages exported by the previous campaign that were not captured again this time but whose directories still exist; `build_conversion_set.mjs --scope` still counts them as captured and does not create separate source-only directories. When every member has a snapshot, skip the capture below and go straight to "Build the plan".
|
|
125
124
|
|
|
@@ -136,12 +135,12 @@ Only the `screenshot.png` + `view.xml` + `meta.json` of the pages in `SCOPE` are
|
|
|
136
135
|
|
|
137
136
|
Everything else (config.json, reviewer sub-agents, the watchdog, running in the background with `detach.mjs`) is copied from Step 3.2.
|
|
138
137
|
|
|
139
|
-
**Build the plan** (after
|
|
138
|
+
**Build the plan** (after `run_cycle.mjs` prints `finished: true`, the same as full-mode Step 3.2 item 5, with two extra arguments):
|
|
140
139
|
```bash
|
|
141
140
|
node <this skill>/scripts/export_ui_info.mjs $C --static-ws $S --out <ui_info_root>
|
|
142
141
|
node <this skill>/scripts/build_conversion_set.mjs $S --ui-info <ui_info_root> \
|
|
143
142
|
--scope ${harmony_project_dir}/.hometrans/incremental/scope.json \
|
|
144
|
-
--existing ${harmony_project_dir}/.hometrans/incremental/existing.json
|
|
143
|
+
--existing ${harmony_project_dir}/.hometrans/incremental/existing.json
|
|
145
144
|
```
|
|
146
145
|
Without a device, or when the user chooses not to capture, run only the second command (no `export_ui_info`); every member is then source-only.
|
|
147
146
|
|
|
@@ -15,6 +15,51 @@ For each entry, `host_android` is the host Activity/Fragment class name and `hos
|
|
|
15
15
|
|
|
16
16
|
**Prerequisite**: `@ohos/lottie` is confirmed installed by the parent skill's Step 6 build-fix stage (the generated code may `import lottie, { AnimationItem } from '@ohos/lottie'` directly; you do not need to touch `oh-package.json5`).
|
|
17
17
|
|
|
18
|
+
**Standard skeleton (must follow this structure)**: two hard constraints.
|
|
19
|
+
|
|
20
|
+
1. **Pass the animation data through `animationData`, not `path`.** The parent skill places the JSON at `rawfile/lottie/<name>.json`. `@ohos/lottie`'s `path` only reads files under the module's `ets/` directory (README: "the path parameter only supports relative paths under entry/src/main/ets"), so `'lottie/<name>.json'` reads no data, only fires `data_failed`, and the animation is **blank**; neither the build nor the smoke test notices. Read rawfile JSON with `resourceManager.getRawFileContentSync`, decode it with `util.TextDecoder`, `JSON.parse` it and hand it to `animationData`.
|
|
21
|
+
2. **`loadAnimation` must be written inside the `Canvas(ctx).onReady(() => { … })` callback.** `@ohos/lottie` draws on the `Canvas`'s `CanvasRenderingContext2D`, and that context is only ready once the Canvas **has been laid out**. `aboutToAppear()` / `aboutToBuild()` run **before** `build()`, when the Canvas does not exist yet; calling `loadAnimation` there is blank as well.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import lottie, { AnimationItem } from '@ohos/lottie';
|
|
25
|
+
import { util } from '@kit.ArkTS';
|
|
26
|
+
|
|
27
|
+
@ComponentV2
|
|
28
|
+
struct XxxLottie {
|
|
29
|
+
private settings: RenderingContextSettings = new RenderingContextSettings(true);
|
|
30
|
+
private ctx: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings);
|
|
31
|
+
private item: AnimationItem | null = null;
|
|
32
|
+
|
|
33
|
+
/** Reads rawfile/lottie/<name>.json (a HAR's rawfile is merged into the host HAP, so the host context reads it). */
|
|
34
|
+
private loadJson(): object {
|
|
35
|
+
const bytes: Uint8Array = this.getUIContext().getHostContext()!.resourceManager
|
|
36
|
+
.getRawFileContentSync('lottie/<name>.json');
|
|
37
|
+
const text: string = new util.TextDecoder('utf-8', { ignoreBOM: true }).decodeToString(bytes);
|
|
38
|
+
return JSON.parse(text) as object;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
build() {
|
|
42
|
+
Canvas(this.ctx)
|
|
43
|
+
.width(W).height(H)
|
|
44
|
+
.onReady(() => { // ← load only once the context is ready, not in aboutToAppear
|
|
45
|
+
this.item = lottie.loadAnimation({
|
|
46
|
+
container: this.ctx, renderer: 'canvas',
|
|
47
|
+
loop: <lottie_loop>, autoplay: <lottie_autoPlay>,
|
|
48
|
+
animationData: this.loadJson(), // ← no path
|
|
49
|
+
name: '<page>_<name>' // name must be unique
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
.onDisAppear(() => { lottie.destroy('<page>_<name>'); this.item = null; })
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
aboutToDisappear(): void { lottie.destroy('<page>_<name>'); this.item = null; }
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
When the animation lives in an HSP module, read that module's own rawfile through `getHostContext()!.createModuleContext('<hsp module name>').resourceManager`.
|
|
60
|
+
|
|
61
|
+
GATE `lottie-load-before-canvas-ready`: a `loadAnimation` inside `aboutToAppear`/`aboutToBuild` is blocked.
|
|
62
|
+
GATE `lottie-path-not-ets`: a `loadAnimation` whose options set `path` to anything other than a file that exists under this module's `ets/` is blocked.
|
|
18
63
|
|
|
19
64
|
**Adapt the skeleton above to the Android host logic**:
|
|
20
65
|
|
|
@@ -24,7 +69,7 @@ For each entry, `host_android` is the host Activity/Fragment class name and `hos
|
|
|
24
69
|
|
|
25
70
|
- **Tap-triggered**: drop `autoplay`; call `this.animateItem?.goToAndPlay(0, true)` in `onClick`.
|
|
26
71
|
|
|
27
|
-
- **State-toggle icon** (Tab, play/pause): switch segments per state with `goToAndStop(frame, true)`; if Android uses multiple segments (minFrame/maxFrame), map them to `playSegments([[min, max]], true)`.
|
|
72
|
+
- **State-toggle icon** (Tab, play/pause): switch segments per state with `goToAndStop(frame, true)`; if Android uses multiple segments (minFrame/maxFrame), map them to `playSegments([[min, max]], true)`. Write `loop` from Android's play count: Compose `animateLottieCompositionAsState` defaults `iterations` to 1 (plays once and stops on the last frame), which is `loop: false`; only `iterations = LottieConstants.IterateForever` is `loop: true`.
|
|
28
73
|
|
|
29
74
|
- **Teardown**: Android's `cancelAnimation` in `onDestroyView` / `onDestroy` → in HarmonyOS, call `lottie.destroy(name)` in both `aboutToDisappear` and `Canvas.onDisAppear`, and set `animateItem` to `null` to avoid leaks.
|
|
30
75
|
|
|
@@ -36,7 +81,7 @@ For each entry, `host_android` is the host Activity/Fragment class name and `hos
|
|
|
36
81
|
|
|
37
82
|
#### 4.5.4 Checks (part of the Phase 5 consistency checks)
|
|
38
83
|
|
|
39
|
-
-
|
|
84
|
+
- Is the animation data passed through `animationData`, and does the `getRawFileContentSync` argument line up with a file that actually exists at `rawfile/lottie/<name>.json` (the parent skill has already moved the JSON into place; you only need to get the string right); `loadAnimation` should carry no `path` pointing into rawfile
|
|
40
85
|
- Are Android's `lottie_autoPlay` / `lottie_loop` / `contentMode` mapped 1:1
|
|
41
86
|
- Is the animation correctly `destroy`ed when the page disappears
|
|
42
87
|
- Are there naming conflicts (multiple animations on one page must have distinct `animateName`s)
|