feat: unify project responsive layouts

This commit is contained in:
rain
2026-07-21 20:59:10 +08:00
parent a0d19f4aab
commit 5d99bae3f2
94 changed files with 2324 additions and 404 deletions
@@ -0,0 +1,152 @@
# 全项目通用提示文案实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 清除全项目输入提示、示例和辅助说明中的具体人物或家族名称,同时完整保留页面模拟数据。
**Architecture:** 新增一个只扫描用户提示上下文的 PowerShell 合同,作为规则唯一验证入口。生产改动限定在 G03、G08 与共享 `TreeMemberForm` 的六处提示文案,不触碰任何 fixture、卡片或详情数据。
**Tech Stack:** uni-app、Vue 3、PowerShell 静态合同、现有页面合同、MuMu、ADB。
## Global Constraints
- 只检查 `placeholder`、带“例如/比如/如:”的示例和输入框附近辅助说明。
- 模拟数据、成员目录、详情卡、申请记录和测试输入值保持不变。
- G08 使用“某某某堂侄”表达关系格式;其他字段优先使用动作型提示。
- 不执行 Git 操作,不启用多代理。
- 最终视觉结论只依据 MuMu 原生画面。
---
### Task 1: 建立提示文案全项目合同
**Files:**
- Create: `tests/generic-guidance-copy-contract.ps1`
**Interfaces:**
- Consumes: `pages/**/*.vue``components/**/*.vue` 中的用户提示文案。
- Produces: 只针对提示上下文禁止具体姓名的项目级合同。
- [ ] **Step 1: 写入失败合同**
创建 `tests/generic-guidance-copy-contract.ps1`
```powershell
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$vueFiles = @(
Get-ChildItem -LiteralPath (Join-Path $root 'pages') -Recurse -Filter '*.vue'
Get-ChildItem -LiteralPath (Join-Path $root 'components') -Recurse -Filter '*.vue'
)
$specificCopy = @('汤正华', '汤正国', '汤文远', '汤氏家谱', '如:汤')
foreach ($file in $vueFiles) {
$lineNumber = 0
foreach ($line in Get-Content -LiteralPath $file.FullName -Encoding utf8) {
$lineNumber += 1
if ($line -notmatch 'placeholder|例如|比如|如:') { continue }
foreach ($token in $specificCopy) {
if ($line.Contains($token)) {
throw "User guidance must not contain specific copy '$token': $($file.FullName):$lineNumber"
}
}
}
}
$g08 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g08-join-application.vue') -Raw -Encoding utf8
foreach ($required in @('placeholder="例如:某某某堂侄"', '请以家谱中一位已知长辈为参照,例如:某某某堂侄')) {
if (-not $g08.Contains($required)) { throw "G08 generic relationship guidance missing: $required" }
}
Write-Output 'GENERIC-GUIDANCE-COPY-CONTRACT PASS'
```
- [ ] **Step 2: 运行合同并确认 RED**
```powershell
& powershell -ExecutionPolicy Bypass -File tests/generic-guidance-copy-contract.ps1
```
Expected: FAIL,首先报告 G03、G08 或 `TreeMemberForm` 仍含具体提示文案。
### Task 2: 替换六处提示并回归
**Files:**
- Modify: `pages/genealogy/g03-create-genealogy.vue`
- Modify: `pages/genealogy/g08-join-application.vue`
- Modify: `components/tree/TreeMemberForm.vue`
**Interfaces:**
- Consumes: Task 1 的提示文案合同。
- Produces: 不含具体姓名的动作型提示与通用关系示例。
- [ ] **Step 1: 做六处精确替换**
`pages/genealogy/g03-create-genealogy.vue`
```vue
placeholder="请输入姓氏"
placeholder="请输入家谱名称"
```
`pages/genealogy/g08-join-application.vue`
```vue
placeholder="例如:某某某堂侄"
```
```text
请以家谱中一位已知长辈为参照,例如:某某某堂侄
```
`components/tree/TreeMemberForm.vue`
```js
{ key: "name", label: "姓名", placeholder: "请输入首位成员姓名" },
{ key: "source", label: "当前成员", placeholder: "请选择当前成员" },
```
- [ ] **Step 2: 运行静态合同**
```powershell
$tests = @(
'tests/generic-guidance-copy-contract.ps1',
'tests/g03-create-flow-contract.ps1',
'tests/g03-visual-states-contract.ps1',
'tests/g08-g10-application-flow-contract.ps1',
'tests/g08-document-flow-contract.ps1',
'tests/tree-member-form-document-flow-contract.ps1'
)
foreach ($test in $tests) { & powershell -ExecutionPolicy Bypass -File $test }
```
Expected: 六项全部输出各自 `PASS`
- [ ] **Step 3: 运行 G08 流程回归**
```powershell
node tests/g08-g10-application-flow-runtime-smoke.js http://localhost:5173
```
Expected: 输出 `G08-G10-APPLICATION-FLOW-RUNTIME-SMOKE PASS`。若 H5 服务未运行,记录为环境阻塞,不用浏览器截图代替 MuMu 视觉验收。
### Task 3: MuMu 原生复核
**Files:**
- Create: `tmp/G08-generic-guidance-native.png`
**Interfaces:**
- Consumes: 已同步到 MuMu 的 G08 最新页面。
- Produces: 通用关系提示的原生证据。
- [ ] **Step 1: 捕获 G08 当前画面**
```powershell
$adb = 'C:\Users\Administrator\Desktop\HBuilderX\plugins\launcher-tools\tools\adbs\adb.exe'
& $adb -s emulator-5554 shell screencap -p /sdcard/G08-generic-guidance-native.png
& $adb -s emulator-5554 pull /sdcard/G08-generic-guidance-native.png tmp/G08-generic-guidance-native.png
```
- [ ] **Step 2: 检查并交给用户确认**
使用 `view_image` 原图确认关系输入和下方辅助说明都显示“某某某堂侄”,页面不再出现具体人物姓名。只报告当前默认状态,不把未查看的校验或提交结果状态标记为通过。