# Codex Prompt: Phase 6.3.5d — 清理 Table.striped 自创内容

Phase 6.3.5 反向 audit 唯一一条 E4 likely-invented 是 `Table.striped`。本任务参照 Phase 6.3 同类清理流程，把 `striped` 从 canonical / runtime / 测试 / 文档页 / playground 全链路删除，并在 `divergences.md` 登记为 resolved。

---

## 必读前置

1. `docs/working-principles.md` 原则 0 / 原则 6（无登记的不一致 = bug）
2. `docs/internal/phase-6.3.5-reverse-audit-report.md` 第 273–286 行（Table.striped E4 条目）
3. `docs/internal/_prompts/phase-6.3-cleanup-invented-content.prompt.md`（参照同类流程）
4. `src/design-system/translation/divergences.md`（含已 resolved 的 `## Notification.success` / `## Notification.type` 作为格式样板）

---

## 关键事实（已由主 Session 在 Figma 真源验证）

`figma-data/normalized/components-tokenized/table__4265_16131.json`：

- 6 个 variant：`Type=Header/Tbody` × `Align=Left/Center/Right`
- Tbody variant `fills: []`，**无背景填充**
- `figma-data/normalized/canonical-components.json` 中 `Table.mergedVariantAxes` 只有 `align` / `type`

**结论**：Figma 没有 striped 概念，也没有"Tbody 等于条纹"的视觉契约。
代码侧的 `striped` prop + `tbl--striped` CSS + canonical 里 `type === 'Tbody'` → 条纹的派生逻辑，**全部是代码自创**。

---

## 任务 1：删除 canonical 层 striped

文件：`src/canonical/Table.vue`

改动：

1. 从 `defineProps<{...}>` 类型里删除 `striped?: boolean` 这一行
2. 从 `withDefaults(...)` 第二参数里删除 `striped: false,` 这一行
3. 删除 `<BaseTable>` 上的 `:striped="striped || type === 'Tbody'"` 这一行（连同前一行末尾的换行处理好缩进）

删除后，canonical Table 不应再向 BaseTable 传递 `striped`。

---

## 任务 2：删除 runtime 层 striped

文件：`src/components/Table/Table.vue`

改动：

1. 从 `defineProps<{...}>` 类型里删除 `striped?: boolean`
2. 从 `withDefaults(...)` 第二参数里删除 `striped: false`（注意逗号处理）
3. 把 `<table class="tbl" :class="{ 'tbl--striped': striped }">` 改回 `<table class="tbl">`
4. 删除 `<style scoped>` 里这一整块：
   ```css
   .tbl--striped .tbl-body .tbl-row:nth-child(even) {
     background: var(--bg-layer3);
   }
   ```
   连同上下空行调整，让相邻 CSS 块仍合理空白分隔

---

## 任务 3：删除 playground demo 区块

文件：`playground/App.vue`

定位约 line 496–514（搜 `<p class="sub-label">Striped</p>`）。

改动：删除整个 striped 演示区块——

- `<p class="sub-label">Striped</p>` 这一行
- 紧随其后的 `<Table striped ...>` 整个组件块（含 `:columns="[...]"` 与 `:data="[...]"`，到该 `<Table />` 自闭合标签结束）

不要触碰前面那个 non-striped 的 Table 演示。

---

## 任务 4：清理测试

### 4.1 `tests/Table.test.ts`

删除整段：

```ts
it('applies striped class when striped prop is true', () => {
  const wrapper = mount(Table, { props: { columns, data, striped: true } })
  expect(wrapper.classes()).toContain('tbl--striped')
})
```

（约 line 64–67，含 closing `})` 后的换行）

### 4.2 `tests/Canonical.test.ts`

定位约 line 333：

```ts
expect(wrapper.find('.tbl').classes()).toContain('tbl--striped')
```

**只删这一行**，保留所在测试块（`'Table maps figma align and type into the base table rendering'`）的其它断言（data-figma-* 属性、对齐 class）。

---

## 任务 5：清理文档页 props 表

文件：`playground/docs/pages/TablePage.vue`

定位约 line 25：

```ts
{ name: 'striped', description: ['Optional row striping for larger table compositions.', '大表格组合时可选的斑马纹。'], type: 'boolean', defaultValue: 'false' },
```

删除这一整行（包括末尾逗号与换行；保持前后行的逗号语法正确）。

---

## 任务 6：grep 验证无残留

执行下列扫描并把输出贴到报告：

```bash
# 应全部为空
grep -rn "striped\|tbl--striped" src/ playground/ tests/ 2>&1
```

如有任一非空命中，**STOP 报告**，列出位置等用户指令，不擅自扩散修改。

---

## 任务 7：在 `divergences.md` 登记 resolved

文件：`src/design-system/translation/divergences.md`

在 `## Notification.type` 节之后追加一节（紧跟其后，不要插入到不相关位置）：

