@buaa_smat/hometrans 26.0.4 → 26.0.5
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/agents/code-reviewer.md +2 -0
- package/agents/model-render-worker.md +1 -1
- package/i18n/agents/code-reviewer.md +2 -0
- package/i18n/agents/model-render-worker.md +1 -1
- package/i18n/skills/a2h-app-migrate/SKILL.md +51 -3
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +140 -32
- package/i18n/skills/a2h-app-migrate/scripts/dag_graph.mjs +297 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +134 -21
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +21 -4
- package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +3 -3
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +12 -5
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +7 -8
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -1
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +27 -15
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +36 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +3 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +8 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_in_linear.ts +164 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/self_drawn_sheet.ts +105 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/staggered_lanes.ts +127 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_size_constant.ts +114 -0
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +4 -1
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +35 -5
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +4 -4
- package/i18n/skills/a2h-spec-generate/SKILL.md +3 -1
- package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +15 -3
- package/i18n/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +16 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +16 -0
- package/i18n/skills/a2h-spec-generate/references/spec-samples.md +5 -1
- package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +21 -1
- package/i18n/skills/a2h-spec-generate/references/worker-rules.md +25 -2
- package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +121 -6
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +2 -1
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +3 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +16 -2
- package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +11 -2
- package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +35 -0
- package/package.json +1 -1
- package/skills/a2h-app-migrate/SKILL.md +53 -5
- package/skills/a2h-app-migrate/references/workflow.yaml +140 -32
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +226 -0
- package/skills/a2h-app-migrate/scripts/dag_graph.mjs +297 -0
- package/skills/a2h-app-migrate/scripts/dag_process_executor.mjs +199 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +897 -0
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +1767 -0
- package/skills/a2h-app-migrate/scripts/ledger.mjs +15 -2
- package/skills/a2h-app-migrate/scripts/lib-yaml-lite.mjs +8 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -8
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +134 -21
- package/skills/a2h-app-migrate/test/test_dag_complete.mjs +222 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +670 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +423 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +21 -4
- package/skills/a2h-app-migrate/test/test_image_probe.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +16 -1
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +12 -5
- package/skills/a2h-arkts-logic-coder/SKILL.md +7 -8
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +27 -15
- package/skills/a2h-batch-ui-align/SKILL.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +4 -0
- package/skills/a2h-batch-ui-align/references/checker-rules.md +36 -0
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +4 -0
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +4 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +3 -3
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +49 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +36 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +8 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_in_linear.ts +164 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/self_drawn_sheet.ts +105 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/staggered_lanes.ts +127 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_size_constant.ts +114 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_ds1123.test.mjs +433 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_in_linear.test.mjs +288 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +46 -0
- package/skills/a2h-page-specgen/references/scenario-authoring.md +4 -1
- package/skills/a2h-page-specgen/references/spec-example.md +35 -5
- package/skills/a2h-page-specgen/references/spec-template.md +4 -4
- package/skills/a2h-spec-generate/SKILL.md +3 -1
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +15 -3
- package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/skills/a2h-spec-generate/references/spec-sample-complex.md +16 -0
- package/skills/a2h-spec-generate/references/spec-sample-transfer.md +16 -0
- package/skills/a2h-spec-generate/references/spec-samples.md +5 -1
- package/skills/a2h-spec-generate/references/synthesis-rules.md +21 -1
- package/skills/a2h-spec-generate/references/worker-rules.md +25 -2
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +3 -1
- package/skills/a2h-spec-generate/scripts/check_spec.ts +262 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +12 -2
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +3 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +16 -2
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +54 -3
- package/skills/a2h-spec-generate/test/check-spec.test.ts +247 -0
|
@@ -137,19 +137,30 @@ rendered value, write `state-docs: not-applicable` to `{output-path}/state_docs_
|
|
|
137
137
|
dispatcher's field) → skip step 2, use `references/ISSUES.md`, write `state-docs: unavailable`,
|
|
138
138
|
and continue; the chunk is never blocked on the docs.
|
|
139
139
|
|
|
140
|
-
**Platform API doc gate
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
140
|
+
**Platform API doc gate.** Two classes — the class decides, not the writer's confidence.
|
|
141
|
+
|
|
142
|
+
*Shape (soft).* A platform API guessed by analogy compiles and misbehaves at runtime (wrong param
|
|
143
|
+
order, a missing `await`, a callback that fires too early). Run the steps below when the worktree has
|
|
144
|
+
no working call site for the API and its parameter order/types, sync/async, lifecycle, return shape
|
|
145
|
+
or error path is unclear; otherwise skip it and record `api-docs: not-applicable`.
|
|
146
|
+
|
|
147
|
+
*Semantics (mandatory).* A signature says what exists, not what a call means. Read one section of the
|
|
148
|
+
official page — even when a working call site exists — for any call whose correctness depends on:
|
|
149
|
+
|
|
150
|
+
- **Targets** — what it actually affects, and what it replaces, removes or leaves behind.
|
|
151
|
+
- **Ordering** — when it runs, and what must already exist by then.
|
|
152
|
+
- **Capability** — what is granted, at which level, and what denial must do.
|
|
153
|
+
- **Units** — unit, rounding, and whether a range is inclusive.
|
|
154
|
+
- **Addressed state** — which key, which store owns it, what a missing key means.
|
|
155
|
+
|
|
156
|
+
Read each distinct API once per chunk — dedupe by API, not by call site — at most 5 per chunk. Record
|
|
157
|
+
**one verbatim sentence from that page** in the row's `conclusion`; restating intent, or a row sourced
|
|
158
|
+
only from `SDK .d.ts`, does not satisfy this gate. Past the cap, or when the page cannot be read,
|
|
159
|
+
record `api-docs: unavailable` with the key and continue; never record `available`.
|
|
160
|
+
|
|
161
|
+
Source precedence: for **shape**, a working call site first, then `.d.ts`, then the official page; for
|
|
162
|
+
**meaning**, the official page outranks both. A difference in behaviour (not existence) goes in
|
|
163
|
+
`## Spec deviations`.
|
|
153
164
|
|
|
154
165
|
1. Search once for the module, not for prose: `node <skill-dir>/scripts/state_doc.mjs search
|
|
155
166
|
"@ohos.net.http request" --limit 3`. Only the `harmonyos-guides` and `harmonyos-references`
|
|
@@ -168,8 +179,9 @@ the `await`.
|
|
|
168
179
|
`api-taskpool`, `api-crypto`, `api-i18n`, `api-webview`, `api-socket`, `api-common-event`,
|
|
169
180
|
`api-background-task`; `list --api` prints the table) resolves the ID for you and is capped at
|
|
170
181
|
400 lines by default.
|
|
171
|
-
3. Budget: at most 3
|
|
172
|
-
|
|
182
|
+
3. Budget: at most 3 searches and 2 section reads per chunk for shape queries. Semantics reads are
|
|
183
|
+
separate and deduped by API: one section per distinct API, at most 5 per chunk; the rest are
|
|
184
|
+
recorded `api-docs: unavailable`.
|
|
173
185
|
4. Guard the API level: the doc tags a section `phone 12+ | 2in1 13+ …`. If the tag is above the
|
|
174
186
|
project's `compatibleSdkVersion` (or the module's `minAPIVersion`), use the fallback the doc
|
|
175
187
|
names (`canIUse`, an older overload, or a different API) instead of the newer call.
|
|
@@ -260,7 +260,7 @@ If a task-tracking tool is available, create one task per page, with already-`do
|
|
|
260
260
|
- **5.3** host-chain groups run serially, self-contained groups concurrently; `group_queue.mjs` applies the rules from `plan`. When in doubt, serialize. Rule 7 binds every concurrent prompt:
|
|
261
261
|
|
|
262
262
|
7. **The shared registry surface is parent-owned while any other group is in flight.** Every concurrently dispatched group's prompt states: do not edit `main_pages.json`, `resources/**/element/*.json`, `oh-package*.json5`, `module.json5` or the ability's `loadContent()`. Instead, list the additions in the report under `registry_requests`. The parent applies each group's requests when that group is released, one group at a time. Merge, never overwrite: an existing name with a different value is a conflict, so keep the existing value and record it in the report.
|
|
263
|
-
- **5.4** Never dispatch blocking waves. `Q init` once, then one pass per parent turn: release (`Q reap` → `Q release`), lease and dispatch (`Q lease`, pass `message` verbatim, `Q bind`), verify every `returned_unverified` group (`phase5_check.mjs --group`, `Q verified`, `group_commit.mjs`), then `Q wait` with a shell timeout above 9 min. Go on only when `summary.idle` is true, nothing is unverified and `summary.stuck` is empty.
|
|
263
|
+
- **5.4** Never dispatch blocking waves. `Q init` once, then one pass per parent turn: release (`Q reap` → `Q release`), lease and dispatch (`Q lease`, pass `message` verbatim, `Q bind`), verify every `returned_unverified` group (`phase5_check.mjs --group`, `Q verified --summary`, which marks its pages `done` in `batch_progress.json`, then `group_commit.mjs`), then `Q wait` with a shell timeout above 9 min. Go on only when `summary.idle` is true, nothing is unverified and `summary.stuck` is empty.
|
|
264
264
|
- **5.5** One background sub-agent (Step 0.1) does the wiring: confirm every `registry_requests` was applied, wire self-contained components and shell hosts, and wire navigation from `navigates_to`. No group is in flight any more, so this agent may edit the registry surface of Rule 7. The parent writes `${harmony_project_dir}/.hometrans/work/prompts/wiring.md` (the Step 5.5 procedure of step5-convert.md plus its inputs), dispatches it the way Step 2 is dispatched, and joins on `.hometrans/work/wiring.report.md`. **Gate (parent re-checks after the join):** `orphan-component` is zero, and `phase5_check.mjs --files <every file changed since the last group commit>` has `blocking` 0, and `node scripts/shell_requests.mjs verify --hp ${harmony_project_dir}` exits 0 (every ledger id answered, every deleted `.ets` has its merge line), before Step 6. Run `shell_requests.mjs collect` before writing `wiring.md` and put its table in the prompt; carry every `deferred` row into Step 7's Manual Follow-up TODOs. Take that file list from `git status --porcelain` (modified and untracked), not from the report: a file the agent edited but left out of the report would otherwise skip the gate and still be committed. The parent then commits the wiring.
|
|
265
265
|
|
|
266
266
|
## Step 6 — Static Check, Build, Smoke Gate
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
|
|
27
27
|
**外观替换 —— 参照已捕获的外观不得自行「降级」**:框架控件(选择器、弹窗、开关、进度条……)若参照截图里的**图形结构**与目标 ArkUI 同名组件不同,第 2 问的结论只能是 (b2) 覆写或 (a) 自绘,或标 `需上报`;**不得**写「ArkUI 无此形态,已降级为 X」了事。这与 Phase 5「过渡实现证据」的捕获态规则同理:截图拍到的外观本身就是验收目标。典型实例是 Android `TimePicker` / `TimePickerDialog` 默认表盘、`DatePicker` / `DatePickerDialog` 默认月历,而 ArkUI 同名组件都是滚轮(映射表「按模式映射」行;GATE `framework-picker-appearance`)。父流程接受差异时,在该行上方写 `// APPEARANCE-ESCALATED(<Widget>): <裁决出处>`,并在报告里登记 `需上报`。
|
|
28
28
|
|
|
29
|
+
**底部弹层(`ModalBottomSheet` / `BottomSheetDialog` / `BottomSheetScaffold`)—— 用 `bindSheet`,自绘不是外观对不上的出口**:Android 的 Material 底部弹层除了外观,还带着一组行为:下拉面板关闭、点遮罩关闭、返回键关闭、面板高度受窗口限制。`bindSheet` / `UIContext.openBindSheet` 自带这些行为。外观差异用选项解决:`dragBar: false` 后系统不再画指示条,在 builder 里画 Android 的指示条(如 40×4dp、圆角 2),**不算画两遍**;面板色写 `backgroundColor`,圆角写 `radius`,高度写 `height` / `detents`,遮罩色写 `maskColor`。所以「系统指示条和 Android 的不一样」不能作为改判 (a) 自绘的理由。确实要自绘(Stack + 遮罩 + 面板)时,报告的部件归属表里这一行必须逐项列出原控件的行为及实现位置:拖动关闭(`PanGesture({ direction: PanDirection.Down })`,跟手位移,超过阈值或速度时调用关闭回调)、点遮罩关闭、返回键关闭(`onBackPress` / 宿主拦截)、面板最大高度。缺一项就是 `需上报`,不能写成已实现。GATE `self-drawn-sheet-no-drag-dismiss`。
|
|
30
|
+
|
|
31
|
+
**部件归属判 (a) 自绘时,行为一并接管**:上面三类判定只问了装饰「画几遍、像不像」。改判 (a) 自绘、原子组件不再实例化后,原子组件自带的**交互行为**也一起没了(拖动关闭、惯性、键盘避让、返回键、无障碍角色),编译、截图对比、GATE 都看不出来。所以 (a) 行除了图形结构,还要列出「原控件自带行为 → 自绘实现的 `文件:行号`」,任一行为没有实现位置的,标 `需上报`。
|
|
32
|
+
|
|
29
33
|
**一个节点只挂一个半模态 / 全模态**:`bindSheet` / `bindContentCover` 由所挂节点托管,一个节点只维护一个模态生命周期;同一属性链上挂两个,其中一个刚弹出就被关掉(「点一下闪一下就没了」),编译与冒烟都看不出来。Compose 里每个 `ModalBottomSheet` 有自己的 state,对应到 ArkUI 是各自独立的宿主节点:挂到各自的触发节点上,或各包一层空容器作宿主;弹层多时改用 `UIContext.openBindSheet` / `closeBindSheet` 管理。Step 5.5 接线追加弹层时同样适用。GATE `multiple-overlay-binds-same-node`。
|
|
30
34
|
|
|
31
35
|
**系统弹窗与菜单 —— 锚定用原生机制,外观跟源主题走**:Android `PopupMenu` / `ContextMenu` / 锚定在按钮上的 `ListPopupWindow`、`AlertDialog.Builder` / `MaterialAlertDialogBuilder` 是框架控件,**外观由 Android 应用主题决定**,不是由「系统」决定;换到 ArkUI 后,「系统外观」就成了鸿蒙的外观。映射表写「直接映射」只说明 API 对得上,外观并不一致。
|
|
@@ -116,6 +116,15 @@
|
|
|
116
116
|
- 修法: `main-axis-pct-siblings`(GATE:`Row`/`Column` 里 ≥2 个直接子节点在主轴上都是 `'100%'`,含 `@Builder` 根节点;只有 1 个且有其他兄弟时为 CAND)→ 改 `.layoutWeight(n)`
|
|
117
117
|
- 降级标记: 无
|
|
118
118
|
|
|
119
|
+
### overlay-component-in-linear-container
|
|
120
|
+
|
|
121
|
+
- 级别: GATE / CAND
|
|
122
|
+
- 需要: —
|
|
123
|
+
- 知识卡: `references/cards/geometry.md`
|
|
124
|
+
- 触发: `Row`/`Column` 的直接子节点(含 if/else 分支内)是本工程的弹层组件 —— 其 build() 根节点宽高都是 `'100%'`,且在没有(非空)else 的 `if (...)` 里按标志显示或带 `.transition(`(if/else 状态切换视图不算);同一容器里还有不互斥的兄弟,调用处没有 position/offset/markAnchor/layoutWeight/flexGrow。跨文件判定,穿过包名 import 与包装组件。
|
|
125
|
+
- 修法: 弹层是叠加层,不参与线性排布:把它移成 `Stack` / `RelativeContainer` 的直接子节点(排在内容之后,与内容兄弟同级),或改用 `bindSheet` / `bindContentCover` / `openCustomDialog`。为强制重建子树而包一层 `ForEach`/`Column` 时只包需要重建的内容,弹层留在外层 `Stack`。确实要占线性位置的(例如内联展开面板),在调用处上方写 `// OVERLAY-IN-FLOW: <依据>` 降为 CAND。
|
|
126
|
+
- 降级标记: `// OVERLAY-IN-FLOW: <依据>`
|
|
127
|
+
|
|
119
128
|
### padding-consumes-fixed-size
|
|
120
129
|
|
|
121
130
|
- 级别: GATE / CAND
|
|
@@ -233,6 +242,15 @@
|
|
|
233
242
|
- 修法: `stack-overlay-default-center`(GATE:同样未设 `alignContent` 的 `Stack` 里,≥2 个兄弟中有一个只靠单侧 `margin.bottom`/`margin.top` 定位、未撑满高度、无 position/offset/align;居中意图写 `// STACK-CENTER: <依据>` 降为 CAND)→ 给 `Stack` 设对应 `alignContent`
|
|
234
243
|
- 降级标记: `// STACK-CENTER: <依据>`
|
|
235
244
|
|
|
245
|
+
### staggered-grid-lanes-by-index
|
|
246
|
+
|
|
247
|
+
- 级别: GATE / CAND
|
|
248
|
+
- 需要: `--android`
|
|
249
|
+
- 知识卡: `references/cards/geometry.md`
|
|
250
|
+
- 触发: 按下标奇偶把数组分成两列:`for (let i = <非 0 起点>; …; i += 2)`,或 `.filter((_, i) => i % 2 …)`。GATE 需带 `--android`,且对应 Android 源文件(文件名相同,或引用了 `X.kt`)用了 `LazyVerticalStaggeredGrid` / `StaggeredGridItemSpan` / `StaggeredGridLayoutManager` 的那个 .ets 文件里能看到两列的形状:循环所在方法(成员方法或顶层函数均可)被以车道实参 `0` 和 `1` 各调用一次(如 `vm.laneItems(0)` / `laneItems(this.all, 1)`),或同一文件里写了两处 `.filter` 分列。其余步长为 2 的循环(成对遍历 key/value 等)只报 CAND。
|
|
251
|
+
- 修法: 瀑布流按「当前最短列」放置每一项,奇偶分列只平衡了数量、没有平衡高度,卡片高度不一时两列越往下错位越大,也无法懒加载。改用 `WaterFlow` + `FlowItem`(`columnsTemplate('1fr 1fr')`);`span = FullLine` 的整行项放进 `crossCount: 1` 的分组(`WaterFlowSections`,间距规则见 waterflow-sections-no-gap)。源码确实是按奇偶分两列(不是瀑布流)时在分列代码上方写 `// LANES-BY-INDEX: <源码依据>` 关闭本条。
|
|
252
|
+
- 降级标记: `// LANES-BY-INDEX: <依据>`
|
|
253
|
+
|
|
236
254
|
### text-input-default-padding-clips
|
|
237
255
|
|
|
238
256
|
- 级别: GATE / CAND
|
|
@@ -269,6 +287,15 @@
|
|
|
269
287
|
- 修法: 按 Android 的比例写成相对宽度(弹窗: 背板选项 `width` 取 measure_summary `dialog panel` 行的占屏宽比例,背板即面板,见 widgets 卡「对话框」段);确属定宽时注明依据
|
|
270
288
|
- 降级标记: 无
|
|
271
289
|
|
|
290
|
+
### window-size-frozen-constant
|
|
291
|
+
|
|
292
|
+
- 级别: GATE / CAND
|
|
293
|
+
- 需要: `--android`
|
|
294
|
+
- 知识卡: `references/cards/geometry.md`
|
|
295
|
+
- 触发: `constraintSize` 的 `maxHeight` / `maxWidth` 是数字字面量(≥ 100),或是本文件里初值为这种字面量的常量,且本文件没有读运行时窗口尺寸(`getDefaultDisplaySync` / `getWindowProperties` / `windowSizeChange` / `windowRect` / `mainWindowSize`;`onAreaChange` / `onSizeChange` 量的是组件,不算)。按维度判:本文件对应的 Android 源文件(文件名相同,或引用了 `X.kt`)读了同一维度的窗口尺寸(高度:`.screenHeightDp` / `heightPixels` / `containerSize.height` / `bounds.height()`;宽度同理)时报 GATE;只读了不带维度的窗口 API(`LocalWindowInfo` / `LocalConfiguration` / `displayMetrics` / `currentWindowMetrics`)时报 CAND;只读了另一维度时不报。成员名单独匹配,先存到局部变量(`configuration.screenHeightDp`)和 Java 写法(`getDisplayMetrics().heightPixels`)都算。
|
|
296
|
+
- 修法: Android 侧按运行时窗口算的上限,不能写成采集机算出来的常量:屏幕一矮,这块区域保持原高度,后面的按钮被挤出屏幕。改用运行时窗口高度(`display.getDefaultDisplaySync()` / 窗口 `getWindowProperties().windowRect`,px 转 vp 后减去源码里的保留高度),或者改成弹性布局:可滚动区 `layoutWeight(1)`(或 `flexShrink(1)`)放在有 `constraintSize({ maxHeight })` 的父容器里,固定区块(按钮行)放在它后面,不随内容变化而被挤出。上限确实与窗口无关时在该行上方写 `// SIZE-NOT-WINDOW: <源码依据>` 关闭本条。
|
|
297
|
+
- 降级标记: `// SIZE-NOT-WINDOW: <依据>`
|
|
298
|
+
|
|
272
299
|
## appearance — 外观(颜色、控件外观、视觉效果、转场)
|
|
273
300
|
|
|
274
301
|
### alpha-scale-mismatch
|
|
@@ -680,6 +707,15 @@
|
|
|
680
707
|
- 修法: 回调参数是本帧增量,不是累计位移。需要累计位移(折叠头部、顶栏渐隐、对应 Compose `firstVisibleItemScrollOffset` / View `getScrollY()`)时读 `this.scroller.currentOffset().yOffset`,或在状态上 `+=` 累加;只判断滚动方向时与 0 比较不受影响。确为增量语义时在回调或赋值语句上方写 `// SCROLL-DELTA: <依据>`,降为 CAND。
|
|
681
708
|
- 降级标记: `// SCROLL-DELTA: <依据>`
|
|
682
709
|
|
|
710
|
+
### self-drawn-sheet-no-drag-dismiss
|
|
711
|
+
|
|
712
|
+
- 级别: GATE / CAND
|
|
713
|
+
- 需要: `--android`
|
|
714
|
+
- 知识卡: `references/cards/widgets.md`
|
|
715
|
+
- 触发: `Stack({ alignContent: Alignment.Bottom* })` 的直接子节点里有宽高都撑满且挂了 `.onClick` 的遮罩层,另有一个兄弟节点(面板),而这个 Stack 块内、以及它调用的 `this.X()` @Builder 体内都没有 `PanGesture` / `SwipeGesture`。按每个 Stack 单独判断:同一文件里别的弹层用了 `bindSheet` 或手势,不豁免这一个。GATE 需带 `--android`,且本文件对应的 Android 源文件(文件名相同,或引用了 `X.kt`)用了 `ModalBottomSheet` / `BottomSheetDialog` / `BottomSheetScaffold`;其余只报 CAND。已知误报:「点空白处收起键盘 + 底部栏」这类撑满可点层加兄弟节点的结构,在对应 Android 文件也有底部弹层时同样报 GATE,确认不是弹层后用标记关闭。
|
|
716
|
+
- 修法: Android 的 Material 底部弹层可以下拉关闭,自绘 Stack 只保留了点遮罩关闭。优先改回 `bindSheet(..., { dragBar: false, backgroundColor, ... })` 或 `UIContext.openBindSheet`,在 builder 里自己画 Android 的拖动指示条(`dragBar: false` 后系统不再画,不会重复绘制);必须自绘时,在面板上挂 `PanGesture({ direction: PanDirection.Down })`,跟手位移并在超过阈值或速度时调用关闭回调,同时处理返回键。确实不能拖动关闭(Android 设了 `sheetGesturesEnabled = false` 或 `confirmValueChange` 拒绝隐藏)时,在 Stack 上方写 `// SHEET-NO-DRAG: <源码依据>` 关闭本条。
|
|
717
|
+
- 降级标记: `// SHEET-NO-DRAG: <依据>`
|
|
718
|
+
|
|
683
719
|
### shell-content-has-entry
|
|
684
720
|
|
|
685
721
|
- 级别: GATE
|
|
@@ -194,6 +194,8 @@ dialog/fragment/adapter 等必须从主页面拆出去到 `{harmony_project_dir}
|
|
|
194
194
|
- `bounds` 差值只用于计算区域比例和验证相对布局,不能直接当 vp;固有 dp/sp 尺寸以 Android XML/dimens 为准
|
|
195
195
|
- 资源用 `$r('app.color.xxx')` / `$r('app.string.xxx')` / `$r('app.media.xxx')`
|
|
196
196
|
|
|
197
|
+
**合并成一个 `@Builder` / 组件时,只合并各调用处都有的部分**:Android 里几处相似的调用(如两张卡片的标题行都是 `AppListItem(leadingContent = TitleWithLine(...))`),逐处对照参数后再决定 builder 的形状。所有调用处都传了的内容才能写死在 builder 里;只有部分调用处有的内容(某一处才有的 `trailingContent`、图标、箭头、角标)做成参数(可选 `@Builder` 槽位或布尔开关),每个调用处按自己的 Android 实参传。判断方法:对每个调用处问一句「把 builder 展开到这里,多出来或少掉的节点在 Android 这一处有没有」。CoolMall 物流页的实例:物流信息卡标题行有快递 logo,物流轨迹卡标题行没有;合成一个 `TitleRow` 后 logo 写死在里面,轨迹卡标题右侧多出一个图标。source-only 页没有截图可比,这类错误只能靠这一步逐处对照拦下。在 Phase 5「可见资源闭环」里,对每个被多处调用的 builder 列出「调用处 → Android 对应调用的 `文件:行号` → 该处有/无的可选部分」。
|
|
198
|
+
|
|
197
199
|
**路由**:实现 UI 与组件之间的路由关系。
|
|
198
200
|
|
|
199
201
|
**交互元素**:
|
|
@@ -303,6 +305,8 @@ A 档的推导链一步不省:压缩的是表达方式和重复,不是推理
|
|
|
303
305
|
- **形状背景证据**:列出 Android ShapeDrawable 到 ArkUI 样式的映射;无 `<size>` 的 stretchable shape 若通过普通 Image + `ImageFit.Fill` 使用,判定失败。
|
|
304
306
|
- **静态裁切检查**:根据参考截图/view tree 的主要区域比例检查 toolbar、内容区、卡片和底部区域不会相互覆盖或超出预期内容区。**并且**:
|
|
305
307
|
- `Stack` 内互为兄弟的文字/图标行,逐个写出纵向区间 `[top, top+高]` 及其原点(判据见 `cards/geometry.md`「硬性要求(坐标系)」原点一段);状态驱动的偏移/尺寸,起止两端各算一次,与对应快照 bounds 比对,快照里不重叠而算出重叠即失败。
|
|
308
|
+
- **逐个状态分支算一遍,不只算采集到的那一帧**:源码里会让本区域变高的分支(选中后多出的行、展开态、错误提示、`if (x != null)` 才显示的块),按「状态分支清单」逐个把多出的高度加上再算一次。底部固定区块(按钮行、输入栏)在任何一个分支里都必须留在屏幕内:做法是可滚动区 `layoutWeight(1)`(或 `flexShrink(1)`),放在有高度上限的父容器里,固定区块排在它后面。只用一帧的数字(如 `759 < 783.6`)证明「放得下」,而源码还有更高的分支,判定失败。
|
|
309
|
+
- **按窗口算的尺寸照样按窗口算**:Android 用 `LocalWindowInfo` / `LocalConfiguration.screenHeightDp` / `displayMetrics` 算出的上限(如 `heightIn(max = 屏高 − 380dp)`),鸿蒙侧读运行时窗口尺寸,或改成上面的弹性布局,不能写成采集机上算出来的常量(`914.29 − 380 = 534`)。常量只在采集机的屏幕上正确。GATE `window-size-frozen-constant`。
|
|
306
310
|
- 参考 view tree 里是**单行**的 `wrap_content` 文本(高度 ≈ 一行字高),在鸿蒙侧找出它的可用宽度(父宽 − 同行兄弟占宽 − padding),按字号估算文本宽度放得下;放不下而 Android 放得下,说明结构把兄弟摊进了同一行(`cards/geometry.md` 约束布局转写表「二维约束」行),改结构,不要靠缩字号或 `maxLines(1)` 截断掩盖。
|
|
307
311
|
- **交互可达性证据**:对每个可点击元素,列出它在父 `Stack`/层叠结构中的**层序**,并确认其后**没有**任何兄弟节点在其可视矩形上方覆盖它。**并且**列出本页所有 `width('100%')` 且 `height('100%')`(或等效撑满)的容器,逐个标注它是可交互的、还是已声明 `hitTestBehavior(HitTestMode.None)`。「视觉不重叠」与「命中不被遮挡」是两件事:透明或贴底的容器在视觉检查中不构成遮挡,却能吞掉其下全部点击。此项漏检的典型表现是元素显示正常、点击无任何反应(含控制台无输出),因为事件被上层节点消费而该节点自身没有 `onClick`。 撑满层是否吞点击由检查器按层叠结构判定:`stack-swallows-taps` / `fullsize-container` 的 GATE 只能改代码或写检查器核验的 `// HIT-TEST:` 标记关闭,这里写的证据文字不算;本项只需为剩下的 CAND 逐条标注依据。
|
|
308
312
|
|
|
@@ -108,6 +108,10 @@
|
|
|
108
108
|
| `ArrayAdapter` | `ForEach` + 数组 | 数组适配器 |
|
|
109
109
|
| `BaseAdapter` | `ForEach` / `LazyForEach` | 基础适配器 |
|
|
110
110
|
|
|
111
|
+
### 瀑布流不能拆成两个按下标分配的 Column
|
|
112
|
+
|
|
113
|
+
`LazyVerticalStaggeredGrid` / `StaggeredGridLayoutManager` 每次把下一项放进**当前最短**的那一列。用 `Row` 包两个 `Column`、按下标奇偶分配数据(`for (let i = lane; …; i += 2)`),每列的项数一样,高度却不一样:卡片高度不一时,两列越往下错位越大,用户看到的顺序也和 Android 不同。两个 `Column` 都不懒加载,整段商品区放在一个 `ListItem` 里,加载更多后一次布局全部数据。一律用 `WaterFlow` + `FlowItem`:`columnsTemplate('1fr 1fr')`,整行项(`span = FullLine`)放进 `crossCount: 1` 的分组,网格项放进 `crossCount: 2` 的分组,加载更多的尾部用 `WaterFlow` 的 `footer`。「权重 + 固定间距」只描述了列宽,没有描述放置方式,不能作为两列 `Column` 的依据。GATE `staggered-grid-lanes-by-index`。
|
|
114
|
+
|
|
111
115
|
### Compose Lazy 网格的参数映射(LazyVerticalStaggeredGrid / LazyVerticalGrid → WaterFlow / Grid)
|
|
112
116
|
|
|
113
117
|
组件对应之外,下面几个参数决定间距和整行项,**逐项映射,漏一项就是可见缺陷**(GATE `waterflow-sections-no-gap`):
|
|
@@ -89,7 +89,7 @@ A fresh attempt of the leader withdraws its markers, while a resume keeps them.
|
|
|
89
89
|
**Incremental mode:** the entry page, shared files and conventions already exist. This group's job is to **read and record** the conventions (decorator paradigm, naming, `fontFamily`, resource style, project-wide bans) into the Step 4.4 facts, and to extend the existing shared files. It still runs alone and first, since it is the group most likely to touch the pre-existing shared surface.
|
|
90
90
|
2. After it completes, the remaining host-chain groups run serially and self-contained groups concurrently beside them.
|
|
91
91
|
3. **A self-contained group may not edit the entry page or shared VM/Model; its prompt says so.** If it needs to, it reports that instead of writing. The parent does the wiring in Step 5.5, or reclassifies the group as host-chain on a later run.
|
|
92
|
-
4. **Only the parent writes `batch_progress.json`**: read-modify-write, one group at a time, after each group returns.
|
|
92
|
+
4. **Only the parent writes `batch_progress.json`**: read-modify-write, one group at a time, after each group returns. `Q verified` writes the group's pages `done` itself (below); the parent writes only `failed` pages and notes.
|
|
93
93
|
5. If a group's actual writes violate its class, the parallel assumption is broken: finish serially and record it.
|
|
94
94
|
6. **Captured groups go before the source-only groups that depend on them.** Shared tokens (theme colours, density-derived dimensions, list-row and toolbar components) must come from measured pages. Captures show the light scheme only: when the contract's `theme.mode` is not `static`, a colour token is a `$r('app.color.*')` resource whose dark value comes from the Android dark scheme / `values-night` line it cites, never a hex constant (GATE `theme-color-literal`). A source-only group waits for its `template_groups` and `reuse_from` leaders, not for every captured group. It may extend a value a captured group established, but not change it. Contradicting source evidence is reported (contract item 4), and the parent decides.
|
|
95
95
|
7. **The shared registry surface is parent-owned while any other group is in flight.** Every concurrently dispatched group's prompt states: do not edit `main_pages.json`, `resources/**/element/*.json`, `oh-package*.json5`, `module.json5` or the ability's `loadContent()`. Instead, list the additions in the report under `registry_requests`: `{ "main_pages": ["pages/X"], "elements": { "string": [{"name","value"}], "color": [...], "dark_color": [...], "float": [...] }, "dependencies": {"@ohos/lottie": "<ver>"}, "entry_route": "pages/X" | null }`.
|
|
@@ -135,7 +135,7 @@ Only true dependencies make a group wait (`after`, lane, `reuse_from`, `template
|
|
|
135
135
|
- Parallel `Q` calls are safe: every mutating call holds `.hometrans/queue_state.json.lock`.
|
|
136
136
|
2. **Lease and dispatch.** `Q lease ${harmony_project_dir}` returns `dispatch: [{unit, groups, resume_task, description, message, message_file}]`. `message` is a one-line pointer (`Read the file <message_file> and follow it fully.`), and the full text is in `message_file` (`.hometrans/work/dispatch/<unit>.a<attempt>.md`, one file per attempt). Pass `message` verbatim as the sub-agent prompt, for fresh and resumed sessions alike. `Q message ${harmony_project_dir} --unit <unit>` prints it again while the unit runs. Never rebuild a message yourself or call the script's internal functions. `released_without_dispatch` lists queued resumes whose session had already written its report: they are released without an agent; verify them like any return. For each `dispatch` entry, start one background sub-agent with `message` as its prompt (all in one message; opencode v2 `subagent` with `background: true`, opencode v1 / DevEco `task` with `background: true`). When `resume_task` is set, resume that session instead (opencode v2: `subagent` with `sessionID` = `resume_task`; opencode v1 / DevEco: `task` with `task_id` = `resume_task`; Claude Code: SendMessage to that agent if it is still known, otherwise a fresh agent with the same message). Then `Q bind … --unit <unit> --task <handle>` for each, where `<handle>` is the returned `sessionID` (v2) or `task_id` (v1/DevEco).
|
|
137
137
|
- **Evidence intake (two steps, one session).** A fresh session of a group with screenshots or view trees is leased with `phase: "intake"`: its message lists only that group's evidence (`.hometrans/work/evidence/<GID>.json`: meta.json, every screenshot, every view tree, measure_summary.txt, plus `conversion-procedure.md` with its source-only section named when a member is source-only or an attached node has no capture) and the `evidence_gate.mjs ack` command. It carries no conversion task and no write set, so nothing can be written before the evidence is read. Dispatch and `bind` it like any unit; the agent replies `READY <GID>`. Its release returns `intake-accepted` once every member's ack covers its manifest, and the next `lease` resumes **that same session** (`phase: "convert"`, `resume_task` set) with the full prompt. The evidence it read stays in its context. The continuation is leased before any other unit and keeps its slot and lane. `intake-resume` resumes the session with the files still unread (at most `INTAKE_MAX_ROUNDS` rounds, then `intake-failed`). `intake-unbound` means no `bind` was recorded, so a fresh session reads again: always bind. After `INTAKE_MAX_ROUNDS` unbound intakes the group is `intake-failed`. `intake-recaptured` means a member was captured while the session read: it reads again with the new frames. A queued `RECAPTURED` or `requeue --message` text is held through intake and delivered with the conversion task, and `requeue` after a failed intake starts a new one. A predicted file changed during intake is listed as `touched`, and the conversion message tells the agent to re-check it. A source-only group (no frames) and every resume of a converting session skip intake; `init --no-evidence-gate` turns it off.
|
|
138
|
-
3. **Verify** every group in `summary.returned_unverified` (below). Then
|
|
138
|
+
3. **Verify** every group in `summary.returned_unverified` (below). Then run `Q verified … --group <GID> --summary "<one line>"` (only a `returned` group: never mark a group done in `batch_progress.json` by hand to close it). It marks every page of the group `done` in `batch_progress.json` (`status`, `group`, `verified_at`, `tier`, `output` = the files it wrote plus the `.ets` its report names, `summary`) and refreshes `updated_at`, so the page ledger never trails the queue; it refuses a file that belongs to another run. Then, when `harmony_project_dir` is in a git work tree, `node <this skill>/scripts/group_commit.mjs ${harmony_project_dir} --group <GID>`. The commit takes only the files that group changed and holds other unsettled groups' predicted writes; a file shared by several groups goes to the first one committed.
|
|
139
139
|
- `missing` non-empty: `Q requeue … --group <GID> --resume --message "<missing files; written files are read-only context>"`.
|
|
140
140
|
- Verification failed: `Q requeue … --group <GID> --message "<what to fix>"`. If the group's bound session had stalled, this resumes that session automatically. Use `--fresh` only after that session's completion notice has arrived.
|
|
141
141
|
4. **Capture track** (Step 3.2) work, if any. Then `Q wait ${harmony_project_dir} [--job run_cycle]` (bound reviewers are followed; `--answers` only for unbound files). It returns within seconds of a report, a silent unit, an ended job, complete answers, or an evidence-intake ack that now covers every file (`reasons: ["intake"]`, `intake_acked: [GID…]` — release those groups). It also returns when a free slot has a ready or backfill unit. Otherwise it returns after 9 min. Give the shell call a timeout above that (e.g. 600000 ms). Never sleep in a loop instead.
|
|
@@ -154,7 +154,7 @@ Only true dependencies make a group wait (`after`, lane, `reuse_from`, `template
|
|
|
154
154
|
- the Phase 5 evidence is in the location the output contract assigns it;
|
|
155
155
|
- the parent's own mechanical re-verification passes.
|
|
156
156
|
|
|
157
|
-
Otherwise set it `failed` with what is missing. For `done`,
|
|
157
|
+
Otherwise set it `failed` with what is missing and `requeue` the group. For `done`, run `Q verified --summary` (it records `output`, `summary` and `updated_at`; never write a `done` page by hand, and never defer the write to the end of Step 5), and append the summary to the cumulative report.
|
|
158
158
|
|
|
159
159
|
Phase 5 evidence by tier:
|
|
160
160
|
- **A-tier — written out in full in the report** (one-line conclusions do not count): **窗口模式证据 (all four sub-items), 过渡实现证据, 装饰重复检查, 可见资源闭环, 位置锚点证据**. Their failure mode is two individually-correct rules combining into an error, which only shows when the reasoning chain is spelled out.
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
* node group_queue.mjs wait <harmony_dir> [--timeout-s 540] [--job run_cycle]
|
|
78
78
|
* node group_queue.mjs status <harmony_dir>
|
|
79
79
|
* node group_queue.mjs refresh <harmony_dir> [--force] # rebuild a plan behind the captures
|
|
80
|
-
* node group_queue.mjs verified <harmony_dir> --group G007
|
|
80
|
+
* node group_queue.mjs verified <harmony_dir> --group G007 [--summary "..."] # also marks its pages done
|
|
81
81
|
* node group_queue.mjs requeue <harmony_dir> --group G007 [--message "..."] [--resume | --fresh]
|
|
82
82
|
* node group_queue.mjs stop <harmony_dir>
|
|
83
83
|
*
|
|
@@ -274,6 +274,50 @@ export function progressMismatch(hp) {
|
|
|
274
274
|
return why.join('; ');
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
/**
|
|
278
|
+
* `verified`: mark every page of group `gid` done in batch_progress.json, so the page ledger can no
|
|
279
|
+
* longer trail the queue. Measured: parents verified and committed group after group with every page
|
|
280
|
+
* still `pending`, and filled the file in once at the end; a run interrupted before that re-converted
|
|
281
|
+
* finished groups on resume (_progressDone found nothing done).
|
|
282
|
+
* `output`: the group's written files (s.written) plus the .ets files its report names, as
|
|
283
|
+
* `<module>/src/main/ets/<rel>` (the form phase5_check.mjs reads back). An existing entry keeps its
|
|
284
|
+
* other fields; `summary` replaces the old one only when given. `tier` is the group's, unless it
|
|
285
|
+
* mixes tiers. Throws (so the caller saves no state) when the file belongs to another run.
|
|
286
|
+
*/
|
|
287
|
+
export function markProgressDone(hp, gid, s, summary = null) {
|
|
288
|
+
const why = progressMismatch(hp);
|
|
289
|
+
if (why) throw new ac.SystemExit(`batch_progress.json belongs to another run (${why}): ${gid} not marked verified`);
|
|
290
|
+
const [, ets, uiInfo] = gw._paths(hp);
|
|
291
|
+
const g = gw._groups(uiInfo).get(gid);
|
|
292
|
+
if (g === undefined) throw new ac.SystemExit(`unknown group id in conversion_set.json: ${gid}`);
|
|
293
|
+
const dirs = ac.or(ac.get(g, 'page_dirs'), []);
|
|
294
|
+
const pf = path.join(_meta(hp), 'batch_progress.json');
|
|
295
|
+
return gw._locked(pf, () => {
|
|
296
|
+
const prog = ac.or(gw._load(pf, {}), {});
|
|
297
|
+
const module = gw._uiModule(hp, prog);
|
|
298
|
+
const full = (rel) => {
|
|
299
|
+
const r = String(rel).replace(/\\/g, '/').replace(/^\.\//, '');
|
|
300
|
+
return r.includes('/src/main/ets/') ? r : `${module}/src/main/ets/${r}`;
|
|
301
|
+
};
|
|
302
|
+
const named = gw._reported(ets, _report(hp, gid, 0), hp);
|
|
303
|
+
const outs = [...new Set([...ac.or(ac.get(s, 'written'), []), ...named].map(full))].sort();
|
|
304
|
+
const pages = ac.isDict(prog.pages) ? prog.pages : {};
|
|
305
|
+
const at = new Date().toISOString();
|
|
306
|
+
for (const d of dirs) {
|
|
307
|
+
const row = { ...(ac.isDict(pages[d]) ? pages[d] : {}), status: 'done', group: gid, verified_at: at };
|
|
308
|
+
delete row.error;
|
|
309
|
+
if (outs.length) row.output = outs.length === 1 ? outs[0] : outs;
|
|
310
|
+
if (!ac.truthy(ac.get(g, 'mixed_tier')) && ac.truthy(ac.get(g, 'tier'))) row.tier = g.tier;
|
|
311
|
+
if (ac.truthy(summary)) row.summary = String(summary);
|
|
312
|
+
pages[d] = row;
|
|
313
|
+
}
|
|
314
|
+
prog.pages = pages;
|
|
315
|
+
prog.updated_at = at;
|
|
316
|
+
gw._replace(pf, `${JSON.stringify(prog, null, 2)}\n`);
|
|
317
|
+
return { pages_done: dirs, output: outs };
|
|
318
|
+
}, { what: 'batch_progress.json' });
|
|
319
|
+
}
|
|
320
|
+
|
|
277
321
|
/** Every member page already `done` in batch_progress.json (an earlier run of this identity). */
|
|
278
322
|
export function _progressDone(hp, group, checked = false) {
|
|
279
323
|
if (!checked && progressMismatch(hp)) return false; // initState checked it once already
|
|
@@ -2155,6 +2199,7 @@ export function control(hp, cmd) {
|
|
|
2155
2199
|
+ `or \`requeue\` it if it failed.`);
|
|
2156
2200
|
} else {
|
|
2157
2201
|
s.state = 'verified';
|
|
2202
|
+
out.progress = markProgressDone(hp, gid, s, ac.get(cmd, 'summary'));
|
|
2158
2203
|
}
|
|
2159
2204
|
} else if (cmd.op === 'requeue') {
|
|
2160
2205
|
if (s.state === 'running') throw new ac.SystemExit(`${gid} is running: release it first`);
|
|
@@ -2359,7 +2404,7 @@ total throughput instead (~1.3 turns/min measured earlier) wants a lower --width
|
|
|
2359
2404
|
group_queue.mjs wait <harmony_dir> [--timeout-s 540] [--job run_cycle] [--answers <file>]
|
|
2360
2405
|
group_queue.mjs status <harmony_dir>
|
|
2361
2406
|
group_queue.mjs refresh <harmony_dir> [--force]
|
|
2362
|
-
group_queue.mjs verified <harmony_dir> --group G007
|
|
2407
|
+
group_queue.mjs verified <harmony_dir> --group G007 [--summary "..."] # also marks its pages done in batch_progress.json
|
|
2363
2408
|
group_queue.mjs requeue <harmony_dir> --group G007 [--message "..."] [--resume | --fresh]
|
|
2364
2409
|
group_queue.mjs stop <harmony_dir>
|
|
2365
2410
|
|
|
@@ -2417,6 +2462,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2417
2462
|
help: 'wait: also return when this answers file is complete; review-bind: the answers path of the part' },
|
|
2418
2463
|
{ flags: ['--group'] },
|
|
2419
2464
|
{ flags: ['--message'], help: 'extra instruction for a requeued group' },
|
|
2465
|
+
{ flags: ['--summary'], help: "verified: one-line summary recorded on the group's pages in batch_progress.json" },
|
|
2420
2466
|
{ flags: ['--resume'], action: 'store_true', help: 'requeue into the same session (default when it stalled)' },
|
|
2421
2467
|
{ flags: ['--fresh'], action: 'store_true',
|
|
2422
2468
|
help: 'requeue as a new session even though its bound session stalled (stop/await that session first)' },
|
|
@@ -2459,7 +2505,7 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
2459
2505
|
} else {
|
|
2460
2506
|
if (!a.group) error(`${a.mode} requires --group`);
|
|
2461
2507
|
if (a.resume && a.fresh) error('requeue: --resume and --fresh exclude each other');
|
|
2462
|
-
out = control(hp, { op: a.mode, group: a.group, message: a.message, resume: a.resume, fresh: a.fresh });
|
|
2508
|
+
out = control(hp, { op: a.mode, group: a.group, message: a.message, resume: a.resume, fresh: a.fresh, summary: a.summary });
|
|
2463
2509
|
}
|
|
2464
2510
|
ac.printJson(out, 1);
|
|
2465
2511
|
}
|
|
@@ -309,3 +309,39 @@ function resolveTheme(dir: string): AndroidTheme {
|
|
|
309
309
|
}
|
|
310
310
|
return out;
|
|
311
311
|
}
|
|
312
|
+
|
|
313
|
+
const STEMS_WHERE_CACHE: Map<string, Set<string>> = new Map();
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Stems (file names without extension) of the Android kt/java files whose source satisfies pred, cached per
|
|
317
|
+
* (dir, key). Unlike grepAndroidSource it sees the whole file, so a rule can require one construct and exclude another.
|
|
318
|
+
*/
|
|
319
|
+
export function androidStemsWhere(dir: string, key: string, quick: string, pred: (src: string) => boolean): Set<string> {
|
|
320
|
+
const cacheKey: string = path.resolve(dir) + '\u0000' + key;
|
|
321
|
+
const hit: Set<string> | undefined = STEMS_WHERE_CACHE.get(cacheKey);
|
|
322
|
+
if (hit !== undefined) { return hit; }
|
|
323
|
+
const out: Set<string> = new Set();
|
|
324
|
+
for (const f of androidFiles(dir)) {
|
|
325
|
+
if (!/\.(kt|java)$/.test(f.name)) { continue; }
|
|
326
|
+
const src: string = f.read();
|
|
327
|
+
if (!src.includes(quick)) { continue; }
|
|
328
|
+
// import / package lines and comments name a construct without using it
|
|
329
|
+
const body: string = src.split('\n').filter((l) => !/^\s*(import|package)\b/.test(l) && !/^\s*(\/\/|\*)/.test(l)).join('\n');
|
|
330
|
+
if (pred(body)) { out.add(f.name.replace(/\.(kt|java)$/, '')); }
|
|
331
|
+
}
|
|
332
|
+
STEMS_WHERE_CACHE.set(cacheKey, out);
|
|
333
|
+
return out;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* The first of stems that this .ets file ports: the file has that stem as its name, or cites `<stem>.kt` / `.java`.
|
|
338
|
+
* null when none — a construct somewhere else in the Android project says nothing about this file.
|
|
339
|
+
*/
|
|
340
|
+
export function portedAndroidStem(abs: string, src: string, stems: Set<string>): string | null {
|
|
341
|
+
const base: string = path.basename(abs).replace(/\.ets$/, '');
|
|
342
|
+
for (const stem of stems) {
|
|
343
|
+
if (stem === base) { return stem; }
|
|
344
|
+
if (new RegExp('(?<![\\w$])' + stem.replace(/\$/g, '\\$') + '\\.(?:kt|java)\\b').test(src)) { return stem; }
|
|
345
|
+
}
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
@@ -20,6 +20,7 @@ import { checkFormatStringWithoutArgs } from './rules/format_string.ts';
|
|
|
20
20
|
import { checkFrameworkDialogAppearance } from './rules/framework_dialog.ts';
|
|
21
21
|
import { checkFrameworkPickerAppearance } from './rules/framework_picker.ts';
|
|
22
22
|
import { checkPctAutoRoots, checkStackCustomKids } from './rules/layout_placement.ts';
|
|
23
|
+
import { checkOverlayInLinearContainer } from './rules/overlay_in_linear.ts';
|
|
23
24
|
import { checkMediaContentUsable } from './rules/media_content.ts';
|
|
24
25
|
import { checkFullViewportTint, checkRasterTint, checkSvgTintChannel } from './rules/media_tint.ts';
|
|
25
26
|
import { checkOffsetInScrollContent } from './rules/offset_in_scroll.ts';
|
|
@@ -37,6 +38,9 @@ import { checkStackOccludingSibling, loadColors } from './rules/stack_occluding.
|
|
|
37
38
|
import { checkHitTest } from './rules/hit_test.ts';
|
|
38
39
|
import { checkEventDefaultClick } from './rules/event_default_click.ts';
|
|
39
40
|
import { checkWaterFlowSectionGaps } from './rules/waterflow_sections.ts';
|
|
41
|
+
import { checkStaggeredLanes } from './rules/staggered_lanes.ts';
|
|
42
|
+
import { checkSelfDrawnSheet } from './rules/self_drawn_sheet.ts';
|
|
43
|
+
import { checkWindowSizeConstant } from './rules/window_size_constant.ts';
|
|
40
44
|
import { checkLottieHost } from './rules/lottie_host.ts';
|
|
41
45
|
import { checkStringResources } from './rules/string_quote_leak.ts';
|
|
42
46
|
import { checkSurfaceStroke } from './rules/surface_stroke.ts';
|
|
@@ -137,6 +141,7 @@ export function main(): void {
|
|
|
137
141
|
checkRootWeightWrapped(scans);
|
|
138
142
|
checkPctAutoRoots(scans);
|
|
139
143
|
checkStackCustomKids(scans);
|
|
144
|
+
checkOverlayInLinearContainer(scans);
|
|
140
145
|
checkSharedChromePlacement(scans);
|
|
141
146
|
checkPercentHeightInScroll(scans);
|
|
142
147
|
checkRelativeContainerInScroll(scans);
|
|
@@ -147,6 +152,9 @@ export function main(): void {
|
|
|
147
152
|
checkHitTest(scans);
|
|
148
153
|
checkEventDefaultClick(scans);
|
|
149
154
|
checkWaterFlowSectionGaps(scans, androidDir);
|
|
155
|
+
checkStaggeredLanes(scans, androidDir);
|
|
156
|
+
checkSelfDrawnSheet(scans, androidDir);
|
|
157
|
+
checkWindowSizeConstant(scans, androidDir);
|
|
150
158
|
checkOffsetInScrollContent(scans);
|
|
151
159
|
checkEntryRoute(scans, etsRoots);
|
|
152
160
|
checkRequestPermissions(etsRoots, argOf('--sdk') || process.env.DEVECO_SDK_HOME || '');
|
|
@@ -28,6 +28,7 @@ import { meta as mediaContent } from './rules/media_content.ts';
|
|
|
28
28
|
import { meta as mediaTint } from './rules/media_tint.ts';
|
|
29
29
|
import { meta as offsetInScroll } from './rules/offset_in_scroll.ts';
|
|
30
30
|
import { meta as overlayBinds } from './rules/overlay_binds.ts';
|
|
31
|
+
import { meta as overlayInLinear } from './rules/overlay_in_linear.ts';
|
|
31
32
|
import { meta as orphanComponent } from './rules/orphan_component.ts';
|
|
32
33
|
import { meta as paddingInSize } from './rules/padding_in_size.ts';
|
|
33
34
|
import { meta as inputTraps } from './rules/input_traps.ts';
|
|
@@ -51,6 +52,9 @@ import { meta as stackOccluding } from './rules/stack_occluding.ts';
|
|
|
51
52
|
import { meta as hitTest } from './rules/hit_test.ts';
|
|
52
53
|
import { meta as eventDefaultClick } from './rules/event_default_click.ts';
|
|
53
54
|
import { meta as waterflowSections } from './rules/waterflow_sections.ts';
|
|
55
|
+
import { meta as staggeredLanes } from './rules/staggered_lanes.ts';
|
|
56
|
+
import { meta as selfDrawnSheet } from './rules/self_drawn_sheet.ts';
|
|
57
|
+
import { meta as windowSizeConstant } from './rules/window_size_constant.ts';
|
|
54
58
|
import { meta as stateDecorators } from './rules/state_decorators.ts';
|
|
55
59
|
import { meta as stateNameShadows } from './rules/state_name_shadows.ts';
|
|
56
60
|
import { meta as stringQuoteLeak } from './rules/string_quote_leak.ts';
|
|
@@ -91,6 +95,7 @@ export const MODULE_META: { module: string; meta: RuleMeta[] }[] = [
|
|
|
91
95
|
{ module: 'rules/media_tint.ts', meta: mediaTint },
|
|
92
96
|
{ module: 'rules/offset_in_scroll.ts', meta: offsetInScroll },
|
|
93
97
|
{ module: 'rules/overlay_binds.ts', meta: overlayBinds },
|
|
98
|
+
{ module: 'rules/overlay_in_linear.ts', meta: overlayInLinear },
|
|
94
99
|
{ module: 'rules/orphan_component.ts', meta: orphanComponent },
|
|
95
100
|
{ module: 'rules/padding_in_size.ts', meta: paddingInSize },
|
|
96
101
|
{ module: 'rules/input_traps.ts', meta: inputTraps },
|
|
@@ -114,6 +119,9 @@ export const MODULE_META: { module: string; meta: RuleMeta[] }[] = [
|
|
|
114
119
|
{ module: 'rules/hit_test.ts', meta: hitTest },
|
|
115
120
|
{ module: 'rules/event_default_click.ts', meta: eventDefaultClick },
|
|
116
121
|
{ module: 'rules/waterflow_sections.ts', meta: waterflowSections },
|
|
122
|
+
{ module: 'rules/staggered_lanes.ts', meta: staggeredLanes },
|
|
123
|
+
{ module: 'rules/self_drawn_sheet.ts', meta: selfDrawnSheet },
|
|
124
|
+
{ module: 'rules/window_size_constant.ts', meta: windowSizeConstant },
|
|
117
125
|
{ module: 'rules/state_decorators.ts', meta: stateDecorators },
|
|
118
126
|
{ module: 'rules/state_name_shadows.ts', meta: stateNameShadows },
|
|
119
127
|
{ module: 'rules/string_quote_leak.ts', meta: stringQuoteLeak },
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// static_check/rules/overlay_in_linear.ts — GATE overlay-component-in-linear-container.
|
|
2
|
+
|
|
3
|
+
import { report } from '../core/findings.ts';
|
|
4
|
+
import { directUiChildren, exclusiveBranches, expandStyles, fullOnAxis, hasAttr, lineOfIndex, markedAbove, matchBracket, styleDecls } from '../core/parse.ts';
|
|
5
|
+
import type { UiAttr, UiChild } from '../core/parse.ts';
|
|
6
|
+
import { maskedOf } from '../core/scan.ts';
|
|
7
|
+
import type { FileScan } from '../core/scan.ts';
|
|
8
|
+
import type { RuleMeta } from '../core/meta.ts';
|
|
9
|
+
import { BUILTIN_KINDS, structDeclFile } from './layout_placement.ts';
|
|
10
|
+
|
|
11
|
+
/** Rule metadata (rendered by scripts/gen_rule_docs.mjs). */
|
|
12
|
+
export const meta: RuleMeta[] = [
|
|
13
|
+
{
|
|
14
|
+
id: "overlay-component-in-linear-container",
|
|
15
|
+
levels: ["GATE", "CAND"],
|
|
16
|
+
invariant: "geometry",
|
|
17
|
+
card: "geometry",
|
|
18
|
+
needs: [],
|
|
19
|
+
summary: "`Row`/`Column` 的直接子节点(含 if/else 分支内)是本工程的弹层组件 —— 其 build() 根节点宽高都是 `'100%'`,且在没有(非空)else 的 `if (...)` 里按标志显示或带 `.transition(`(if/else 状态切换视图不算);同一容器里还有不互斥的兄弟,调用处没有 position/offset/markAnchor/layoutWeight/flexGrow。跨文件判定,穿过包名 import 与包装组件。",
|
|
20
|
+
fix: "弹层是叠加层,不参与线性排布:把它移成 `Stack` / `RelativeContainer` 的直接子节点(排在内容之后,与内容兄弟同级),或改用 `bindSheet` / `bindContentCover` / `openCustomDialog`。为强制重建子树而包一层 `ForEach`/`Column` 时只包需要重建的内容,弹层留在外层 `Stack`。确实要占线性位置的(例如内联展开面板),在调用处上方写 `// OVERLAY-IN-FLOW: <依据>` 降为 CAND。",
|
|
21
|
+
escape: "// OVERLAY-IN-FLOW:",
|
|
22
|
+
cases: [
|
|
23
|
+
"实测(ds-1123 Weather):review 修复轮为切语言重建内容树,把壳页 `Stack` 里的内容与搜索弹层一起包进 `ForEach([uiRevision]) { Column() {...} }`;`SearchMenuFragmentDialog`(根 `if (visible) { Stack().width('100%').height('100%').transition(...) }`)排在 100% 高的内容页之后,落到视口外,点搜索后面板不出现。编译、Homecheck、冒烟都过,round 2 复审判 FAIL 后编排未再修复。",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
/** What makes a struct an overlay: its build() root fills both axes and is shown on a flag or animates in. */
|
|
29
|
+
interface OverlayRoot {
|
|
30
|
+
/** File and line of the root statement, for the report. */
|
|
31
|
+
file: FileScan;
|
|
32
|
+
line: number;
|
|
33
|
+
/** Wrapper structs walked through (Outer → Inner). */
|
|
34
|
+
via: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Bounds of `build() { … }` inside `struct <name> { … }` in code, or null. */
|
|
38
|
+
function buildBody(code: string, name: string): [number, number] | null {
|
|
39
|
+
const re: RegExp = new RegExp('\\bstruct\\s+' + name + '\\b[^{]*\\{', 'g');
|
|
40
|
+
const m: RegExpExecArray | null = re.exec(code);
|
|
41
|
+
if (m === null) { return null; }
|
|
42
|
+
const open: number = m.index + m[0].length - 1;
|
|
43
|
+
const close: number = matchBracket(code, open);
|
|
44
|
+
if (close < 0) { return null; }
|
|
45
|
+
const bm: RegExpExecArray | null = /\bbuild\s*\(\s*\)\s*(?::\s*void\s*)?\{/.exec(code.slice(open, close));
|
|
46
|
+
if (bm === null) { return null; }
|
|
47
|
+
const bOpen: number = open + bm.index + bm[0].length - 1;
|
|
48
|
+
const bClose: number = matchBracket(code, bOpen);
|
|
49
|
+
return bClose < 0 ? null : [bOpen, bClose];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const PLACED: string[] = ['position', 'offset', 'markAnchor', 'alignRules'];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The root is shown on a flag: some `if` it sits in has no other branch drawing anything (no `else`, or an empty one).
|
|
56
|
+
* A root in an if / else chain whose other branch draws something is a state switch (empty view ↔ list), not an
|
|
57
|
+
* overlay: the component always occupies its place, it only changes what it draws there.
|
|
58
|
+
*/
|
|
59
|
+
function flagShown(r: UiChild, all: UiChild[]): boolean {
|
|
60
|
+
return (r.branchPath ?? []).some(([chain, idx]) => !all.some((o) => o !== r &&
|
|
61
|
+
(o.branchPath ?? []).some(([c, i]) => c === chain && i !== idx)));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Whether struct `comp` (seen from `from`) renders as an overlay. Wrapper components whose only root is another
|
|
66
|
+
* custom component are followed (up to `depth` levels); the wrapper may be the one that adds the flag.
|
|
67
|
+
*/
|
|
68
|
+
function overlayRootOf(scans: FileScan[], declCount: Map<string, number>, from: FileScan, comp: string,
|
|
69
|
+
via: string[] = [], conditional: boolean = false, depth: number = 4): OverlayRoot | undefined {
|
|
70
|
+
if (depth <= 0 || via.includes(comp)) { return undefined; }
|
|
71
|
+
const file: FileScan | undefined = structDeclFile(scans, declCount, from, comp);
|
|
72
|
+
if (file === undefined) { return undefined; }
|
|
73
|
+
const body: [number, number] | null = buildBody(file.code, comp);
|
|
74
|
+
if (body === null) { return undefined; }
|
|
75
|
+
const all: UiChild[] = directUiChildren(file.code, body[0], body[1], undefined, { intoBranches: true });
|
|
76
|
+
const roots: UiChild[] = all.filter((c) => c.control !== true);
|
|
77
|
+
if (roots.length === 0) { return undefined; }
|
|
78
|
+
const styles = styleDecls(file.code, maskedOf(file));
|
|
79
|
+
for (const r of roots) {
|
|
80
|
+
const a: UiAttr[] = expandStyles(file.code, styles, r.attrs, r.at);
|
|
81
|
+
if (PLACED.some((n) => hasAttr(a, n))) { continue; }
|
|
82
|
+
const shown: boolean = conditional || flagShown(r, all) || hasAttr(a, 'transition');
|
|
83
|
+
if (fullOnAxis(a, 'width') && fullOnAxis(a, 'height') && shown) {
|
|
84
|
+
return { file, line: lineOfIndex(file.code, r.at), via: [...via, comp] };
|
|
85
|
+
}
|
|
86
|
+
if (roots.length === 1 && !r.isBuilderCall && /^[A-Z]/.test(r.name) && !BUILTIN_KINDS.has(r.name)) {
|
|
87
|
+
return overlayRootOf(scans, declCount, file, r.name, [...via, comp], shown, depth - 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* GATE overlay-component-in-linear-container: an overlay component (full-size root shown on a flag / animated in)
|
|
95
|
+
* sits in a Row / Column next to siblings that are on screen at the same time.
|
|
96
|
+
*
|
|
97
|
+
* A Row / Column lays its children out one after another on the main axis; percentages are resolved against the
|
|
98
|
+
* parent and not shared, and children do not shrink by default. An overlay placed after a full-size content sibling
|
|
99
|
+
* therefore starts at y = 100% (below the viewport); placed before it, it pushes the content out while it is shown.
|
|
100
|
+
* Either way the flag flips, the tap handler runs, and nothing visible appears — compile, Homecheck and cold-start
|
|
101
|
+
* smoke all pass, because none of them taps the entry.
|
|
102
|
+
*
|
|
103
|
+
* The overlay's root usually lives in another module (imported by package name), so the call site alone shows
|
|
104
|
+
* nothing wrong; this is decided across files. Children in different branches of one if / else chain are never on
|
|
105
|
+
* screen together and do not count as siblings.
|
|
106
|
+
*/
|
|
107
|
+
export function checkOverlayInLinearContainer(scans: FileScan[]): void {
|
|
108
|
+
const declCount: Map<string, number> = new Map();
|
|
109
|
+
for (const s of scans) {
|
|
110
|
+
for (const n of s.declaredStructs) { declCount.set(n, (declCount.get(n) || 0) + 1); }
|
|
111
|
+
}
|
|
112
|
+
const cache: Map<string, OverlayRoot | null> = new Map();
|
|
113
|
+
for (const s of scans) {
|
|
114
|
+
const rawLines: string[] = s.src.split(/\r?\n/);
|
|
115
|
+
// Find containers in the string-masked text (same length as code), so `Column(` inside a string never matches.
|
|
116
|
+
const masked: string = maskedOf(s);
|
|
117
|
+
const styles = styleDecls(s.code, masked);
|
|
118
|
+
const re: RegExp = /(^|[^\w$.])(Row|Column)\s*\(/g;
|
|
119
|
+
let m: RegExpExecArray | null;
|
|
120
|
+
while ((m = re.exec(masked)) !== null) {
|
|
121
|
+
const paren: number = m.index + m[0].length - 1;
|
|
122
|
+
const pclose: number = matchBracket(masked, paren);
|
|
123
|
+
if (pclose < 0) { continue; }
|
|
124
|
+
let k: number = pclose + 1;
|
|
125
|
+
while (k < masked.length && /\s/.test(masked[k])) { k++; }
|
|
126
|
+
if (masked[k] !== '{') { continue; }
|
|
127
|
+
const close: number = matchBracket(masked, k);
|
|
128
|
+
if (close < 0) { continue; }
|
|
129
|
+
const kids: UiChild[] = directUiChildren(s.code, k, close, undefined, { intoBranches: true })
|
|
130
|
+
.filter((c) => c.control !== true);
|
|
131
|
+
if (kids.length < 2) { continue; }
|
|
132
|
+
for (const c of kids) {
|
|
133
|
+
if (c.isBuilderCall || !/^[A-Z]/.test(c.name) || BUILTIN_KINDS.has(c.name)) { continue; }
|
|
134
|
+
const ca: UiAttr[] = expandStyles(s.code, styles, c.attrs, c.at);
|
|
135
|
+
if (PLACED.some((n) => hasAttr(ca, n))) { continue; }
|
|
136
|
+
// A weighted child takes only the space its siblings leave; it is never pushed past the viewport.
|
|
137
|
+
if (hasAttr(ca, 'layoutWeight') || hasAttr(ca, 'flexGrow')) { continue; }
|
|
138
|
+
const others: UiChild[] = kids.filter((o) => o !== c && !exclusiveBranches(c, o));
|
|
139
|
+
if (others.length === 0) { continue; }
|
|
140
|
+
const key: string = `${s.abs}\u0000${c.name}`;
|
|
141
|
+
let ov: OverlayRoot | null | undefined = cache.get(key);
|
|
142
|
+
if (ov === undefined) {
|
|
143
|
+
ov = overlayRootOf(scans, declCount, s, c.name) ?? null;
|
|
144
|
+
cache.set(key, ov);
|
|
145
|
+
}
|
|
146
|
+
if (ov === null) { continue; }
|
|
147
|
+
const line: number = lineOfIndex(s.code, c.at);
|
|
148
|
+
const kind: string = m[2];
|
|
149
|
+
// Siblings after it are pushed out while it shows; with every sibling before it, it starts past their end.
|
|
150
|
+
const pushes: boolean = others.some((o) => o.at > c.at);
|
|
151
|
+
const chain: string = ov.via.length > 1 ? ` (through ${ov.via.join(' → ')})` : '';
|
|
152
|
+
report(markedAbove(rawLines, line, 'OVERLAY-IN-FLOW') ? 'CAND' : 'GATE',
|
|
153
|
+
'overlay-component-in-linear-container', s.rel, line,
|
|
154
|
+
`${c.name}(…) is an overlay — its build() root (${ov.file.rel}:${ov.line}${chain}) is '100%' × '100%' and shown on a flag / ` +
|
|
155
|
+
`animated in — but it is a child of a ${kind} next to siblings that are on screen at the same time. ` +
|
|
156
|
+
`A ${kind} lays children out one after another and does not shrink them, so the overlay ` +
|
|
157
|
+
(pushes ? 'pushes the content out of view while it is shown' : 'is laid out after its siblings, below the viewport, and never appears') +
|
|
158
|
+
'. Make it a direct child of a Stack / RelativeContainer (after the content), or use bindSheet / bindContentCover / ' +
|
|
159
|
+
'openCustomDialog; when a ForEach / Column wrapper exists only to rebuild the content, wrap the content alone. ' +
|
|
160
|
+
'When it really takes a place in the flow, write // OVERLAY-IN-FLOW: <basis> above the call');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|