From 67edbe20776697b869c8707f50beafe6f39b0f4f Mon Sep 17 00:00:00 2001 From: duanshuwen Date: Thu, 27 Aug 2026 09:46:18 +0800 Subject: [PATCH] docs: add lead detail dialog implementation plan --- .../2026-08-27-leads-detail-dialog-plan.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 docs/superpowers/plans/2026-08-27-leads-detail-dialog-plan.md diff --git a/docs/superpowers/plans/2026-08-27-leads-detail-dialog-plan.md b/docs/superpowers/plans/2026-08-27-leads-detail-dialog-plan.md new file mode 100644 index 0000000..bd348c9 --- /dev/null +++ b/docs/superpowers/plans/2026-08-27-leads-detail-dialog-plan.md @@ -0,0 +1,181 @@ +# 线索详情弹窗视觉优化 Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** 将线索详情弹窗调整为 A 方案「信息分组卡片」,提升字段层级、长文本可读性和窄屏适配,同时保持现有业务行为不变。 + +**Architecture:** 继续使用 `LeadsPage.vue` 的现有 `selectedLead` 数据和状态更新逻辑,只为详情模板增加基础信息容器、字段项和区块标题语义。所有视觉变化集中在 `styles.css`,不增加组件、接口或数据层。 + +**Tech Stack:** Vue 3、TypeScript、Element Plus、Vitest、Vite、CSS Grid/Flexbox。 + +--- + +### Task 1: Add a regression test for the A-layout structure + +**Files:** +- Modify: `WonderQ-Admin-UI-Vue/src/pages/LeadsPage.test.ts` + +- [ ] **Step 1: Add assertions for the required semantic hooks before changing production code** + +Append this test to the existing `describe` block: + +```ts + it("keeps the grouped lead detail layout hooks", async () => { + const source = await readFile(fileURLToPath(new URL("./LeadsPage.vue", import.meta.url)), "utf8"); + + expect(source).toContain('class="lead-detail-card"'); + expect(source).toContain('class="lead-detail-item"'); + expect(source).toContain('class="lead-detail-section-title"'); + expect(source).toContain('class="lead-detail-section lead-detail-note"'); + expect(source.match(/class="lead-detail-item"/g)).toHaveLength(6); + expect(source).toContain("v-permission=\"'admin:leads:update'\""); + }); +``` + +- [ ] **Step 2: Run the focused test and confirm it fails for the missing hooks** + +Run from `WonderQ-Admin-UI-Vue`: + +```powershell +yarn vitest run src/pages/LeadsPage.test.ts +``` + +Expected: the existing initial-loading test passes and the new grouped-layout test fails because the current template does not contain the new wrapper/item/title classes. + +### Task 2: Implement the grouped detail markup and styles + +**Files:** +- Modify: `WonderQ-Admin-UI-Vue/src/pages/LeadsPage.vue:118-123` +- Modify: `WonderQ-Admin-UI-Vue/src/styles.css:64-72,193-195` + +- [ ] **Step 1: Wrap the detail fields without changing their data expressions** + +Replace the current detail content after `