未載入 Skill8916 tokens · 130870 ms
I loaded the dataviz skill for the alert-color and dashboard-layout parts. One process note up front: **the only tool available to me in this session is the Skill tool — I have no file-write tool, so I could not create the plan file at the requested path.** The deliverable is below; paste it into that file if you want it persisted.
Two other honesty caveats:
- I have not seen your codebase or your actual hex values. Every file reference below is a "grep for this" pointer, not a verified path.
- I could **not run** `scripts/validate_palette.js` (no shell access here). All contrast and CVD numbers below are targets to be **measured**, plus a few well-known approximations flagged as such — not results I obtained.
---
# Dashboard audit: severity, fixes, acceptance
## Summary
| # | Issue | Severity | WCAG |
|---|---|---|---|
| 1 | `focus outline` removed | **P0 — blocker** | 2.4.7 (A), 2.4.11 (AA) |
| 2 | Icon-only buttons, no accessible name | **P0** | 4.1.2 (A), 2.5.8 (AA) |
| 3 | Actions only on hover | **P0** | 2.1.1 (A), 2.5.1 |
| 4 | Red/green as sole alert encoding | **P0** | 1.4.1 (A) |
| 5 | 11px gray body text | **P1** | 1.4.3 (AA), 1.4.4 |
| 6 | Fixed 1280px width | **P1** | 1.4.10 (AA) |
| 7 | No table view / no dark-mode steps | **P2** | — (robustness) |
P0 = ships broken for keyboard, screen-reader, touch, or CVD users. P1 = legible-but-failing for low vision and zoom. Fix in numeric order; 1–3 are cheap and unblock everything else.
---
## P0-1 · Focus outline removed
**Why it's a blocker.** A blanket `outline: none` deletes the only signal a keyboard user has about where they are. There is no "clean design" argument that survives this — it's a Level A failure.
**Fix values**
```css
/* delete every bare `outline: none` / `outline: 0` */
:focus-visible {
outline: 2px solid var(--focus-ring); /* #2563EB light, #60A5FA dark */
outline-offset: 2px;
border-radius: inherit;
}
@media (forced-colors: active) {
:focus-visible { outline: 2px solid Highlight; }
}
```
- Ring must hit **≥3:1 against both** the component and the adjacent background (2.4.11). On a dark tile a blue ring can fail — that's why the offset matters: the 2px gap re-renders the ring against the surface.
- Keep `outline: none` **only** on `:focus:not(:focus-visible)` for mouse clicks, never globally.
**Acceptance**
- Tab from address bar through the entire dashboard: every stop shows a visible ring, no stop is invisible or off-screen. Record the walkthrough.
- axe-core / Lighthouse a11y: zero focus violations.
- Windows High Contrast mode: ring still visible.
- Grep gate in CI: `outline:\s*(none|0)` outside a `:focus:not(:focus-visible)` block fails the build.
---
## P0-2 · Icon-only buttons with no name
**Fix values**
```html
<button class="icon-btn" aria-label="Acknowledge alert">
<svg aria-hidden="true" focusable="false" width="20" height="20">…</svg>
</button>
```
- Target size **44×44 CSS px** (2.5.8 AA floor is 24×24; 44 is the touch standard and costs nothing on desktop). Icon glyph 20px centered — pad, don't scale the icon.
- Add a **visible tooltip on hover *and* focus** (`:focus-visible` too, not hover-only — see P0-3).
- Any icon whose meaning isn't universal (⋯, ⚙, ✓ are; a custom glyph isn't) gets a **visible text label** at ≥1280px, not just a tooltip.
- Destructive icons (delete, mute) never stand alone — label them.
**Acceptance**
- VoiceOver rotor / NVDA element list: every button reads a distinct, action-shaped name ("Acknowledge alert", not "button" or "icon-check").
- Automated: assert `accessibleName.length > 0` for all `[role=button]` in the DOM snapshot test.
- Measure two adjacent icon buttons: ≥44px each, ≥8px between hit boxes.
---
## P0-3 · Actions revealed only on hover
Hover doesn't exist on touch, doesn't exist for keyboard, and is unreliable for switch/voice control. It also tanks discoverability for everyone.
**Fix values**
```css
.row-actions { opacity: 0; transition: opacity 120ms; }
.row:hover .row-actions,
.row:focus-within .row-actions,
.row-actions:focus-within { opacity: 1; }
@media (hover: none), (pointer: coarse) {
.row-actions { opacity: 1; } /* always visible on touch */
}
@media (prefers-reduced-motion: reduce) { .row-actions { transition: none; } }
```
Structural rules:
- Actions stay **in the DOM and in tab order at all times** — fade opacity, never `display:none` / `visibility:hidden`, never mount on `mouseenter`.
- Every row keeps **one always-visible affordance** (a `⋯` overflow button). Fading secondary icons is fine once the overflow menu is permanent.
- The primary action of a row must also be reachable from the row's detail view — hover reveal is never the only path.
**Acceptance**
- Keyboard-only run: unplug the mouse, reach and fire every row action.
- Touch device (or DevTools touch emulation): all actions visible without a tap-to-reveal.
- Test at `pointer: coarse` and with `prefers-reduced-motion`.
---
## P0-4 · Red/green as the only alert encoding
Red-green is precisely the deuteranopia/protanopia confusion axis — roughly 1 in 12 men cannot separate that pair. Two things are wrong: color-alone encoding, and the specific pair chosen.
**Fix — status is a triple: icon + text + color.** Per the skill's rules, status colors are reserved and never carry identity alone.
| State | Icon (shape-distinct) | Text | Light hex (candidate) | Dark hex (candidate) |
|---|---|---|---|---|
| Critical | filled triangle `!` | "Critical" | `#B91C1C` | `#F87171` |
| Serious | filled diamond | "Serious" | `#C2410C` | `#FB923C` |
| Warning | filled circle `!` | "Warning" | `#B45309` | `#FBBF24` |
| Good | outline check circle | "Healthy" | `#15803D` | `#4ADE80` |
Key move: **drop the green-vs-red contrast as the workhorse.** Let severity read as *amber→red intensity* plus shape, with "healthy" carried by a neutral/muted treatment or a check icon rather than a saturated green badge. Red vs. amber survives CVD; red vs. green does not.
Shapes must differ in **silhouette** (triangle / diamond / circle), not just fill color — that's what makes the grayscale test pass.
**Acceptance — computed, not eyeballed**
```bash
cd <skill-base>/dataviz
node scripts/validate_palette.js "#B91C1C,#C2410C,#B45309,#15803D" --mode light
node scripts/validate_palette.js "#F87171,#FB923C,#FBBF24,#4ADE80" --mode dark
```
- Every adjacent pair must clear **CVD ΔE ≥ 8** (OKLab ×100) and the normal-vision floor of 15. **I have not run this** — the hexes above are candidates and may need snapping to nearer ramp steps. Anything that FAILs gets re-stepped before merge.
- Grayscale screenshot: all four states still distinguishable → proves icon+text carry it.
- Deuteranopia/protanopia simulation screenshot attached to the PR.
- Status text is real text in the DOM (screen-reader announced), not a `::before` decoration or an `aria-hidden` glyph.
---
## P1-5 · 11px gray text
**Fix values**
| Role | Size / line-height | Weight | Light ink | Contrast target |
|---|---|---|---|---|
| Table cell, body | **14px / 20px** | 400 | `#111827` | ≥ 4.5:1 |
| Secondary / metadata | **12px / 16px** (floor) | 400 | `#4B5563` | ≥ 4.5:1 |
| Column header, label | 12px / 16px | 600, `letter-spacing: .02em` | `#374151` | ≥ 4.5:1 |
| KPI value | 28–32px / 1.1 | 600, `font-variant-numeric: tabular-nums` | `#111827` | ≥ 3:1 (large) |
| Disabled | inherit size | — | `#9CA3AF` | exempt, but never the only state cue |
- **11px is below any sensible floor** — 12px absolute minimum, and only for genuine metadata (timestamps, units). Promote anything a user must read in a hurry to 14px.
- Gray guidance, approximate and to be verified with a contrast checker: `#767676` on white sits right at ~4.5:1, `#6B7280` ~4.8:1, `#999999` ~2.9:1 (**fails**). If your current gray is in the `#999`–`#AAA` range at 11px it is failing on both axes at once.
- Use **rem**, not px, so browser font-size settings apply.
- Tabular numerals everywhere numbers stack in a column — non-negotiable for scanning.
**Acceptance**
- Contrast checker on every text/background token pair in the theme file; record ratios in a table committed alongside the tokens.
- Set browser base font to 24px: layout must not clip or overlap.
- 200% text-only zoom (1.4.4): no loss of content.
---
## P1-6 · Fixed 1280px width
Fails reflow (1.4.10): content must survive an equivalent of 320px wide without two-dimensional scrolling, which is also what a 400%-zoomed 1280px viewport becomes.
**Fix values**
```css
.dashboard {
width: 100%;
max-width: 1440px; /* cap line length, don't pin layout */
min-width: 0; /* critical — grid children default to min-content */
margin-inline: auto;
padding-inline: clamp(16px, 4vw, 32px);
}
.tile-grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
```
Breakpoints: **≥1440** 4-up tiles · **1024–1439** 3-up · **768–1023** 2-up · **<768** 1-up.
- Add `min-width: 0` / `min-height: 0` to every flex and grid child that contains a chart — this is the #1 cause of "the grid won't shrink."
- Prefer **container queries** (`@container (min-width: 480px)`) for tiles so a tile in a sidebar reflows correctly regardless of viewport.
- Charts: `width: 100%`, viewBox-driven SVG, `preserveAspectRatio`. Re-render on `ResizeObserver`, not on `window.resize` alone.
**Acceptance**
- 320, 390, 768, 1024, 1280, 1440, 1920 screenshots — no horizontal scrollbar on the page at any width (a deliberately scrollable table region is allowed and must be labeled).
- 400% zoom at 1280×1024: single-column, vertical scroll only.
- `ResizeObserver` teardown verified (no leaked observers on route change).
---
## P2-7 · Robustness gaps worth closing in the same pass
- **Table view for every chart.** A "View as table" toggle satisfies the contrast-WARN escape hatch and helps screen readers. Per the skill, a contrast WARN is not dismissable — it obligates visible labels or this table.
- **Legend + direct labels.** ≥2 series → legend always present; ≤4 series → also direct-labeled, so identity never rests on color. One series → no legend box, the title names it.
- **Dark mode is selected, not flipped.** Re-step every token against the dark surface and re-run the validator with `--mode dark`. An automatic inversion will break both the status palette and the focus ring.
- **Tooltips on all chart marks** (crosshair on line/area, per-mark on bar/dot/cell) with hit targets larger than the mark.
- **Texture fill** available at 45°/135° for the print / forced-colors / severe-CVD case.
---
## 390px mobile reflow
Working width: 390 − 2×16px gutters = **358px**.
**Layout**
- Single column throughout. Kill the 1280 canvas: `grid-template-columns: 1fr`.
- **KPI tiles: 2-up** (`repeat(2, 1fr)`, 12px gap → 173px each) for the top 4 metrics; anything longer than 6 characters drops to 1-up. Value 24px, label 12px.
- Vertical rhythm: 16px between cards, 24px between sections. Card padding 16px.
- Charts: full-bleed within the card, **height 200–240px**, x-axis ticks thinned to first/mid/last, y-axis to 3 gridlines. Rotate nothing — abbreviate instead ("Sep 2", not "September 2nd").
- Prefer **horizontal bars over vertical** at this width: category labels get room and long names don't clip.
**Navigation and controls**
- Filter row (which the skill wants in one row above the charts on desktop) collapses to a **single "Filters (2)" button** opening a bottom sheet; applied filters shown as a horizontally scrollable chip row beneath it.
- Header: sticky, 56px, title + overflow. Page-level actions move into a bottom sheet, not a hover menu.
- Bottom padding `calc(16px + env(safe-area-inset-bottom))`.
**Tables → cards**
- Below 768px, convert each row to a **card**: primary identifier at 14px/600, status badge (icon + text) on the same line, 2–3 secondary fields as label/value pairs at 12px, `⋯` overflow button at 44×44 on the right.
- If the tabular structure is genuinely needed, keep a horizontally scrollable region with a **sticky first column**, a scroll shadow, `role="region"` + `aria-label` + `tabindex="0"` so it's keyboard-scrollable.
**Interaction — the hover problem, restated for touch**
- **No hover anywhere.** Under `@media (hover: none)` all row actions are permanently visible.
- Chart tooltips fire on **tap**, dismiss on tap-outside or Esc, and never obscure the tapped mark.
- All targets ≥44×44 with ≥8px separation. Icon-only buttons keep their `aria-label`; the tooltip is no longer reachable, so any non-obvious icon **must** gain a visible text label at this width.
- Status badges keep icon + text — do not shorten to icon-only to save space. Truncate the metric name instead.
**Mobile acceptance**
- iPhone 12/13/14 viewport (390×844) and a real device if available: no horizontal page scroll, no tap-to-reveal, every action reachable.
- Rotate to landscape (844×390): sticky header must not eat the viewport.
- VoiceOver swipe-through on the card list: order is identifier → status → fields → actions.
---
## Suggested order of work
1. **Day 1, mechanical:** delete `outline: none`, add the `:focus-visible` token, add `aria-label` to every icon button, add `:focus-within` + `(hover: none)` to the reveal CSS. Four small diffs, clears three P0s.
2. **Day 2, tokens:** type scale and ink tokens (P1-5), status triple (P0-4). Run the validator, snap failures, commit the measured contrast table.
3. **Day 3, layout:** fluid container, `min-width: 0` sweep, container queries, mobile card conversion (P1-6 + 390px).
4. **Day 4:** table view, legends, dark-mode stepping, `--mode dark` validator run.
## What to grep for to find the damage
`outline:\s*(none|0)` · `font-size:\s*11px` · `1280` / `min-width:\s*1280` · `:hover` on containers whose children are interactive · `<button>` with no text child and no `aria-label` · hardcoded `red`/`green`/`#f00`/`#0f0`/`crimson`/`limegreen`.
---
**Open questions that would sharpen this** — I've assumed a CSS/React stack with a token file and no existing design system. If you have a design system, its ramps replace my candidate hexes wholesale (the method above is unchanged; only the parameter values swap). And if you can share the actual grays and alert colors in use, I can name exact replacement steps instead of candidates — but the validator still has to be run against them, by you or by me with shell access.
已載入 Skill +10620 tokens · 181933 ms
## 執行說明(先講清楚)
我已依指示呼叫 `ui-ux-pro-max` Skill,Skill 內容已載入。但此工作階段**沒有可執行的 Shell/檔案工具**,所以我 **未實際執行** `scripts/search.py`,也沒有讀取 `references/quick-reference.md`、`pro-rules.md` 的完整條文,更沒有存取你的實際程式碼。
因此以下建議來自 **Skill 的內建優先級規則表(Priority 1–10)+ WCAG 2.1/2.2 通用準則**,屬於「built-in defaults」而非資料庫比對結果。所有具體色碼與對比值是我依 sRGB 公式**推算**的參考值,落地前請用實際 token 再量一次。(另:計畫模式下我也無法寫入 plan 檔,故直接以審查報告形式交付。)
---
# 桌面儀表板 UX 審查報告
## 0. 嚴重度定義
| 級別 | 判準 | 處置 |
|---|---|---|
| **P0 阻斷** | 使用者「無法完成任務」或違反 WCAG A/AA 必要條款 | 本迭代必修,不修不上線 |
| **P1 高** | 可完成但顯著費力/高錯誤率/法遵風險 | 下個迭代必修 |
| **P2 中** | 效率與一致性損耗 | 排入 backlog |
---
## 1. 問題清單(依嚴重度)
### P0-1 移除 focus outline
> Skill Priority 1(Accessibility)明列反模式:「Removing focus rings」。
**違反**:WCAG 2.4.7 Focus Visible (AA)、2.4.11 Focus Not Obscured (AA, 2.2)、2.4.13 Focus Appearance。
**後果**:鍵盤與輔具使用者完全失去「我現在在哪」的定位,儀表板等於不可操作。
**修正值**
```css
:where(a, button, [role="button"], input, select, [tabindex]):focus-visible {
outline: 2px solid #2563EB; /* 對白底約 5.1:1,遠高於 3:1 門檻 */
outline-offset: 2px;
border-radius: 6px;
}
/* 深色卡片上改用高亮環 */
.surface-dark :focus-visible { outline-color: #93C5FD; }
```
- 焦點環與**相鄰兩側**顏色皆需 ≥ 3:1。
- 禁止 `outline: none` 而無等價替代;`:focus-visible` 而非 `:focus`,避免滑鼠點擊也出現。
- sticky header/固定側欄需加 `scroll-margin-block: 80px`,避免焦點被遮住(2.4.11)。
**驗收**
1. 拔掉滑鼠,用 Tab/Shift+Tab 走完首頁 + 一張明細頁,**每一個**可聚焦元素都看得到環(錄一段 30 秒鍵盤操作影片存檔)。
2. axe-core / Lighthouse a11y:focus 相關違規 = 0。
3. 焦點環對比用取色器實測 ≥ 3:1(含 hover、selected、disabled 三態疊加時)。
---
### P0-2 所有按鈕只有圖示、無可及名稱
> Skill 反模式:「Icon-only buttons without labels」。
**違反**:WCAG 4.1.2 Name/Role/Value、1.1.1、2.5.3 Label in Name。
**後果**:螢幕閱讀器唸出「button button button」;新用戶對「三條線/漏斗/齒輪」語意猜錯。
**修正值**
```html
<button class="icon-btn" aria-label="匯出 CSV" data-tooltip="匯出 CSV">
<svg width="20" height="20" aria-hidden="true" focusable="false">…</svg>
</button>
```
- 尺寸:icon **20px**,按鈕命中區桌面 **≥ 32×32px**(WCAG 2.5.8 最低 24×24 的安全裕度),相鄰按鈕間距 ≥ 8px;密集工具列可用 `::before` 補滿命中區而不撐版面。
- **每列最多 2 個純圖示按鈕**(最常用),其餘收進永遠可見的 `⋯` 溢出選單,選單項目一律「圖示 + 文字」。
- Tooltip:延遲 400ms 顯示、`hover` **與** `focus` 都要觸發、可用 Esc 關閉、滑入 tooltip 不消失(WCAG 1.4.13)。Tooltip **不能**是唯一的名稱來源。
- 主要動作(新增/儲存/匯出)改成 **圖示 + 文字**,不要純圖示。
- 使用 SVG,禁用 emoji 當圖示(Skill Priority 4 反模式)。
**驗收**
1. VoiceOver/NVDA 逐一走訪工具列,每顆按鈕唸出的名稱與 tooltip 文字一致(2.5.3)。
2. 快照測試:所有 `button:not(:has(text))` 必須有 `aria-label` 或 `aria-labelledby` — 寫成 lint / 單元測試斷言。
3. 5 位未受訓使用者做「圖示語意猜測測試」,正確率 ≥ 80% 才保留純圖示。
---
### P0-3 操作僅在 hover 時出現
> Skill Priority 2 反模式:「Reliance on hover only」。
**後果**:觸控裝置與鍵盤使用者永遠看不到功能;即使滑鼠使用者也有「發現性為零」的問題(隱藏的功能 ≈ 不存在的功能)。
**修正值**
```css
.row-actions { opacity: 1; } /* 預設可見 */
@media (hover: hover) and (pointer: fine) {
.row-actions { opacity: .55; transition: opacity 120ms ease-out; }
tr:hover .row-actions,
tr:focus-within .row-actions,
tr[aria-selected="true"] .row-actions { opacity: 1; }
}
@media (hover: none) { .row-actions { opacity: 1; } }
```
- 關鍵:從「顯示/不顯示」改成「**降低視覺權重**(opacity ≥ 0.55,仍達文字對比門檻)」,而非 `display:none`。
- 必須加上 `:focus-within`,否則 Tab 進去按鈕仍是隱形的。
- 更穩的做法:每列右側固定一顆永遠可見的 `⋯`,把行內動作全部放進去;表頭提供「批次操作」列。
- 佈局要預留動作欄寬度(例如固定 `96px`),避免 hover 時內容位移(Skill Priority 3:CLS < 0.1)。
**驗收**
1. iPad / Android 平板實機:不需長按即可觸發每一個列動作。
2. 純鍵盤:Tab 進入任一列後,動作按鈕即刻可見且可操作。
3. `prefers-reduced-motion: reduce` 時淡入改為即時切換。
---
### P0-4 紅/綠單靠顏色區分告警
> Skill Priority 10:「Relying on color alone to convey meaning」。
**違反**:WCAG 1.4.1 Use of Color。約 8% 男性有紅綠色覺差異;單色列印/灰階截圖亦全滅。
**修正值** — 三重編碼:**顏色 + 圖示形狀 + 文字**
| 狀態 | 前景色(白底) | 推算對比 | 圖示形狀 | 文字 |
|---|---|---|---|---|
| Critical | `#B42318` | ≈ 6.6:1 | 實心八角/`x-octagon` | 「嚴重」 |
| Warning | `#B54708` | ≈ 5.5:1 | 三角形 `alert-triangle` | 「警告」 |
| Healthy | `#067647` | ≈ 5.7:1 | 打勾圓形 `check-circle` | 「正常」 |
| Unknown | `#475467` | ≈ 7.6:1 | 空心圓 `circle-dashed` | 「無資料」 |
- 底色用同色系 50 階(`#FEF3F2` / `#FFFAEB` / `#ECFDF3`),**邊框 1px** 加強在深色模式下的區辨。
- 若紅綠必須並存於圖表,改用**藍↔橘**發散色階(`#1D4ED8` ↔ `#C2410C`),並對序列加 dash pattern / 標記形狀差異。
- 狀態變化要有 `role="status"`(非緊急)或 `role="alert"`(緊急)廣播。
**驗收**
1. 對整頁截圖做 **灰階轉換**,狀態仍可區分 → 通過。
2. 用 deuteranopia / protanopia / tritanopia 模擬(Chrome DevTools Rendering → Emulate vision deficiencies)逐一檢查。
3. 每個狀態元素都能被螢幕閱讀器唸出狀態文字,而不只是色塊。
---
### P1-5 11px 灰字
> Skill Priority 6 反模式:「Text < 12px body」「Gray-on-gray」。
**問題**:11px 已低於可讀下限;常見的淺灰(如 `#98A2B3` 對白底僅 ≈ 2.6:1)遠低於 4.5:1。兩者疊加是儀表板最典型的「看起來很專業、實際看不清」。
**修正值(密集儀表板 type scale)**
| 用途 | size / line-height | 顏色 | 推算對比 |
|---|---|---|---|
| 表格內文、正文 | **14px / 20px** | `#1D2939` | ≈ 14:1 |
| 次要說明、metadata | **12px / 16px**(絕對下限) | `#475467` | ≈ 7.6:1 |
| 欄位標籤(uppercase) | 12px / 16px, `letter-spacing: .04em` | `#667085` | ≈ 4.9:1 |
| KPI 數值 | 28–32px / 1.2, tabular-nums | `#101828` | ≈ 17:1 |
| 區塊標題 | 16px / 24px, 600 | `#101828` | — |
- 數字一律 `font-variant-numeric: tabular-nums;` 讓欄位對齊。
- **禁用清單**:`#98A2B3`、`#D0D5DD` 不得作為文字色(僅限邊框/分隔線)。
- disabled 文字最低 `#667085` + `opacity:.6`,並輔以 `aria-disabled`,不可只靠變淡。
**驗收**
1. 對比矩陣:把所有「文字色 × 背景色」組合列表,全部實測 ≥ 4.5:1(≥18.66px bold 或 ≥24px 可放寬到 3:1)。
2. 瀏覽器縮放 200%(WCAG 1.4.4):無截斷、無重疊、無水平捲軸。
3. 文字間距覆寫測試(1.4.12):`line-height:1.5; letter-spacing:.12em; word-spacing:.16em; margin-bottom:2em` 注入後版面不破。
---
### P1-6 固定 1280px 寬
> Skill Priority 5 反模式:「Fixed px container widths」「Horizontal scroll」。
**違反**:WCAG 1.4.10 Reflow(需在 320 CSS px 寬、或 400% 縮放下無雙向捲動)。
**後果**:1440/1920 螢幕左右大量留白但表格仍被壓縮;筆電 1280 以下直接出現水平捲軸。
**修正值**
```css
.app-shell {
width: 100%;
max-width: 1600px; /* 上限而非固定寬 */
margin-inline: auto;
padding-inline: clamp(16px, 3vw, 32px);
}
.kpi-grid {
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
```
- 斷點:**390 / 768 / 1024 / 1280 / 1600**(mobile-first,全部用 `min-width`)。
- 側欄:`≥1280` 展開 240px;`1024–1279` 收成 64px icon rail(此時 icon 必須有 `aria-label` + tooltip,見 P0-2);`<1024` 改為 off-canvas 抽屜。
- 表格用 `min-width` + 外層 `overflow-x:auto` + `tabindex="0"` + `aria-label`,讓捲動容器本身可鍵盤操作。
- 間距 token(dense 檔位):`4 / 8 / 12 / 16 / 24 / 32`。
**驗收**
1. DevTools 響應式模式,從 320px 拖到 1920px 連續縮放,**不得出現非預期水平捲軸**、不得有重疊或裁切。
2. 1920px 下內容不「左靠空一半」;1024px 下核心 KPI 仍在首屏。
3. 400% 瀏覽器縮放(等效 320px)仍可完成「查看告警 → 開啟明細 → 執行動作」。
---
### P2 其他(一併處理成本很低)
| # | 問題 | 修正值 |
|---|---|---|
| P2-7 | 狀態切換 0ms/或全站一個 duration | micro 120ms、面板 200ms、頁面 300ms,`ease-out` 進場、`ease-in` 出場且出場更快;全站包 `@media (prefers-reduced-motion: reduce){ *{animation-duration:.01ms!important; transition-duration:.01ms!important} }` |
| P2-8 | 載入無回饋、資料進來後版面跳動 | 骨架屏保留與實際內容相同高度;> 400ms 才顯示 spinner;CLS < 0.1 |
| P2-9 | 空狀態/錯誤狀態缺失 | 每張卡片四態齊備:loading / empty(含一句說明 + 一個主動作)/ error(含重試)/ partial |
| P2-10 | 圖表無圖例、無 tooltip、無可及替代 | 補圖例、hover+focus tooltip、`<figcaption>` 摘要或可切換的資料表格 |
| P2-11 | 顏色寫死 hex 在元件內 | 抽成語意 token:`--color-text-secondary`、`--color-status-critical-fg` 等 |
---
## 2. 整體驗收方式(Definition of Done)
**自動化**
- `axe-core`(CI,每頁)→ critical/serious = **0**
- Lighthouse Accessibility ≥ **95**,CLS < **0.1**
- 視覺回歸(Playwright + 截圖)涵蓋:default / hover / **focus-visible** / active / disabled / loading / empty / error 八態
- Lint 規則:`jsx-a11y/control-has-associated-label`、禁止 `outline: none` 的 stylelint 自訂規則
**人工(每次發版跑一次,約 20 分鐘)**
1. **鍵盤走查**:純鍵盤完成 3 條主要任務流程,Tab 順序符合視覺順序,無鍵盤陷阱,Esc 可關閉所有浮層。
2. **螢幕閱讀器**:NVDA(Win) 或 VoiceOver(mac) 走訪工具列與告警區,名稱/角色/狀態齊全。
3. **灰階 + 色盲模擬**截圖檢查。
4. **縮放矩陣**:100% / 200% / 400%,以及 390 / 768 / 1024 / 1280 / 1920 五個寬度截圖。
5. **觸控實機**:平板上不依賴 hover 完成所有列動作。
---
## 3. 390px 手機版重排方案
> 目標:不是把 1280 縮小,而是**重新決定資訊優先序**。Mobile-first 重寫,桌面用 `min-width` 疊加。
### 版面骨架(390 × 844,安全區域內)
```
┌─────────────────────────────┐ ← env(safe-area-inset-top)
│ ☰ 儀表板 🔔3 👤 │ sticky header, h=56px
├─────────────────────────────┤
│ [今日 ▾] [全部服務 ▾] ⚙︎ │ 篩選列 h=44, 水平捲動 chips
├─────────────────────────────┤
│ ⚠ 3 項嚴重告警 查看 ›│ 告警橫幅(有事才出現)h≥48
├─────────────────────────────┤
│ ┌────────┐ ┌────────┐ │ KPI:2 欄 grid, gap 12
│ │ 錯誤率 │ │ 延遲 │ │ 卡高 ~92px
│ │ 2.4%▲ │ │ 218ms▼ │ │ 數值 24px/600, 標籤 12px
│ └────────┘ └────────┘ │
│ ┌────────┐ ┌────────┐ │ 最多 4 張 → 其餘收進「更多指標」
│ └────────┘ └────────┘ │
├─────────────────────────────┤
│ 流量趨勢 ⋯ │ 圖表卡:高 200px
│ ▁▂▃▅▇▅▃ ← 可橫向捲動+snap │ X 軸標籤最多 4 個
├─────────────────────────────┤
│ 告警列表 │ 表格 → 卡片列表
│ ┌─────────────────────────┐ │
│ │ 🔺警告 api-gateway │ │ 每張卡 ≥ 72px
│ │ 逾時率 12% · 8 分鐘前 │ │ 標題 15px/600、meta 13px
│ │ [確認] [靜音] ⋯ │ │ 動作永遠可見,高 44px
│ └─────────────────────────┘ │
│ ⋮ 無限捲動 │
└─────────────────────────────┘
│ 總覽 告警 服務 我 │ bottom nav h=56 + safe-area
└─────────────────────────────┘ ← env(safe-area-inset-bottom)
```
### 具體規則
| 項目 | 桌面 | 390px 做法 |
|---|---|---|
| 容器 | max-width 1600 + clamp padding | `padding-inline: 16px`,`width:100%` |
| 側欄 | 240px 固定 | 收成 `☰` 抽屜,寬 `min(85vw, 320px)`,含 focus trap + Esc 關閉 |
| KPI | auto-fit 4–6 欄 | **2 欄 × 最多 2 列**,其餘折疊;不要一欄堆疊 6 張(捲動成本過高) |
| 表格 | 多欄表格 | **改成卡片列表**(每卡:狀態圖示+標題 / 一行 metadata / 動作列)。不要用縮小字體硬塞表格 |
| 列動作 | hover 顯示 | **永遠可見**:前 2 個主要動作用文字按鈕(h=44),其餘進 `⋯` → bottom sheet |
| 篩選 | 頂部一整排 | 水平捲動 chip 列 + `⚙︎` 開 bottom sheet(含「重設/套用」固定底部) |
| 圖表 | 寬版折線 | 高度 200px,資料點抽稀,`scroll-snap-type: x mandatory` 橫向捲;圖例移到標題下方單行 |
| 觸控目標 | ≥ 32×32 | **≥ 44×44**,間距 ≥ 8px |
| 字級 | 14/12 | 內文 **15–16px**、metadata **13px**;表單 `input { font-size:16px }` 防 iOS 自動縮放 |
| 導覽 | 側欄 | 底部 tab bar,**≤ 5 項**,含 label 文字(非純圖示) |
| 縮放 | — | `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`,**禁止** `user-scalable=no` / `maximum-scale=1` |
| 安全區 | — | `padding-bottom: calc(56px + env(safe-area-inset-bottom))` |
### 內容優先序(390px 由上而下)
1. 現在有沒有事?(告警橫幅)
2. 最重要的 2–4 個數字
3. 一張趨勢圖
4. 可操作的告警/事件列表
5. 其餘全部收進二級頁或 bottom sheet
### 390px 專屬驗收
1. 單手拇指可達:主要動作落在畫面下 2/3。
2. `@media (hover: none)` 下,**沒有任何**功能需要 hover 才能發現或觸發。
3. 320px(iPhone SE / 400% 縮放)仍無水平捲軸,卡片不破版。
4. 橫向(844×390)時 bottom sheet 不超出視窗、header 縮至 48px。
5. 深色模式下狀態色改用 400 階(`#F97066` / `#FDB022` / `#47CD89`)對深底 `#0C111D`,重新量對比 ≥ 4.5:1。
---
## 4. 建議修復順序
1. **Sprint 1(P0)**:focus ring → icon button aria-label → 移除 hover-only → 狀態三重編碼
2. **Sprint 2(P1)**:type scale + 灰階色票重整 → 流式容器與斷點
3. **Sprint 3(P2 + 390px)**:token 化、四態齊備、手機版重排
前兩項 P0 各約半天工,投報率最高,建議先做。
---
**再次提醒**:以上色碼對比為公式推算值,`ui-ux-pro-max` 的實際調色盤/字體配對/GSAP 預設我**未能查詢**。若你能在有 Shell 的環境重跑,建議至少執行這三條以取得資料庫驗證過的建議:
```bash
python "${CLAUDE_PLUGIN_ROOT}/.claude/skills/ui-ux-pro-max/scripts/search.py" "focus not obscured" --domain ux
python "${CLAUDE_PLUGIN_ROOT}/.claude/skills/ui-ux-pro-max/scripts/search.py" "icon button accessible label" --domain icons
python "${CLAUDE_PLUGIN_ROOT}/.claude/skills/ui-ux-pro-max/scripts/search.py" "internal analytics dashboard" --design-system --density 8
```