From e309301dd6b3af1f60687d86232a418f1d15f4e8 Mon Sep 17 00:00:00 2001 From: Estrella Pan Date: Mon, 6 Jul 2026 11:38:59 +0200 Subject: [PATCH] refactor(webui): complete ab-* migration, retire legacy components Migrate the remaining surfaces: all seven ab-popup call sites to ab-modal (footer slots, sm sizing), every ab-label to ab-field, all raw ab-input-shortcut inputs to the ab-input component (textareas get local Soft Ink styles), rss mobile list to ab-list with loading skeleton, and de-tint the hand-rolled warning callouts (hairline + ink, per the no-tinted-boxes rule). Wire aria-live into pull-refresh. Delete dead code: ab-popup, ab-adaptive-modal, ab-label, ab-data-list, ab-add, ab-button-multi, ab-image, ab-rule, ab-swipe-container (+ orphaned stories); drop the ab-input/input-error UnoCSS shortcuts. Add stories for the full universal set and document the final 22-component catalog in DESIGN.md. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01FAxVyRwrY7z5NotTtgnwVs --- DESIGN.md | 13 + webui/src/components/ab-change-account.vue | 37 +-- webui/src/components/ab-edit-rule.vue | 12 +- webui/src/components/ab-image.vue | 54 ---- webui/src/components/ab-label.vue | 67 ----- webui/src/components/ab-popup.vue | 129 --------- webui/src/components/ab-rule.vue | 138 ---------- webui/src/components/bangumi-offset-field.vue | 5 +- .../components/basic/ab-adaptive-modal.vue | 45 ---- webui/src/components/basic/ab-add.stories.ts | 22 -- webui/src/components/basic/ab-add.vue | 109 -------- .../src/components/basic/ab-alert.stories.ts | 30 +++ .../src/components/basic/ab-badge.stories.ts | 25 ++ .../basic/ab-button-multi.stories.ts | 32 --- .../src/components/basic/ab-button-multi.vue | 193 -------------- webui/src/components/basic/ab-data-list.vue | 244 ------------------ .../src/components/basic/ab-empty.stories.ts | 27 ++ webui/src/components/basic/ab-input.vue | 3 + webui/src/components/basic/ab-list.stories.ts | 35 +++ .../basic/ab-offset-mismatch-dialog.vue | 6 +- .../components/basic/ab-progress.stories.ts | 23 ++ .../src/components/basic/ab-pull-refresh.vue | 8 +- .../components/basic/ab-skeleton.stories.ts | 23 ++ .../components/basic/ab-swipe-container.vue | 149 ----------- .../components/basic/ab-toolbar.stories.ts | 27 ++ .../layout/ab-notification-center.vue | 2 +- .../components/search/ab-search-confirm.vue | 10 +- webui/src/components/setting/config-llm.vue | 14 +- .../setting/config-notification.vue | 59 +++-- .../src/components/setting/config-passkey.vue | 16 +- .../setting/config-search-provider.vue | 46 ++-- .../components/setup/wizard-step-account.vue | 12 +- .../setup/wizard-step-downloader.vue | 24 +- .../setup/wizard-step-notification.vue | 12 +- .../src/components/setup/wizard-step-rss.vue | 8 +- webui/src/i18n/en.json | 3 +- webui/src/i18n/zh-CN.json | 3 +- webui/src/pages/index/config.vue | 5 +- webui/src/pages/index/downloader.vue | 23 +- webui/src/pages/index/log.vue | 5 +- webui/src/pages/index/rss.vue | 40 +-- webui/types/dts/components.d.ts | 9 - webui/unocss.config.ts | 11 - 43 files changed, 383 insertions(+), 1375 deletions(-) delete mode 100644 webui/src/components/ab-image.vue delete mode 100644 webui/src/components/ab-label.vue delete mode 100644 webui/src/components/ab-popup.vue delete mode 100644 webui/src/components/ab-rule.vue delete mode 100644 webui/src/components/basic/ab-adaptive-modal.vue delete mode 100644 webui/src/components/basic/ab-add.stories.ts delete mode 100644 webui/src/components/basic/ab-add.vue create mode 100644 webui/src/components/basic/ab-alert.stories.ts create mode 100644 webui/src/components/basic/ab-badge.stories.ts delete mode 100644 webui/src/components/basic/ab-button-multi.stories.ts delete mode 100644 webui/src/components/basic/ab-button-multi.vue delete mode 100644 webui/src/components/basic/ab-data-list.vue create mode 100644 webui/src/components/basic/ab-empty.stories.ts create mode 100644 webui/src/components/basic/ab-list.stories.ts create mode 100644 webui/src/components/basic/ab-progress.stories.ts create mode 100644 webui/src/components/basic/ab-skeleton.stories.ts delete mode 100644 webui/src/components/basic/ab-swipe-container.vue create mode 100644 webui/src/components/basic/ab-toolbar.stories.ts diff --git a/DESIGN.md b/DESIGN.md index fa81f72a..2602f2a4 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -59,6 +59,19 @@ Semantic scale only: `--z-dropdown` 10 · `--z-sticky` 20 · `--z-fixed` 30 · ` - Soft Ink component grammar: filled controls on `--color-surface-2` (border only on focus/error); tags are hairline chips with a square semantic mark and ink text; status is a square mark + ink label; tabs underline (no thumb); alerts are hairline outlines led by a bold colored word (no icons, no tinted fills); toasts are inverted ink chips; empty states are left-aligned prose with one action; loading is skeletons, not spinners-in-content. - Every universal component ships a Storybook story and (where it has behavior) a vitest test in `__tests__/`. +The universal set (`src/components/basic/` unless noted): + +| Group | Components | +|---|---| +| Actions | `ab-button` (primary/secondary/ghost/danger·sm/md·loading), `ab-icon-button` (required label, 44px touch, ghost/solid/round), `ab-menu` (headlessui dropdown), `ab-split-button` | +| Forms | `ab-field` (label/description/error/required + aria wiring via injection), `ab-input` (affixes, clearable, password reveal, error), `ab-select`, `ab-switch`, `ab-segmented` (underline tabs), `ab-setting` (root — field+control settings row) | +| Overlays | `ab-modal` (adaptive: dialog ≥ tablet, bottom sheet on mobile; footer slot; sizes sm/md/lg), `useConfirm()` + `ab-confirm-host` (promise confirm, danger variant), `ab-tooltip`, `ab-bottom-sheet` (internal to ab-modal) | +| Display | `ab-tag` (semantic marks: success/warning/danger/info/neutral, closable), `ab-status` (running/stopped/paused/degraded + label/detail), `ab-badge` (count/dot, 99+), `ab-container` (root — title/footer/flush card), `ab-fold-panel` (root — accessible, animated), `ab-progress` | +| Data & feedback | `ab-list` (selection, loading skeleton, density comfortable/compact, empty slot), `ab-toolbar` (search/filters/actions), `ab-alert` (hairline, bold lead word), toast via `useMessage()` (inverted ink), `ab-empty`, `ab-skeleton` (lines/row/card), `ab-pull-refresh` | +| Page chrome | `ab-page-title`, `ab-search`, `ab-status-bar` (root), layout shells | + +Retired (do not reintroduce): `ab-popup`, `ab-adaptive-modal`, `ab-label`, `ab-setting`'s type-switch-only API, `ab-add`, `ab-button-multi`, `ab-data-list`, `ab-image`, `ab-rule`, `ab-swipe-container`, and the `ab-input` UnoCSS attribute shortcut. + ## Voice UI copy through i18n only (`src/i18n/en.json` + `zh-CN.json`, keys always added in pairs). Sentence case in English. Labels are nouns, buttons are verbs, errors say what to do next. diff --git a/webui/src/components/ab-change-account.vue b/webui/src/components/ab-change-account.vue index 03a6b8ee..71d1ada7 100644 --- a/webui/src/components/ab-change-account.vue +++ b/webui/src/components/ab-change-account.vue @@ -7,37 +7,28 @@ const { user, update } = useAuth(); diff --git a/webui/src/components/ab-edit-rule.vue b/webui/src/components/ab-edit-rule.vue index f27b526f..121d94b7 100644 --- a/webui/src/components/ab-edit-rule.vue +++ b/webui/src/components/ab-edit-rule.vue @@ -190,11 +190,11 @@ function emitUnarchive() {