@buaa_smat/hometrans 26.0.3 → 26.0.4
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 +1 -1
- package/agents/code-reviewer.md +91 -21
- package/env-requirements.json +1 -1
- package/i18n/agents/code-reviewer.md +93 -21
- package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
- package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
- package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
- package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
- package/package.json +3 -6
- package/skills/a2h-app-migrate/SKILL.md +19 -11
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
- package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/skills/a2h-arch-generate/SKILL.md +20 -17
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
- package/skills/a2h-batch-ui-align/SKILL.md +72 -22
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
- package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
- package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-page-specgen/SKILL.md +124 -20
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/skills/a2h-page-specgen/references/evidence.md +35 -0
- package/skills/a2h-page-specgen/references/execution-model.md +135 -26
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
- package/skills/a2h-page-specgen/references/gates.md +120 -52
- package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +112 -109
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
- package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
- package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
- package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
- package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
- package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
- package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
- package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
- package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
- package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
- package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
- package/skills/a2h-spec-generate/SKILL.md +2 -2
- package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
- package/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
- package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
- package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
- package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// static_check/rules/lottie_host.ts — GATE lottie-host-not-integrated.
|
|
2
|
+
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { androidFiles } from '../core/android.ts';
|
|
5
|
+
import { report } from '../core/findings.ts';
|
|
6
|
+
import { markedAbove, stripComments } from '../core/parse.ts';
|
|
7
|
+
import type { FileScan } from '../core/scan.ts';
|
|
8
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
9
|
+
|
|
10
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
11
|
+
export const meta: RuleMeta[] = [
|
|
12
|
+
{
|
|
13
|
+
id: "lottie-host-not-integrated",
|
|
14
|
+
levels: ["GATE", "CAND"],
|
|
15
|
+
invariant: "resources",
|
|
16
|
+
card: "resources",
|
|
17
|
+
needs: ["--android"],
|
|
18
|
+
summary: "`.ets` 引用的 Android 源文件在播放 Lottie(`LottieAnimation` / `LottieAnimationView` / `rememberLottieComposition` / `lottie_rawRes` 等),而引用该源文件的 `.ets` 没有一个 import `@ohos/lottie`。",
|
|
19
|
+
fix: "按 `references/lottie-integration.md` 用 `@ohos/lottie` 加载 `rawfile/lottie/<name>.json`(依赖缺失时在 registry_requests 里申请 `@ohos/lottie`)。确实无法集成时,在引用该源文件的 `.ets` 里写 `// LOTTIE-DEGRADED: <缺哪个动画、现用什么占位、原因>` 降为 CAND,并在报告登记 L3 degraded。拿别的静态 drawable 顶替 Lottie 属于「语义不符的现有 drawable 顶替」,不是降级出口。",
|
|
20
|
+
escape: "// LOTTIE-DEGRADED:",
|
|
21
|
+
cases: [
|
|
22
|
+
"实测(CoolMall 底部导航,ds-1118):资源转换把 4 个 tab Lottie 的宿主记为 Unknown,未注入 LOTTIE_ENTRIES_FOR_THIS_PAGE;外壳组读到 BottomNavigationBar.kt 的 TabLottieAnimation,却按名字挑了 ic_shop/ic_menu/ic_cart/ic_my_fill 当「L1 静态帧」,四个图标形状全错;编译、GATE、评审全过。",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
/** Non-import Kotlin/Java code that plays a Lottie animation. */
|
|
28
|
+
const KT_LOTTIE: RegExp = /\b(LottieAnimation|LottieAnimationView|rememberLottieComposition|LottieCompositionFactory|LottieCompositionSpec)\b/;
|
|
29
|
+
/** Layout XML that hosts a Lottie view. */
|
|
30
|
+
const XML_LOTTIE: RegExp = /<com\.airbnb\.lottie\.LottieAnimationView\b|\blottie_(?:rawRes|fileName|url)\s*=/;
|
|
31
|
+
/** An Android source file named in an .ets (comments included: that is where conversions cite their source). */
|
|
32
|
+
const CITE: RegExp = /(?<![\w$.\/])([\w$]+\.(?:kt|java|xml))\b/g;
|
|
33
|
+
const IMPORTS_LOTTIE: RegExp = /\bfrom\s+['"]@ohos\/lottie['"]|\bimport\s+['"]@ohos\/lottie['"]/;
|
|
34
|
+
/** Files that render UI (a struct's build() or a @Builder); a ViewModel that cites the host is not where the icon is drawn. */
|
|
35
|
+
const RENDERS: RegExp = /\bbuild\s*\(\s*\)\s*\{|@Builder\b/;
|
|
36
|
+
|
|
37
|
+
/** Android files (by file name) whose code or layout plays a Lottie animation → the evidence line `rel:line`. */
|
|
38
|
+
function lottieHosts(androidDir: string): Map<string, string> {
|
|
39
|
+
const out: Map<string, string> = new Map();
|
|
40
|
+
for (const f of androidFiles(androidDir)) {
|
|
41
|
+
const isXml: boolean = f.name.endsWith('.xml');
|
|
42
|
+
const src: string = f.read();
|
|
43
|
+
if (!/lottie/i.test(src)) { continue; }
|
|
44
|
+
const lines: string[] = (isXml ? src : stripComments(src)).split('\n');
|
|
45
|
+
for (let i = 0; i < lines.length; i++) {
|
|
46
|
+
if (!isXml && /^\s*(import|package)\b/.test(lines[i])) { continue; }
|
|
47
|
+
if ((isXml ? XML_LOTTIE : KT_LOTTIE).test(lines[i])) {
|
|
48
|
+
if (!out.has(f.name)) { out.set(f.name, `${f.rel}:${i + 1}`); }
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Named imports of a file: `import { A, B as C } from 'spec'` → [{ names: [A, B], spec }]. */
|
|
57
|
+
function namedImports(code: string): { names: string[]; spec: string }[] {
|
|
58
|
+
const out: { names: string[]; spec: string }[] = [];
|
|
59
|
+
for (const m of code.matchAll(/\bimport\s*\{([^}]*)\}\s*from\s*['"]([^'"]+)['"]/g)) {
|
|
60
|
+
out.push({ names: m[1].split(',').map((x) => x.trim().split(/\s+as\s+/)[0]).filter(Boolean), spec: m[2] });
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether a file reaches @ohos/lottie: it imports it, or a local file it imports does, transitively. A relative
|
|
67
|
+
* import is resolved by path; a package import (an HAR / HSP module, `from 'components'`) by the scanned file that
|
|
68
|
+
* declares the imported struct, since package entry points are not followed. The animation is often wrapped in its
|
|
69
|
+
* own component (lottie-integration.md 4.5.3), and that component file cites no Android source.
|
|
70
|
+
*/
|
|
71
|
+
function lottieThroughImports(scans: FileScan[]): (s: FileScan) => boolean {
|
|
72
|
+
const byPath: Map<string, FileScan> = new Map(scans.map((s) => [path.resolve(s.abs), s]));
|
|
73
|
+
const byStruct: Map<string, FileScan[]> = new Map();
|
|
74
|
+
for (const s of scans) for (const n of s.declaredStructs) byStruct.set(n, [...(byStruct.get(n) ?? []), s]);
|
|
75
|
+
const memo: Map<FileScan, boolean> = new Map();
|
|
76
|
+
const visit = (s: FileScan, seen: Set<FileScan>): boolean => {
|
|
77
|
+
const known: boolean | undefined = memo.get(s);
|
|
78
|
+
if (known !== undefined) { return known; }
|
|
79
|
+
if (seen.has(s)) { return false; }
|
|
80
|
+
seen.add(s);
|
|
81
|
+
let hit: boolean = IMPORTS_LOTTIE.test(s.code);
|
|
82
|
+
for (const imp of hit ? [] : namedImports(s.code)) {
|
|
83
|
+
const targets: FileScan[] = [];
|
|
84
|
+
if (/^\.{1,2}\//.test(imp.spec)) {
|
|
85
|
+
const p: string = path.resolve(path.dirname(s.abs), imp.spec);
|
|
86
|
+
const t: FileScan | undefined = byPath.get(/\.ets$/.test(p) ? p : `${p}.ets`);
|
|
87
|
+
if (t !== undefined) { targets.push(t); }
|
|
88
|
+
} else {
|
|
89
|
+
for (const n of imp.names) { targets.push(...(byStruct.get(n) ?? [])); }
|
|
90
|
+
}
|
|
91
|
+
if (targets.some((t) => visit(t, seen))) { hit = true; break; }
|
|
92
|
+
}
|
|
93
|
+
memo.set(s, hit);
|
|
94
|
+
return hit;
|
|
95
|
+
};
|
|
96
|
+
return (s: FileScan): boolean => visit(s, new Set());
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* GATE lottie-host-not-integrated: an Android source that plays Lottie is cited by the .ets that convert it, and none of
|
|
101
|
+
* those .ets reaches @ohos/lottie, directly or through the local components it imports.
|
|
102
|
+
*
|
|
103
|
+
* Every citing file counts towards the pass (the bar may live in a component the page imports), so a page that only
|
|
104
|
+
* mentions the host in a comment ("this page does not draw the bottom bar") is not reported when the component that does
|
|
105
|
+
* draw it integrates Lottie. The finding is placed on the citing UI file that names the host most often.
|
|
106
|
+
* `// LOTTIE-DEGRADED: <reason>` in a citing file downgrades it to CAND.
|
|
107
|
+
*/
|
|
108
|
+
export function checkLottieHost(scans: FileScan[], androidDir: string): void {
|
|
109
|
+
const hosts: Map<string, string> = lottieHosts(androidDir);
|
|
110
|
+
if (hosts.size === 0) { return; }
|
|
111
|
+
const citing: Map<string, { scan: FileScan; count: number; line: number }[]> = new Map();
|
|
112
|
+
for (const s of scans) {
|
|
113
|
+
const counts: Map<string, { count: number; line: number }> = new Map();
|
|
114
|
+
const lines: string[] = s.src.split('\n');
|
|
115
|
+
for (let i = 0; i < lines.length; i++) {
|
|
116
|
+
for (const m of lines[i].matchAll(CITE)) {
|
|
117
|
+
if (!hosts.has(m[1])) { continue; }
|
|
118
|
+
const c = counts.get(m[1]) ?? { count: 0, line: i + 1 };
|
|
119
|
+
c.count++;
|
|
120
|
+
counts.set(m[1], c);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
for (const [name, c] of counts) {
|
|
124
|
+
citing.set(name, [...(citing.get(name) ?? []), { scan: s, ...c }]);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const integrates = lottieThroughImports(scans);
|
|
128
|
+
for (const [name, users] of citing) {
|
|
129
|
+
if (users.some((u) => integrates(u.scan))) { continue; }
|
|
130
|
+
const ui = users.filter((u) => RENDERS.test(u.scan.code)).sort((a, b) => b.count - a.count);
|
|
131
|
+
if (ui.length === 0) { continue; }
|
|
132
|
+
const at = ui[0];
|
|
133
|
+
const marked: boolean = users.some((u) => {
|
|
134
|
+
const ls: string[] = u.scan.src.split('\n');
|
|
135
|
+
return ls.some((_, i) => markedAbove(ls, i + 1, 'LOTTIE-DEGRADED', 0));
|
|
136
|
+
});
|
|
137
|
+
report(marked ? 'CAND' : 'GATE', 'lottie-host-not-integrated', at.scan.rel, at.line,
|
|
138
|
+
`${name} plays a Lottie animation (${hosts.get(name)}), and none of the ${users.length} .ets citing it imports @ohos/lottie` +
|
|
139
|
+
(users.length > 1 ? ` (${users.map((u) => u.scan.rel).join(', ')})` : '') +
|
|
140
|
+
'. Integrate it per references/lottie-integration.md (request @ohos/lottie in registry_requests if missing); ' +
|
|
141
|
+
'a static drawable picked to look similar is a forbidden substitution, not a downgrade. ' +
|
|
142
|
+
(marked ? 'Marked LOTTIE-DEGRADED: confirm the report registers it as L3 degraded.'
|
|
143
|
+
: 'If it truly cannot be integrated, write // LOTTIE-DEGRADED: <which animation, what placeholder, why> and register L3 degraded.'));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -42,7 +42,7 @@ export const meta: RuleMeta[] = [
|
|
|
42
42
|
invariant: "resources",
|
|
43
43
|
card: "resources",
|
|
44
44
|
needs: ["--resources"],
|
|
45
|
-
summary: "被引用的 media SVG 里有一条 fill=\"none\"
|
|
45
|
+
summary: "被引用的 media SVG 里有一条 fill=\"none\"、铺满 viewBox 的包围盒:d 恰为 viewBox 全矩形的 path,或 x/y 为 0、宽高等于 viewBox 的 rect。",
|
|
46
46
|
fix: "- 读 SVG/资源文件内容的几条(需要 `--resources`)对应「资源引用错用」的各子项:`fillcolor-on-stroke-svg`、`fillcolor-on-full-viewport-path`、`media-unresolved-theme-attr` / `media-placeholder-in-use`、`media-duplicate-attribute`。它们正是\"只跑 `ls media/` 确认名字存在\"漏掉的那一类。",
|
|
47
47
|
escape: null,
|
|
48
48
|
cases: [
|
|
@@ -313,6 +313,26 @@ export function isFullViewportRect(d: string, w: number, h: number): boolean {
|
|
|
313
313
|
return variants.some((v) => norm(v) === norm(s));
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
/**
|
|
317
|
+
* The same bounding box written as a `<rect>` (older Material web SVGs, e.g. read_more:
|
|
318
|
+
* `<g><rect fill="none" height="24" width="24"/></g>`). Matches only when x/y are absent or 0 and width/height
|
|
319
|
+
* equal the viewBox size exactly, and the rect has no visible stroke (a stroked full-size rect is a visible
|
|
320
|
+
* border, not a guard box); percentages or offsets are left alone (better a miss than a false positive).
|
|
321
|
+
*/
|
|
322
|
+
export function isFullViewportRectEl(el: string, w: number, h: number): boolean {
|
|
323
|
+
const num = (name: string): number | null => {
|
|
324
|
+
const m: RegExpMatchArray | null = el.match(new RegExp(`\\s${name}\\s*=\\s*"([^"]*)"`));
|
|
325
|
+
if (m === null) { return null; }
|
|
326
|
+
const v: string = m[1].trim();
|
|
327
|
+
return /^-?\d+(\.\d+)?(px)?$/.test(v) ? parseFloat(v) : NaN;
|
|
328
|
+
};
|
|
329
|
+
const x: number | null = num('x');
|
|
330
|
+
const y: number | null = num('y');
|
|
331
|
+
const stroke: RegExpMatchArray | null = el.match(/\sstroke\s*=\s*"([^"]*)"/);
|
|
332
|
+
if (stroke !== null && stroke[1].trim().toLowerCase() !== 'none') { return false; }
|
|
333
|
+
return num('width') === w && num('height') === h && (x === null || x === 0) && (y === null || y === 0);
|
|
334
|
+
}
|
|
335
|
+
|
|
316
336
|
export function checkFullViewportTint(scans: FileScan[], media: MediaIndex): void {
|
|
317
337
|
if (!media.any) { return; }
|
|
318
338
|
|
|
@@ -346,13 +366,20 @@ export function checkFullViewportTint(scans: FileScan[], media: MediaIndex): voi
|
|
|
346
366
|
}
|
|
347
367
|
if (!(w > 0 && h > 0)) { continue; }
|
|
348
368
|
|
|
349
|
-
|
|
369
|
+
// Both spellings of the bounding box: <path d="M0 0h24v24H0z" fill="none"/> and <rect fill="none" width="24" height="24"/>
|
|
370
|
+
const els: string[] = src.match(/<(?:path|rect)\b[^>]*>/g) || [];
|
|
350
371
|
for (const el of els) {
|
|
351
|
-
const fill: RegExpMatchArray | null = el.match(
|
|
372
|
+
const fill: RegExpMatchArray | null = el.match(/\sfill\s*=\s*"([^"]*)"/);
|
|
352
373
|
if (fill === null || fill[1].trim().toLowerCase() !== 'none') { continue; }
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
if (
|
|
374
|
+
let full: boolean;
|
|
375
|
+
const isRect: boolean = el.startsWith('<rect');
|
|
376
|
+
if (isRect) {
|
|
377
|
+
full = isFullViewportRectEl(el, w, h);
|
|
378
|
+
} else {
|
|
379
|
+
const dm: RegExpMatchArray | null = el.match(/\bd\s*=\s*"([^"]*)"/);
|
|
380
|
+
full = dm !== null && isFullViewportRect(dm[1], w, h);
|
|
381
|
+
}
|
|
382
|
+
if (full) {
|
|
356
383
|
reportedFvp.add(t.name);
|
|
357
384
|
const tintNote: string = tintedNames.has(t.name)
|
|
358
385
|
? `this file uses .fillColor() on it, and fillColor also paints this bounding box (fill="none" does not stop it), ` +
|
|
@@ -360,12 +387,19 @@ export function checkFullViewportTint(scans: FileScan[], media: MediaIndex): voi
|
|
|
360
387
|
: 'this file does not tint it directly, but as soon as anything tints it with .fillColor(), the whole icon becomes a solid block of color' +
|
|
361
388
|
' (note: when the resource is returned across methods, the tint may be applied in another @Builder)';
|
|
362
389
|
report('GATE', 'fillcolor-on-full-viewport-path', s.rel, t.line,
|
|
363
|
-
`the SVG of app.media.${t.name} contains a fill="none" path covering the whole viewBox (${w}x${h}) ` +
|
|
390
|
+
`the SVG of app.media.${t.name} contains a fill="none" path/rect covering the whole viewBox (${w}x${h}) ` +
|
|
364
391
|
`as a bounding box; ${tintNote}. ` +
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
392
|
+
(isRect
|
|
393
|
+
// The <rect> spelling comes from older upstream Material SVGs; code_vector_icons.ts used to keep it,
|
|
394
|
+
// so a hit is usually a converter leftover, and Compose icons have no res/drawable to go back to.
|
|
395
|
+
? 'Root cause: this <rect> is the guard box of older upstream Material SVGs; code_vector_icons.ts ' +
|
|
396
|
+
'before the <rect> fix did not strip it, so the file is most likely a converter leftover, not hand-written. ' +
|
|
397
|
+
'Fix: delete this <rect> (and the <g> it leaves empty) from the SVG, or re-run ' +
|
|
398
|
+
'a2h-resource-convert/scripts/code_vector_icons.ts for this icon; the rest of the file is fine'
|
|
399
|
+
: 'Root cause: this path is how Material **web SVGs** are written; an Android <vector> source never produces it — ' +
|
|
400
|
+
'the file was hand-written from memory instead of converted from the Android source. ' +
|
|
401
|
+
'Fix: convert it again from the <vector> in res/drawable; when there really is no matching drawable, ' +
|
|
402
|
+
`register it as${SP}${quoteWord('已降级')}${SP}per the Phase 4.3 icon source tiers; do not hand-write it`));
|
|
369
403
|
break;
|
|
370
404
|
}
|
|
371
405
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// static_check/rules/overlay_binds.ts — GATE multiple-overlay-binds-same-node.
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { chainHead, lineOfIndex, maskStrings } from '../core/parse.ts';
|
|
5
|
+
import type { FileCtx } from '../core/scan.ts';
|
|
6
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
7
|
+
|
|
8
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
9
|
+
export const meta: RuleMeta[] = [
|
|
10
|
+
{
|
|
11
|
+
id: "multiple-overlay-binds-same-node",
|
|
12
|
+
levels: ["GATE"],
|
|
13
|
+
invariant: "interaction",
|
|
14
|
+
card: "widgets",
|
|
15
|
+
needs: [],
|
|
16
|
+
summary: "同一个组件的属性链上挂了两个及以上 `.bindSheet(` / `.bindContentCover(`。",
|
|
17
|
+
fix: "一个节点只挂一个半模态/全模态:把每个弹层挂到它自己的触发节点上,或各包一层空容器(如 `Column()`)作宿主;弹层多或要叠加时改用 `UIContext.openBindSheet` / `updateBindSheet` / `closeBindSheet` 按内容句柄管理。Compose 每个 `ModalBottomSheet` 有独立的 state,对应到 ArkUI 是各自独立的宿主节点。",
|
|
18
|
+
escape: null,
|
|
19
|
+
cases: [
|
|
20
|
+
"实测(CoolMall 商品详情,glm53):页面组只在根 Stack 上挂了规格弹层,Step 5.5 接线按 shell request 把优惠券弹层 `.bindSheet` 链在同一节点后面;三个打开规格弹层的按钮点击后弹层一闪即关,编译、GATE、冒烟、评审全过。",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const OVERLAY: RegExp = /\.(bindSheet|bindContentCover)\s*\(/g;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* GATE multiple-overlay-binds-same-node: one component's attribute chain binds two or more sheets / content covers.
|
|
29
|
+
*
|
|
30
|
+
* Each bound overlay is owned by the node it is bound to, and a node keeps one modal lifecycle: when the second binding's
|
|
31
|
+
* state changes, the first panel is closed right after it opens ("the sheet flashes and disappears"). Purely lexical: the
|
|
32
|
+
* owner is the chain head (`Stack() {…}.bindSheet(a).bindSheet(b)` → Stack), found with comments and strings masked, so
|
|
33
|
+
* two separate statements never share an owner.
|
|
34
|
+
*/
|
|
35
|
+
export function checkMultipleOverlayBinds(fctx: FileCtx): void {
|
|
36
|
+
const masked: string = maskStrings(fctx.code);
|
|
37
|
+
const byOwner: Map<number, { owner: string; kind: string; index: number }[]> = new Map();
|
|
38
|
+
OVERLAY.lastIndex = 0;
|
|
39
|
+
let m: RegExpExecArray | null;
|
|
40
|
+
while ((m = OVERLAY.exec(masked)) !== null) {
|
|
41
|
+
const head = chainHead(masked, m.index);
|
|
42
|
+
if (head === null) { continue; }
|
|
43
|
+
const list = byOwner.get(head.start) ?? [];
|
|
44
|
+
list.push({ owner: head.name, kind: m[1], index: m.index });
|
|
45
|
+
byOwner.set(head.start, list);
|
|
46
|
+
}
|
|
47
|
+
for (const binds of byOwner.values()) {
|
|
48
|
+
if (binds.length < 2) { continue; }
|
|
49
|
+
const lines: number[] = binds.map((b) => lineOfIndex(fctx.code, b.index));
|
|
50
|
+
report('GATE', 'multiple-overlay-binds-same-node', fctx.rel, lines[1],
|
|
51
|
+
`${binds[0].owner}() binds ${binds.length} overlays on one chain (` +
|
|
52
|
+
binds.map((b, i) => `.${b.kind} line ${lines[i]}`).join(', ') + '): a node keeps one modal lifecycle, so opening one ' +
|
|
53
|
+
'closes the other right after it appears (the panel flashes and is gone). Bind each overlay on its own node — its trigger, ' +
|
|
54
|
+
'or a dedicated empty container — or manage them with UIContext.openBindSheet / closeBindSheet');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// static_check/rules/overlay_string.ts — GATE overlay-string-color.
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { lineOfIndex, matchBracket, maskStrings, splitTopLevel } from '../core/parse.ts';
|
|
5
|
+
import type { FileCtx } from '../core/scan.ts';
|
|
6
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
7
|
+
|
|
8
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
9
|
+
export const meta: RuleMeta[] = [
|
|
10
|
+
{
|
|
11
|
+
id: "overlay-string-color",
|
|
12
|
+
levels: ["GATE"],
|
|
13
|
+
invariant: "appearance",
|
|
14
|
+
card: "geometry",
|
|
15
|
+
needs: [],
|
|
16
|
+
summary: "`.overlay(` 的第一个实参是颜色串:颜色字面量(`'#…'`、`'transparent'`、`'rgb(…)'`/`'rgba(…)'`)、某一支是颜色字面量的三元表达式,或用颜色字面量初始化的 `this.<成员>`。",
|
|
17
|
+
fix: "`overlay(value: string)` 是**遮罩文本**重载(浮层文档),色值会被当成文字画在组件左上角,蒙层本身不画任何像素。整卡蒙层写成 `@Builder` 浮层:`@Builder mask() { Column().width('100%').height('100%').backgroundColor(<色>).hitTestBehavior(HitTestMode.Transparent) }`,调用处 `.overlay(this.mask())`(浮层文档示例 3:浮层里的 `'100%'` 以宿主组件为基准);条件蒙层在 builder 里用 `if`,不要传 `'transparent'`。",
|
|
18
|
+
escape: null,
|
|
19
|
+
cases: [
|
|
20
|
+
"实测(CoolMall 首页领券弹层 / 我的优惠券,glm53 11-19):Compose `Box(Modifier.matchParentSize().background(mask))` 译成 `.overlay(this.isUnavailable() ? this.maskColor : 'transparent')`,每张券卡左上角显示「transparent」或「#66FFFFFF」字样,不可用券也没有灰蒙层;GATE `percent-height-in-scroll` 先拦下了 Stack 蒙层的 `'100%'`,子代理凭记忆认定「string color fills the component」,EVIDENCE 注释写成「overlay 为绘制层」,编译、冒烟、评审全过。",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
/** A colour as ArkUI parses it from a string: '#RGB' … '#AARRGGBB', 'transparent', 'rgb(…)' / 'rgba(…)'. */
|
|
26
|
+
const COLOR_TEXT: RegExp = /^(?:#[0-9A-Fa-f]{3,8}|transparent|rgba?\s*\([^)]*\))$/i;
|
|
27
|
+
|
|
28
|
+
/** `'…'` / `"…"` literal whose text is a colour. */
|
|
29
|
+
function colorLiteral(expr: string): boolean {
|
|
30
|
+
const m: RegExpExecArray | null = /^(['"])([\s\S]*)\1$/.exec(expr.trim());
|
|
31
|
+
return m !== null && COLOR_TEXT.test(m[2].trim());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Member `name` initialised with a colour literal somewhere in the file (`private maskColor: string = '#66FFFFFF'`). */
|
|
35
|
+
function colorMember(code: string, name: string): boolean {
|
|
36
|
+
const re: RegExp = new RegExp(`(?:^|[\\s;{(,])${name}\\s*(?::[^=;\\n]+)?=\\s*(['"])([^'"\\n]*)\\1`, 'g');
|
|
37
|
+
for (const m of code.matchAll(re)) { if (COLOR_TEXT.test(m[2].trim())) { return true; } }
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Whether one branch expression evaluates to a colour string. */
|
|
42
|
+
function colorExpr(code: string, expr: string): boolean {
|
|
43
|
+
const e: string = expr.trim().replace(/^\((.*)\)$/s, '$1').trim();
|
|
44
|
+
if (colorLiteral(e)) { return true; }
|
|
45
|
+
const mm: RegExpExecArray | null = /^this\.([A-Za-z_$][\w$]*)$/.exec(e);
|
|
46
|
+
return mm !== null && colorMember(code, mm[1]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Top-level `?` / `:` branches of a conditional expression (strings masked), or [expr] when it is not one. */
|
|
50
|
+
function branches(expr: string): string[] {
|
|
51
|
+
const masked: string = maskStrings(expr);
|
|
52
|
+
let depth: number = 0;
|
|
53
|
+
let q: number = -1;
|
|
54
|
+
let colon: number = -1;
|
|
55
|
+
let nested: number = 0;
|
|
56
|
+
for (let i = 0; i < masked.length; i++) {
|
|
57
|
+
const c: string = masked[i];
|
|
58
|
+
if (c === '(' || c === '[' || c === '{') { depth++; } else if (c === ')' || c === ']' || c === '}') { depth--; }
|
|
59
|
+
if (depth !== 0) { continue; }
|
|
60
|
+
if (c === '?' && masked[i + 1] !== '?' && masked[i + 1] !== '.' && masked[i - 1] !== '?') {
|
|
61
|
+
if (q < 0) { q = i; } else { nested++; }
|
|
62
|
+
} else if (c === ':' && q >= 0) {
|
|
63
|
+
if (nested > 0) { nested--; } else if (colon < 0) { colon = i; }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (q < 0 || colon < 0) { return [expr]; }
|
|
67
|
+
return [...branches(expr.slice(q + 1, colon)), ...branches(expr.slice(colon + 1))];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* GATE overlay-string-color: `.overlay('<colour>')`.
|
|
72
|
+
*
|
|
73
|
+
* overlay(value: string | CustomBuilder | ComponentContent): a string is the **mask text** (浮层 API doc:
|
|
74
|
+
* "遮罩文本内容"), so a colour string is drawn as text at the top-left corner and paints no mask at all. Decided
|
|
75
|
+
* lexically on the first argument: a colour literal, a conditional with a colour-literal branch, or `this.x`
|
|
76
|
+
* initialised with a colour literal in this file.
|
|
77
|
+
*/
|
|
78
|
+
export function checkOverlayStringColor(fctx: FileCtx): void {
|
|
79
|
+
const masked: string = maskStrings(fctx.code);
|
|
80
|
+
const re: RegExp = /\.overlay\s*\(/g;
|
|
81
|
+
let m: RegExpExecArray | null;
|
|
82
|
+
while ((m = re.exec(masked)) !== null) {
|
|
83
|
+
const open: number = m.index + m[0].length - 1;
|
|
84
|
+
const close: number = matchBracket(fctx.code, open);
|
|
85
|
+
if (close < 0) { continue; }
|
|
86
|
+
const first: string = (splitTopLevel(fctx.code.slice(open + 1, close))[0] ?? '').trim();
|
|
87
|
+
if (first === '') { continue; }
|
|
88
|
+
const hit: string | undefined = branches(first).map((b) => b.trim()).find((b) => colorExpr(fctx.code, b));
|
|
89
|
+
if (hit === undefined) { continue; }
|
|
90
|
+
report('GATE', 'overlay-string-color', fctx.rel, lineOfIndex(fctx.code, m.index),
|
|
91
|
+
`.overlay(${first.length > 70 ? first.slice(0, 67) + '...' : first}) passes a colour string (${hit}): overlay(string) is the ` +
|
|
92
|
+
'mask-TEXT overload, so the colour is drawn as text at the top-left and no mask is painted. Write the mask as a ' +
|
|
93
|
+
"@Builder: Column().width('100%').height('100%').backgroundColor(<colour>).hitTestBehavior(HitTestMode.Transparent), " +
|
|
94
|
+
'and .overlay(this.mask()); for a conditional mask put the if inside the builder');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -19,8 +19,27 @@ export const meta: RuleMeta[] = [
|
|
|
19
19
|
escape: "// PADDING-IN-SIZE:",
|
|
20
20
|
cases: [],
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
id: "text-input-default-padding-clips",
|
|
24
|
+
levels: ["GATE", "CAND"],
|
|
25
|
+
invariant: "geometry",
|
|
26
|
+
card: "geometry",
|
|
27
|
+
needs: [],
|
|
28
|
+
summary: "`TextInput` / `TextArea` / `Search` 写了字面量 `.height(H)` 却没写 `.padding()`,而默认内边距(上下各 8vp;TextInput 下划线模式 12vp)加文字行高放不进 H —— 文字被裁成上半截。",
|
|
29
|
+
fix: "Compose BasicTextField / 无装饰 EditText 没有内边距,对应 `.padding(0)`(TextInput 文档:默认 padding {top 8, right 16, bottom 8, left 16},padding 置 0 时建议同时 `.borderRadius(0)` 防光标被截);或把高度改成 文字行高 + 上下 padding。确有依据时在组件上方写 `// PADDING-IN-SIZE: <依据>` 降为 CAND",
|
|
30
|
+
escape: "// PADDING-IN-SIZE:",
|
|
31
|
+
cases: [
|
|
32
|
+
"实测(CoolMall 注册页):三个 TextInput 都 .height(24) 且未写 padding,16fp 文字只剩约 8vp 高,只显示上半部分;padding-consumes-fixed-size 只算显式 .padding(),漏掉组件自带的默认内边距。",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
22
35
|
];
|
|
23
36
|
|
|
37
|
+
/** Text-entry components whose padding has a non-zero default (TextInput / TextArea API reference: 8vp top/bottom, 16vp left/right). */
|
|
38
|
+
const TEXT_ENTRY: RegExp = /^(?:TextInput|TextArea|Search)$/;
|
|
39
|
+
/** Default vertical padding sum: 8 + 8, or 12 + 12 for TextInput with showUnderline(true). */
|
|
40
|
+
const DEFAULT_V_PAD: number = 16;
|
|
41
|
+
const UNDERLINE_V_PAD: number = 24;
|
|
42
|
+
|
|
24
43
|
/** A plain number literal (`20`, `20.5`, `'20vp'`); null for anything else (expressions, %, px, resources). */
|
|
25
44
|
function literalVp(arg: string): number | null {
|
|
26
45
|
const m: RegExpMatchArray | null = arg.trim().match(/^(?:(\d+(?:\.\d+)?)|(['"`])(\d+(?:\.\d+)?)(?:vp)?\2)$/);
|
|
@@ -87,6 +106,7 @@ function fixedSizes(attrs: UiAttr[]): { w: number | null; h: number | null } {
|
|
|
87
106
|
export function checkPaddingConsumesFixedSize(fctx: FileCtx): void {
|
|
88
107
|
const { rel, code, rawLines } = fctx;
|
|
89
108
|
const masked: string = maskStrings(code);
|
|
109
|
+
checkTextEntryDefaultPadding(rel, code, masked, rawLines);
|
|
90
110
|
const seen: Set<number> = new Set<number>();
|
|
91
111
|
for (const m of masked.matchAll(/\.padding\s*\(/g)) {
|
|
92
112
|
const head = chainHead(masked, m.index ?? 0);
|
|
@@ -117,3 +137,43 @@ export function checkPaddingConsumesFixedSize(fctx: FileCtx): void {
|
|
|
117
137
|
'write the size as N+2P, or wrap the icon in a sized container. When justified, write // PADDING-IN-SIZE: <basis> above it');
|
|
118
138
|
}
|
|
119
139
|
}
|
|
140
|
+
|
|
141
|
+
/** Literal font size of a chain (`.fontSize(16)` / `'16fp'`), default 16 (TextInput / TextArea default font size 16fp). */
|
|
142
|
+
function fontSizeOf(attrs: UiAttr[]): number {
|
|
143
|
+
const fs: UiAttr | undefined = [...attrs].reverse().find((a) => a.name === 'fontSize');
|
|
144
|
+
if (fs === undefined) { return 16; }
|
|
145
|
+
const m: RegExpMatchArray | null = fs.args.trim().match(/^['"]?(\d+(?:\.\d+)?)(?:fp|vp)?['"]?$/);
|
|
146
|
+
return m !== null ? parseFloat(m[1]) : 16;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* text-input-default-padding-clips: TextInput / TextArea / Search carry a default padding (8vp top/bottom; 12vp with
|
|
151
|
+
* TextInput underline mode). A literal height that leaves less than one text line after that default clips the glyphs:
|
|
152
|
+
* only their top half shows. padding-consumes-fixed-size cannot see it because nothing is written.
|
|
153
|
+
*/
|
|
154
|
+
function checkTextEntryDefaultPadding(rel: string, code: string, masked: string, rawLines: string[]): void {
|
|
155
|
+
for (const m of masked.matchAll(/\b(TextInput|TextArea|Search)\s*\(/g)) {
|
|
156
|
+
const start: number = m.index ?? 0;
|
|
157
|
+
if (start > 0 && /[\w$.]/.test(masked[start - 1])) { continue; }
|
|
158
|
+
if (!TEXT_ENTRY.test(m[1])) { continue; }
|
|
159
|
+
const paren: number = start + m[0].length - 1;
|
|
160
|
+
const close: number = matchBracket(masked, paren);
|
|
161
|
+
if (close < 0) { continue; }
|
|
162
|
+
const [attrs] = attrChainFrom(code, close + 1);
|
|
163
|
+
if (attrs.some((a) => a.name === 'padding')) { continue; }
|
|
164
|
+
const { h } = fixedSizes(attrs);
|
|
165
|
+
if (h === null || h <= 0) { continue; }
|
|
166
|
+
const underline: boolean = m[1] === 'TextInput' && attrs.some((a) => a.name === 'showUnderline' && /true/.test(a.args));
|
|
167
|
+
const vPad: number = underline ? UNDERLINE_V_PAD : DEFAULT_V_PAD;
|
|
168
|
+
const font: number = fontSizeOf(attrs);
|
|
169
|
+
const content: number = h - vPad;
|
|
170
|
+
if (content >= font) { continue; }
|
|
171
|
+
const line: number = lineOfIndex(code, start);
|
|
172
|
+
const marked: boolean = markedAbove(rawLines, line, 'PADDING-IN-SIZE');
|
|
173
|
+
report(marked ? 'CAND' : 'GATE', 'text-input-default-padding-clips', rel, line,
|
|
174
|
+
`${m[1]}: .height(${h}) with no .padding() — the default padding (${vPad / 2}vp top + ${vPad / 2}vp bottom${underline ? ', underline mode' : ''}) ` +
|
|
175
|
+
`leaves ${content}vp for ${font}fp text, so the glyphs are clipped to their top half. ` +
|
|
176
|
+
'Compose BasicTextField / undecorated EditText have no inner padding: write .padding(0) (and .borderRadius(0) so the caret is not cut, per the TextInput reference), ' +
|
|
177
|
+
'or make the height text line + padding. When justified, write // PADDING-IN-SIZE: <basis> above it');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -16,7 +16,7 @@ export const meta: RuleMeta[] = [
|
|
|
16
16
|
card: "geometry",
|
|
17
17
|
needs: [],
|
|
18
18
|
summary: "百分比 `.height()` 往上直到纵向 Scroll/List/Grid/WaterFlow,中间没有任何一层有确定高度(跨 struct 追到调用处)。",
|
|
19
|
-
fix: "贴边角标用 `.position({ right, bottom })`;需占满视口的内容根用 `.constraintSize({ minHeight: '100%' })
|
|
19
|
+
fix: "贴边角标用 `.position({ right, bottom })`;需占满视口的内容根用 `.constraintSize({ minHeight: '100%' })`;盖满整张卡片的蒙层/置灰层用 `.overlay(this.<@Builder>())`,builder 根 `width/height('100%')` + `backgroundColor` + `hitTestBehavior(HitTestMode.Transparent)`(浮层里的 `'100%'` 以宿主为基准),**不要**传颜色串(`overlay(string)` 是遮罩文本,GATE `overlay-string-color`)。",
|
|
20
20
|
escape: null,
|
|
21
21
|
cases: [
|
|
22
22
|
"实测(nova 16, API 24):天气首页 4 张指标卡与日出/日落双卡各约 500vp 高,Android 侧是 wrap_content 约 60dp。",
|
|
@@ -74,7 +74,8 @@ export function checkPercentHeightInScroll(scans: FileScan[]): void {
|
|
|
74
74
|
report('GATE', 'percent-height-in-scroll', s.rel, lineOfIndex(s.code, m.index),
|
|
75
75
|
`percentage height inside a vertical scroll container with no definite height on any level above it (${[...hits[0]].reverse().join(' > ')}) — ` +
|
|
76
76
|
'the percentage resolves against the scroll viewport and the element is stretched to most of the screen height. Use .position({ right, bottom }) for an edge badge; ' +
|
|
77
|
-
"use .constraintSize({ minHeight: '100%' }) for a content root that must fill the viewport"
|
|
77
|
+
"use .constraintSize({ minHeight: '100%' }) for a content root that must fill the viewport; for a mask over the whole card use " +
|
|
78
|
+
".overlay(this.<@Builder>()) whose root is width/height('100%') + backgroundColor + hitTestBehavior(HitTestMode.Transparent), never a colour string");
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// static_check/rules/relative_container_height.ts — GATE relative-container-unsized-in-scroll.
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { attrsWithArgs, lineOfIndex, matchBracket } from '../core/parse.ts';
|
|
5
|
+
import type { UiAttr } from '../core/parse.ts';
|
|
6
|
+
import { RE_PCT, SCROLLERS, maskedOf, verticalScroller, walkUp } from '../core/scan.ts';
|
|
7
|
+
import type { FileScan, Visit } from '../core/scan.ts';
|
|
8
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
9
|
+
import { definiteHeight } from './percent_height_in_scroll.ts';
|
|
10
|
+
|
|
11
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
12
|
+
export const meta: RuleMeta[] = [
|
|
13
|
+
{
|
|
14
|
+
id: "relative-container-unsized-in-scroll",
|
|
15
|
+
levels: ["GATE"],
|
|
16
|
+
invariant: "geometry",
|
|
17
|
+
card: "geometry",
|
|
18
|
+
needs: [],
|
|
19
|
+
summary: "纵向 Scroll/List/Grid/WaterFlow 里、往上直到滚动容器都没有确定高度的 `RelativeContainer`,自身高度未设或为 `'auto'` / `LayoutPolicy.wrapContent` / `fixAtIdealSize`,且有子节点的 `alignRules` 在 top / bottom / center 上以 `'__container__'` 为锚点(跨 struct 追到调用处)。",
|
|
20
|
+
fix: "RelativeContainer 文档:height 为 `\"auto\"`(API 11+)或 `wrapContent`(API 20+)时,只要垂直方向上有子组件以容器为锚点,自适应就不生效、视为未设高度(FAQ faqs-arkui-318:容器高与子组件布局循环依赖)。Android `wrap_content` 的卡片改用 `Column`/`Row`/`Stack` 表达(左图标 + 文字列 = `Row { Image; Column { … } }`,角落元素用 `Stack` + `Alignment`);确需二维约束时,纵向只锚兄弟节点(首个子节点不写纵向 alignRules,默认贴顶)并写 `.height('auto')`,或写参考 view tree 实测高度。",
|
|
21
|
+
escape: null,
|
|
22
|
+
cases: [
|
|
23
|
+
"实测(天气首页,glm53 11-19):ConstraintLayout `wrap_content` 的日出/日落卡与 4 张信息卡译成只写 `.width('100%')` 的 RelativeContainer,图标同时锚 `__container__` 的 top 和 bottom;卡片在 Scroll 里被拉到远高于 Android 的 59dp。子代理在推理里写「RelativeContainer supports wrap?」后没有查文档,依据是 geometry 卡的「二维约束 → RelativeContainer」。",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const AUTO_HEIGHT: RegExp = /^\s*(?:(['"])auto\1|LayoutPolicy\s*\.\s*(?:wrapContent|fixAtIdealSize))\s*$/;
|
|
29
|
+
|
|
30
|
+
/** Height of the container itself: 'auto' (unset / auto / wrapContent), 'pct' (left to percent-height-in-scroll), or 'definite'. */
|
|
31
|
+
function ownHeight(attrs: UiAttr[]): 'auto' | 'pct' | 'definite' {
|
|
32
|
+
const h: UiAttr | undefined = attrs.find((a) => a.name === 'height');
|
|
33
|
+
if (h !== undefined) { return AUTO_HEIGHT.test(h.args) ? 'auto' : RE_PCT.test(h.args) ? 'pct' : 'definite'; }
|
|
34
|
+
const sz: UiAttr | undefined = attrs.find((a) => a.name === 'size' && /\bheight\s*:/.test(a.args));
|
|
35
|
+
if (sz !== undefined) { return /\bheight\s*:\s*(?:(['"])auto\1|LayoutPolicy\b)/.test(sz.args) ? 'auto' : 'definite'; }
|
|
36
|
+
if (attrs.some((a) => a.name === 'aspectRatio' || (a.name === 'constraintSize' && /\bmaxHeight\s*:/.test(a.args)))) { return 'definite'; }
|
|
37
|
+
return 'auto';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** A layer whose height is definite, with 'auto' / wrapContent heights not counting. */
|
|
41
|
+
function definiteLayer(attrs: { name: string; args: string }[], parent: string): boolean {
|
|
42
|
+
const own: UiAttr[] = attrs.filter((a) => !(a.name === 'height' && AUTO_HEIGHT.test(a.args)));
|
|
43
|
+
return definiteHeight(own, parent);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const VERTICAL_CONTAINER_ANCHOR: RegExp = /\b(top|bottom|center)\s*:\s*\{[^{}]*\banchor\s*:\s*(['"])__container__\2/;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* GATE relative-container-unsized-in-scroll: a RelativeContainer whose height can only come from its children, inside
|
|
50
|
+
* a vertical scroller with no definite height in between, while a child anchors the container vertically. Per the
|
|
51
|
+
* RelativeContainer doc, "auto" / wrapContent does not take effect on an axis where children anchor the container,
|
|
52
|
+
* so the card is not content-sized (the weather cards stretched far past their 59dp Android height).
|
|
53
|
+
* Children are those whose alignRules sit in this container's block and in no nested RelativeContainer.
|
|
54
|
+
*/
|
|
55
|
+
export function checkRelativeContainerInScroll(scans: FileScan[]): void {
|
|
56
|
+
const visit: Visit = (a, parent) => {
|
|
57
|
+
if (SCROLLERS.has(a.name)) { return verticalScroller(a.name, a.attrs) ? 'hit' : 'stop'; }
|
|
58
|
+
return definiteLayer(a.attrs, parent) ? 'stop' : 'continue';
|
|
59
|
+
};
|
|
60
|
+
for (const s of scans) {
|
|
61
|
+
const masked: string = maskedOf(s);
|
|
62
|
+
const blocks: { start: number; paren: number; open: number; close: number }[] = [];
|
|
63
|
+
for (const m of masked.matchAll(/\bRelativeContainer\s*\(/g)) {
|
|
64
|
+
const paren: number = (m.index as number) + m[0].length - 1;
|
|
65
|
+
const argsEnd: number = matchBracket(s.code, paren);
|
|
66
|
+
if (argsEnd < 0) { continue; }
|
|
67
|
+
let k: number = argsEnd + 1;
|
|
68
|
+
while (k < s.code.length && /\s/.test(s.code[k])) { k++; }
|
|
69
|
+
if (s.code[k] !== '{') { continue; }
|
|
70
|
+
const close: number = matchBracket(s.code, k);
|
|
71
|
+
if (close < 0) { continue; }
|
|
72
|
+
blocks.push({ start: m.index as number, paren, open: k, close });
|
|
73
|
+
}
|
|
74
|
+
const innermost = (pos: number): number => {
|
|
75
|
+
let best: number = -1;
|
|
76
|
+
blocks.forEach((b, i) => {
|
|
77
|
+
if (b.open < pos && pos < b.close && (best < 0 || b.open > blocks[best].open)) { best = i; }
|
|
78
|
+
});
|
|
79
|
+
return best;
|
|
80
|
+
};
|
|
81
|
+
const anchored: Set<number> = new Set();
|
|
82
|
+
for (const m of masked.matchAll(/\.alignRules\s*\(/g)) {
|
|
83
|
+
const open: number = (m.index as number) + m[0].length - 1;
|
|
84
|
+
const close: number = matchBracket(s.code, open);
|
|
85
|
+
if (close < 0 || !VERTICAL_CONTAINER_ANCHOR.test(s.code.slice(open + 1, close))) { continue; }
|
|
86
|
+
const owner: number = innermost(m.index as number);
|
|
87
|
+
if (owner >= 0) { anchored.add(owner); }
|
|
88
|
+
}
|
|
89
|
+
for (const i of anchored) {
|
|
90
|
+
const b = blocks[i];
|
|
91
|
+
if (ownHeight(attrsWithArgs(s.code, b.paren)) !== 'auto') { continue; }
|
|
92
|
+
const hits: string[][] = [];
|
|
93
|
+
walkUp(scans, s, b.start, visit, [], hits, new Set());
|
|
94
|
+
if (hits.length === 0) { continue; }
|
|
95
|
+
report('GATE', 'relative-container-unsized-in-scroll', s.rel, lineOfIndex(s.code, b.start),
|
|
96
|
+
`RelativeContainer with no definite height inside a vertical scroller (${[...hits[0]].reverse().join(' > ')}), and a child anchors ` +
|
|
97
|
+
"'__container__' vertically: height 'auto' / wrapContent does not apply on an axis where children anchor the container, so the card " +
|
|
98
|
+
'is not sized to its content. For an Android wrap_content card use Column / Row / Stack; to keep RelativeContainer, anchor ' +
|
|
99
|
+
"vertically to siblings only and set .height('auto'), or set the measured height");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|