```markdown
## Table.striped

- Figma property/value: no `striped` axis exists in the published Table component set; Tbody variants have empty fills (no zebra pattern)
- Code mapping: historical runtime-only convenience prop with auto-derive `type === 'Tbody'` → striped in canonical wrapper
- Reason: code invented both a visual axis and a derived behavior outside the Figma family
- Status: ✅ resolved (2026-04-28, Phase 6.3.5d)
- Resolution: 删除 canonical / runtime 的 `striped` prop、CSS class、自动派生逻辑、测试断言、playground demo 与文档页 props 行；grep 验证无残留
```

不动该文件其它内容。

---

## 任务 8：自验

```bash
pnpm test 2>&1 | tail -10
pnpm build 2>&1 | tail -8
```

**两者必须通过**。

期望 `pnpm test`：原 `105 / 105` → 新 `104 / 104`（删了 `Table.test.ts` 中 1 个 `it` 块；`Canonical.test.ts` 那一行只是断言不是测试块）。

任一失败 STOP 报告，不强行通过。

---

## 任务 9：写 execution report

输出：`docs/internal/phase-6.3.5d-execution-report.md`

格式：

```markdown
# Phase 6.3.5d Execution Report

跑时间：YYYY-MM-DD HH:MM:SS

## 任务 1 / 2：canonical + runtime striped 删除
- src/canonical/Table.vue：删除 prop / default / BaseTable 绑定
- src/components/Table/Table.vue：删除 prop / default / class 绑定 / .tbl--striped CSS

## 任务 3：playground demo 区块删除
- playground/App.vue：删除 `<p class="sub-label">Striped</p>` 及紧随的 `<Table striped ...>` 区块（行号变化记录）

## 任务 4：测试清理
- tests/Table.test.ts：删除 `'applies striped class when striped prop is true'` 整段
- tests/Canonical.test.ts：删除 line ~333 的 `tbl--striped` 断言（保留所在测试块其它断言）

## 任务 5：文档页 props 行删除
- playground/docs/pages/TablePage.vue：删除 striped row

## 任务 6：grep 验证
- `striped\|tbl--striped` in src/ playground/ tests/：[输出 / 空]

## 任务 7：divergences.md 登记
- 新增 `## Table.striped` 节，状态 ✅ resolved (Phase 6.3.5d)

## 任务 8：自验
- pnpm test：[N / N passed]（期望 104 / 104）
- pnpm build：[✓ Xs]

## 异常项（如有）
[空 / 描述]
```

---

## 任务 10：自己 commit

由你（Codex）自己 commit 本轮改动。

### commit 范围（精确）

包含：
- `src/canonical/Table.vue`
- `src/components/Table/Table.vue`
- `playground/App.vue`
- `playground/docs/pages/TablePage.vue`
- `tests/Table.test.ts`
- `tests/Canonical.test.ts`
- `src/design-system/translation/divergences.md`
- `docs/internal/phase-6.3.5d-execution-report.md`
- `docs/internal/_prompts/phase-6.3.5d-cleanup-table-striped.prompt.md`

不要 commit：
- `figma-data/published/icons/manifest.json`（如出现，git restore）
- `docs/internal/published-vs-code-audit.md` / `figma-data/normalized/published-vs-code.audit.json`（如出现，audit 副作用，git restore）
- `docs/session-handoff.md` / `docs/conformance-issue-log.md`（主 Session 自己改）

### commit message

```
refactor(Table): drop invented striped prop and derived Tbody striping (Phase 6.3.5d)

Phase 6.3.5 reverse audit found Table.striped as the sole E4
likely-invented item:
- Figma Table component has no `striped` variant axis
- Tbody variants in figma-data have empty fills (no zebra pattern)
- canonical Table.vue further invented `type === 'Tbody'` → striped
  auto-derive logic on top

Cleanup follows Phase 6.3 pattern:
- Remove `striped` prop from canonical and runtime Table.vue
- Remove `.tbl--striped` CSS rule
- Remove canonical wrapper's auto-derive
- Delete striped demo block from playground/App.vue
- Delete striped row from docs page props table
- Delete striped test in tests/Table.test.ts
- Remove tbl--striped assertion in tests/Canonical.test.ts
  (other assertions in same test block preserved)
- Register Table.striped in divergences.md as resolved

Verified: grep no residue; pnpm test 104/104; pnpm build ✓

Co-Authored-By: Codex
```

---

## 禁止

- ❌ 不动 `src/canonical/` 其它文件
- ❌ 不动 `src/components/` 其它组件
- ❌ 不动 `figma-data/`、`figma-sync/`、`src/icons/`
- ❌ 不更新 `docs/session-handoff.md` / `docs/conformance-issue-log.md`（主 Session 接手）
- ❌ 不要 sneak 6.3.5b（E1/E2 批量登记）的工作进来
- ❌ 不要把 Canonical.test.ts 整段测试删掉，**只删一行 striped 断言**
- ❌ 不要把 playground/App.vue 中 non-striped 的 Table 演示也删掉
- ❌ grep 发现额外残留时 STOP，不擅自扩散
- ❌ 失败的 test/build 不强行通过

---

## 完成后

1. 报告 + 自 commit 完成后 STOP
2. 把执行报告路径告诉用户
3. 等主 Session 决定下一步（同步 handoff/conformance-issue-log，或继续 6.3.5b）

完成后 STOP。
