From 715b489ada14372d8e22a6a42e92c23fdff019f6 Mon Sep 17 00:00:00 2001 From: TianxingZhang-0129 Date: Fri, 26 Jun 2026 11:47:57 +0800 Subject: [PATCH 1/2] test(web-ui): add font size persistence locators --- docs/development/ui-testids-CN.md | 4 ++-- docs/development/ui-testids.md | 4 ++-- .../font-preference/components/FontPreferencePanel.tsx | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/development/ui-testids-CN.md b/docs/development/ui-testids-CN.md index 7db672b04a..97a8db2389 100644 --- a/docs/development/ui-testids-CN.md +++ b/docs/development/ui-testids-CN.md @@ -268,8 +268,8 @@ | Appearance 语言选项 | `appearance-language-option` | 重复的语言下拉选项。包含 `data-locale-id`,并带有 Select 组件提供的 `data-selected`。 | | Appearance 主题选择器 | `appearance-theme-select` | Appearance 中 theme Select 的真实触发节点。 | | Appearance 主题选项 | `appearance-theme-option` | 重复的主题下拉选项。包含 `data-theme-id`,并带有 Select 组件提供的 `data-selected`。 | -| Appearance UI 字号分组 | `appearance-ui-font-level-group` | UI font size 预置级别按钮组根节点。 | -| Appearance UI 字号按钮 | `appearance-ui-font-level-btn` | 重复的 UI font size 预置级别按钮。包含 `data-font-level` 和 `data-selected`。 | +| Appearance 字体大小分组 | `appearance-font-size-group` | Appearance 页面里用于字体大小持久化用例的 UI 预置字号按钮组根节点。 | +| Appearance 字体大小选项 | `appearance-font-size-option` | 重复的可点击 UI 字体大小选项。包含 `data-size-level`、兼容保留的 `data-font-level`、`data-selected` 和 `aria-pressed`。 | | Appearance UI 自定义字号控制区 | `appearance-ui-font-custom-controls` | custom UI 字号控制区根节点,仅在 custom 激活时渲染。 | | Appearance UI 自定义字号输入框 | `appearance-ui-font-custom-input` | custom UI 字号 px 输入框。包含 `data-font-level="custom"`。 | | Appearance UI 自定义字号减一按钮 | `appearance-ui-font-custom-step-minus` | custom UI 字号减一按钮。 | diff --git a/docs/development/ui-testids.md b/docs/development/ui-testids.md index b91d754832..6fa2bcaa02 100644 --- a/docs/development/ui-testids.md +++ b/docs/development/ui-testids.md @@ -268,8 +268,8 @@ Model locator guidance: | Appearance language option | `appearance-language-option` | Repeated language dropdown option. Includes `data-locale-id` and Select-provided `data-selected`. | | Appearance theme select | `appearance-theme-select` | Theme select trigger in Appearance settings. | | Appearance theme option | `appearance-theme-option` | Repeated theme dropdown option. Includes `data-theme-id` and Select-provided `data-selected`. | -| Appearance UI font level group | `appearance-ui-font-level-group` | UI font preset button group root. | -| Appearance UI font level button | `appearance-ui-font-level-btn` | Repeated preset button. Includes `data-font-level` and `data-selected`. | +| Appearance font size group | `appearance-font-size-group` | UI font preset button group root for the Appearance page persistence flow. | +| Appearance font size option | `appearance-font-size-option` | Repeated clickable UI font size option. Includes `data-size-level`, legacy `data-font-level`, `data-selected`, and `aria-pressed`. | | Appearance UI font custom controls | `appearance-ui-font-custom-controls` | Custom UI font px controls root, rendered when custom is active. | | Appearance UI font custom input | `appearance-ui-font-custom-input` | Custom UI font px number input. Includes `data-font-level="custom"`. | | Appearance UI font custom step minus | `appearance-ui-font-custom-step-minus` | Custom UI font px decrement button. | diff --git a/src/web-ui/src/infrastructure/font-preference/components/FontPreferencePanel.tsx b/src/web-ui/src/infrastructure/font-preference/components/FontPreferencePanel.tsx index 2fe3324233..e8ea945e8c 100644 --- a/src/web-ui/src/infrastructure/font-preference/components/FontPreferencePanel.tsx +++ b/src/web-ui/src/infrastructure/font-preference/components/FontPreferencePanel.tsx @@ -150,7 +150,7 @@ export function FontPreferencePanel() { className="font-pref-panel__level-buttons" role="group" aria-label={t('appearance.fontSize.uiSizeLabel')} - data-testid="appearance-ui-font-level-group" + data-testid="appearance-font-size-group" > {UI_LEVELS.map((l) => (