From ea9c42953c68b93f7ad16ee43d969807f0faa971 Mon Sep 17 00:00:00 2001 From: PoterPan Date: Sat, 29 Aug 2026 19:56:57 +0800 Subject: [PATCH 01/20] docs(plans): add implementation plan for #46 UX-D terminology --- .../plans/2026-07-31-ux-d-terminology.md | 1752 +++++++++++++++++ 1 file changed, 1752 insertions(+) create mode 100644 docs/superpowers/plans/2026-07-31-ux-d-terminology.md diff --git a/docs/superpowers/plans/2026-07-31-ux-d-terminology.md b/docs/superpowers/plans/2026-07-31-ux-d-terminology.md new file mode 100644 index 0000000..98e8562 --- /dev/null +++ b/docs/superpowers/plans/2026-07-31-ux-d-terminology.md @@ -0,0 +1,1752 @@ +# UX-D 術語與文案統一 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:** Make every zh-TW string in ChipPot use one word per concept — 驗證 (not 核准), 已繳待驗 (not 已繳), 繳費渠道 (not 支付渠道), 此期 (not 本期), 開繳 (not 開帳), 成員 (not 使用者) — and stop showing raw English enums and raw English worker errors to Chinese-reading users. + +**Architecture:** This is a copy sweep, not a refactor. §A below is the canonical-terms SPEC — one mapping table per concept. Each task takes one concept, **regenerates its own edit-site list with `git grep` at execution time**, applies the mapping, then proves the concept is gone with a zero-hits assertion. Nothing in this plan changes a DB value, an API request/response *shape*, an enum stored in D1, or a `custom_id`. Three tasks do change API response *strings* (`routes/admin.ts` errors, `core/payments.ts` race message) and Discord reply strings; those are TDD with real vitest assertions. + +**Tech Stack:** TypeScript, React 18 (admin + web SPAs, Vite 6), Cloudflare Workers, Vitest 4 with `@cloudflare/vitest-pool-workers` (real Miniflare D1/R2), pnpm workspaces. + +--- + +## Why this plan has no line numbers + +This batch runs **last** — after UX-A (danger actions, `#43`), UX-B (mobile/a11y, `#44`) and UX-C (member feedback, `#45`) have merged. Those batches rewrite `Dashboard.tsx`, `Payments.tsx`, `Manage.tsx`, `Settings.tsx`, `handler.ts` and `web/App.tsx`. **Every line number in the source audit (`.superpowers/sdd/ux-audit-copy.md`) is stale by the time you read this.** + +So: the audit's `file:line` lists are an *inventory of what existed on 2026-07-30*, reproduced in §A only to tell you roughly how many sites to expect. **Never navigate by line number.** Every task starts with a `git grep` that rebuilds the list from the tree you actually have, and ends with the same grep returning nothing. + +Three consequences you must internalise: + +1. **A site may already be fixed.** UX-A owns `A5` (the 發起繳費 「本期」 wording). If your grep shows it already reads `${period}`, that is success, not a missing file — move on. +2. **A site may have moved to a file this plan never names.** If `git grep` finds the term in a file not listed in §B, fix it there too. The grep is the authority; §B is a hint. +3. **A string may have been reworded.** Match on the *concept*, not on the exact old sentence. If UX-A rewrote a tooltip and it still says 「本期」, the 本期 sweep still owns that word. + +`docs/superpowers/plans/**` is a **historical archive**. It contains 核准, 已繳, 本期 in abundance. **Never edit it.** Every grep in this plan is pathspec-scoped to `packages README.md README.zh-TW.md` precisely to keep it out. + +--- + +## Global Constraints + +Every task's requirements implicitly include this section. + +- **Branch:** `ux/46-terminology`, cut from `main` after A/B/C have merged. One PR, body contains `Closes #46`. +- **Worker suite green after every task.** Baseline on 2026-07-31 (before A/B/C) was **300 passed, 41 files**. A/B/C will raise it. **Do not hardcode 300 anywhere** — capture the real baseline in Task 1 Step 2 and use that number. +- **`pnpm -r typecheck` green after every task** (worker + admin + web `tsc --noEmit`). +- **Admin and web must build:** `pnpm --filter @chippot/admin build` and `VITE_API_BASE=https://example.invalid pnpm --filter @chippot/web build`. Run both in Task 15; run them earlier too if a task touched `.tsx` and you want the signal. +- **`packages/worker/wrangler.toml` must not be touched.** It is `skip-worktree`'d locally and its committed copy holds placeholders. Do not `git add` it, do not open it to "check" something. +- **`docs/deploy-state.md` is gitignored (`.gitignore:10`) — local-only.** Append the entry (Task 15) but **never `git add` it**; `git add docs/` would fail to stage it anyway, so use explicit paths in every `git add`. +- **Conventional commits**, zh-TW subject line after the type/scope, matching repo history (e.g. `fix(admin-ui): 彈窗內文字不再繼承靠右對齊 (#33)`). +- **Display-layer only.** English enum *values* (`active`/`paused`/`cancelled`, `user_slash`/`admin_manual`/`cron`, `pending`/`paid`/`verified`/`rejected`) stay English in the DB, in `