From 38edb538ca42b1b4150cde1595e2a0865f334cab Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Wed, 21 Oct 2026 08:02:44 +0800 Subject: [PATCH 1/2] test(ui): check that every message key the viewer passes exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `t()` accepts any string, so vue-tsc does not catch a misspelled key; it shows the key at runtime. `i18n/keys.test.ts` reads the viewer sources and checks every literal key, `keypath`, and template prefix against the en messages. Also: - zh-Hans says 执行成功率 for the completion rate on the compare and matrix views too (they said 完成率) - remove `countOf` from `format.ts`; nothing calls it after the translation - AGENTS.md: point floating-surface examples to `PreferencesMenu.vue`, and add the rule that viewer text goes through vue-i18n Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 3 +- packages/ui/client/src/format.ts | 13 ----- packages/ui/client/src/i18n/keys.test.ts | 51 +++++++++++++++++++ .../src/i18n/locales/zh-Hans/compare.ts | 4 +- .../client/src/i18n/locales/zh-Hans/matrix.ts | 2 +- 5 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 packages/ui/client/src/i18n/keys.test.ts diff --git a/AGENTS.md b/AGENTS.md index 3a32549..f4f7648 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -92,13 +92,14 @@ Concise but detailed reference for contributors working in the `vieval-dev/vieva - Use Iconify icon sets; avoid bespoke SVGs. - Animations: keep intuitive, lively, and readable. - Viewer UI (`packages/ui/client`) floating surfaces reuse the existing wrappers, never a bare reka-ui content or a new look: - - Menus, popovers, and hover cards: reka-ui `DropdownMenuContent` / `PopoverContent` / `HoverCardContent` with `as-child`, wrapping `AnimatedContent` (`components/AnimatedContent.vue`, the open/close motion ported from airi), styled with the `floating` / `floating-arrow` shortcuts. Follow `CompareMenu.vue` and `HuePicker.vue`. When the content scrolls, scroll an inner element: `AnimatedContent` clips its own root. + - Menus, popovers, and hover cards: reka-ui `DropdownMenuContent` / `PopoverContent` / `HoverCardContent` with `as-child`, wrapping `AnimatedContent` (`components/AnimatedContent.vue`, the open/close motion ported from airi), styled with the `floating` / `floating-arrow` shortcuts. Follow `CompareMenu.vue` and `PreferencesMenu.vue` (a popover with a nested dropdown menu). When the content scrolls, scroll an inner element: `AnimatedContent` clips its own root. - One-line hints: reka-ui `Tooltip` with the `tooltip` / `tooltip-arrow` shortcuts (animated in `styles.css`). - Phones: bottom sheets use vaul-vue `Drawer` (as in airi's Live2D report modal) on the same `floating` surface; share the body component between the desktop popover and the phone drawer. - In-page choices use reka-ui (`DropdownMenuRadioGroup` for one of many), not native `