feat: Improve Time panel keyboard navigation and semantics#987
Conversation
|
@Pareder is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
概述为时间面板添加无障碍访问支持: 变更内容时间面板无障碍访问与本地化扩展
估计代码审查工作量🎯 3 (Moderate) | ⏱️ ~20 分钟 可能相关的 PR
建议审查者
小诗
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request improves the accessibility of the time picker components by adding ARIA roles and labels (such as role="listbox", role="option", and role="group") to TimeColumn and TimePanelBody. It also expands the Locale interface and updates numerous locale files with translations for hours, minutes, seconds, milliseconds, and select labels. The review feedback suggests using optional chaining and safe fallbacks for the new locale properties to prevent potential undefined values at runtime when using older or custom locales, and adding an aria-label to the group container in TimePanelBody to ensure it is properly announced by screen readers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| function getListLabel(type: TimeUnitType, locale: Locale) { | ||
| switch (type) { | ||
| case 'hour': | ||
| return locale.hourSelect; | ||
| case 'minute': | ||
| return locale.minuteSelect; | ||
| case 'second': | ||
| return locale.secondSelect; | ||
| case 'millisecond': | ||
| return locale.millisecondSelect; | ||
| case 'meridiem': | ||
| return locale.meridiemSelect; | ||
| default: | ||
| return ''; | ||
| } | ||
| } | ||
|
|
||
| function getListItemLabel(type: TimeUnitType, value: string | number, locale: Locale) { | ||
| switch (type) { | ||
| case 'hour': | ||
| return `${value} ${locale.hours}`; | ||
| case 'minute': | ||
| return `${value} ${locale.minutes}`; | ||
| case 'second': | ||
| return `${value} ${locale.seconds}`; | ||
| case 'millisecond': | ||
| return `${value} ${locale.milliseconds}`; | ||
| case 'meridiem': | ||
| return value.toString(); | ||
| default: | ||
| return ''; | ||
| } | ||
| } |
There was a problem hiding this comment.
When users provide custom or older locale configurations, the newly added properties (such as hours, minutes, seconds, milliseconds, and their corresponding Select labels) might be undefined at runtime. Accessing them directly in template literals (e.g., `${value} ${locale.hours}`) will result in strings like "12 undefined" being read by screen readers.
Using optional chaining and providing safe fallbacks prevents this issue and ensures a robust user experience.
function getListLabel(type: TimeUnitType, locale: Locale) {
switch (type) {
case 'hour':
return locale?.hourSelect || '';
case 'minute':
return locale?.minuteSelect || '';
case 'second':
return locale?.secondSelect || '';
case 'millisecond':
return locale?.millisecondSelect || '';
case 'meridiem':
return locale?.meridiemSelect || '';
default:
return '';
}
}
function getListItemLabel(type: TimeUnitType, value: string | number, locale: Locale) {
switch (type) {
case 'hour':
return locale?.hours ? `${value} ${locale.hours}` : value.toString();
case 'minute':
return locale?.minutes ? `${value} ${locale.minutes}` : value.toString();
case 'second':
return locale?.seconds ? `${value} ${locale.seconds}` : value.toString();
case 'millisecond':
return locale?.milliseconds ? `${value} ${locale.milliseconds}` : value.toString();
case 'meridiem':
return value.toString();
default:
return '';
}
}
| <div | ||
| role="group" | ||
| className={clsx(`${prefixCls}-content`, classNames.content)} | ||
| style={styles.content} | ||
| > |
There was a problem hiding this comment.
The container div has been given role="group" to group the time columns (hours, minutes, seconds, etc.). To make this group accessible and identifiable to screen readers, it should have an accessible name. Adding aria-label={locale?.timeSelect} provides the necessary context for assistive technologies.
| <div | |
| role="group" | |
| className={clsx(`${prefixCls}-content`, classNames.content)} | |
| style={styles.content} | |
| > | |
| <div | |
| role="group" | |
| aria-label={locale?.timeSelect} | |
| className={clsx(`${prefixCls}-content`, classNames.content)} | |
| style={styles.content} | |
| > |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #987 +/- ##
=======================================
Coverage 98.81% 98.81%
=======================================
Files 66 66
Lines 2698 2711 +13
Branches 749 749
=======================================
+ Hits 2666 2679 +13
Misses 29 29
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 6
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (23)
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx-136-143 (1)
136-143: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win为时间列补上可达的焦点管理
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx:136-143这里只暴露了role="listbox"/"option",但ul本身不可聚焦,也没有aria-activedescendant;如果上层没有把焦点/键盘事件转到这列,读屏和键盘就进不到这里。建议补tabIndex或改成受控的 active-descendant 模式。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx` around lines 136 - 143, The TimeColumn listbox is not keyboard-accessible because the ul only exposes role/listbox semantics without a focus target or active descendant control. Update TimeColumn in TimePanelBody to make the listbox focusable with tabIndex or wire it to a proper aria-activedescendant pattern, and ensure the selected/active option is tracked through the existing option rendering and scroll handling so keyboard and screen reader focus can reach this column.src/locale/gl_ES.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位文案会让单数选项的 aria-label 不正确。
TimeColumn.tsx会直接拼出${value} ${unit}。这里的复数形式会让读屏结果变成1 Horas、1 Segundos这种不正确的标签。建议改成对所有数值都可用的写法,或把单复数处理放回组件。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/gl_ES.ts` around lines 15 - 18, The locale labels in gl_ES.ts use plural unit names that make TimeColumn.tsx build incorrect aria-labels like “1 Horas” and “1 Segundos”. Update the unit strings in the locale mapping to values that work for any numeric value, or adjust TimeColumn.tsx so it handles singular/plural formatting instead of concatenating `${value} ${unit}` directly; use the TimeColumn and locale keys for hours, minutes, seconds, and milliseconds to locate the change.src/locale/fr_FR.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位文案会生成错误的单数 aria-label。
TimeColumn.tsx会直接把它们拼成${value} ${unit}。这里使用复数形式后,屏幕阅读器会读出1 Heures、1 Secondes之类不正确的标签。建议改成对任意数值都成立的中性写法,或把单复数处理放回TimeColumn。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/fr_FR.ts` around lines 15 - 18, The localized unit labels in fr_FR.ts are using plural forms that get concatenated by TimeColumn.tsx into aria-labels like “1 Heures” and “1 Secondes”. Update the entries for hours, minutes, seconds, and milliseconds to neutral singular-safe wording, or adjust TimeColumn so it handles singular/plural forms instead of blindly using ${value} ${unit}. Use the TimeColumn and locale keys to find the affected path.src/locale/he_IL.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位文案会生成错误的单数读屏标签。
下游会直接把数值和这些单位拼成
aria-label。当前使用复数形式后,像1 שעות这样的结果会是错误的。建议改成数值无关的单位写法,或在TimeColumn中处理词形变化。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/he_IL.ts` around lines 15 - 18, The time unit labels in he_IL currently use plural forms, which will produce incorrect aria-label text when combined with a value like 1 in downstream rendering. Update the locale entries for the affected unit symbols in the locale file to use value-independent wording, or adjust the TimeColumn formatting logic to handle singular/plural inflection before composing the label.src/locale/hi_IN.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位词形不适合作为所有数值选项的固定 aria-label 后缀。
下游会直接生成
${value} ${unit}。按当前写法,至少会出现1 घंटे这种不自然的单数标签。建议改成数值无关的单位写法,或在TimeColumn中处理单复数/词形变化。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/hi_IN.ts` around lines 15 - 18, The fixed unit strings in the hi_IN locale are not suitable for every aria-label value because TimeColumn concatenates them directly as "${value} ${unit}", which produces incorrect forms like singular-plural mismatches. Update the hi_IN entries for hours, minutes, seconds, and milliseconds to use value-agnostic unit wording, or adjust TimeColumn to choose the correct singular/plural form before building the aria-label.src/locale/hr_HR.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位词形不适合作为所有数值选项的固定后缀。
TimeColumn.tsx会直接把它们拼进${value} ${unit}。当前写法至少会生成1 Sati这类不正确的读屏标签。建议改成对任意数值都成立的中性写法,或把词形变化放到组件层处理。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/hr_HR.ts` around lines 15 - 18, The unit labels in the hr_HR locale are being used as a fixed suffix by TimeColumn.tsx via `${value} ${unit}`, so the current plural/gendered forms like hours and minutes produce incorrect strings for some values. Update the locale entries referenced by the TimeColumn component to neutral forms that work for any numeric value, or adjust TimeColumn to choose the correct inflected form based on the value; use the unit keys in hr_HR.ts and the TimeColumn.tsx formatting path to locate the change.src/locale/ga_IE.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位词形不适合作为所有数值选项的固定后缀。
下游会直接生成
${value} ${unit}的aria-label。当前写法里至少会出现1 Uaireanta这类不自然的读法,影响读屏结果。建议改成数值无关的中性写法,或在TimeColumn中做词形变化。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/ga_IE.ts` around lines 15 - 18, The Gaelic unit labels in ga_IE are being used as fixed suffixes in the aria-label generation, so plural forms like hours/minutes need to be replaced with number-neutral terms or handled with proper inflection logic. Update the locale entries in the ga_IE time labels so `${value} ${unit}` stays natural for all values, or adjust TimeColumn to choose the correct form based on the numeric value, using the existing locale keys for hours, minutes, seconds, and milliseconds.src/locale/fr_CA.ts-15-18 (1)
15-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win这些单位文案会生成错误的单数 aria-label。
TimeColumn.tsx会直接把它们拼成${value} ${unit}。这里使用复数形式后,屏幕阅读器会读出1 Heures、1 Secondes之类不正确的标签。建议改成对任意数值都成立的中性写法,或把单复数处理放回TimeColumn。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/fr_CA.ts` around lines 15 - 18, The locale strings in fr_CA.ts for TimeColumn are using plural unit labels that get concatenated directly in TimeColumn.tsx as “${value} ${unit}”, which produces incorrect aria-labels for singular values. Update the unit entries referenced by TimeColumn to neutral forms that work for both singular and plural, or move singular/plural selection into TimeColumn so the generated labels are correct for all values.src/locale/it_IT.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect这里翻成了“子午线”,语义不对。这个字段对应的是 AM/PM 时段选择,不是地理意义上的
meridiano。当前读屏会把该列读成 “Seleziona il meridiano”,语义会误导用户。建议改成直接指向 AM/PM 的文案。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/it_IT.ts` at line 28, The localized label for meridiemSelect in the Italian locale uses the wrong meaning (“meridiano”) instead of the AM/PM time period selector. Update the it_IT translation entry for meridiemSelect to a phrase that clearly refers to AM/PM selection, and keep the change limited to the locale string so the UI and screen reader announce the correct time-period choice.src/locale/pt_BR.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect还是英文/技术术语。Line 28 会直接成为时间列的
aria-label;在 pt-BR 下让屏幕阅读器读出meridiem不够自然,也和这次“补全本地化文案”的目标不一致。建议换成该 locale 常用的 AM/PM 或对应本地表达。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/pt_BR.ts` at line 28, The pt_BR locale string for meridiemSelect is still using the English/technical term “meridiem”; update the pt_BR translation in the locale object so the time-column aria-label uses a natural Brazilian Portuguese AM/PM equivalent or local phrasing. Locate the meridiemSelect entry in the pt_BR translation file and replace it with a fully localized label consistent with the rest of the locale.src/locale/nl_NL.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect还没有真正本地化。Line 28 的值会被
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx直接作为aria-label使用;meridiem对荷兰语用户来说仍是生硬的外来术语。建议替换成该 locale 常见的 AM/PM 或对应本地表达。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/nl_NL.ts` at line 28, The meridiemSelect locale string in nl_NL is still using the untranslated term “meridiem”, so update the nl_NL entry to a Dutch-friendly AM/PM label or equivalent local wording. Change the value in the locale object used by TimeColumn’s aria-label so the string is natural for Dutch users, while keeping the meridiemSelect key unchanged.src/locale/pt_PT.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect仍未本地化。Line 28 的值会被
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx直接作为列表aria-label读出;meridiem在 pt-PT 里仍像占位术语,不像面向最终用户的可访问文案。建议替换为该 locale 常用的 AM/PM 或对应本地表达。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/pt_PT.ts` at line 28, The `meridiemSelect` locale string in `pt_PT.ts` is still not user-facing enough for the `TimeColumn` aria-label. Update the `meridiemSelect` entry in the Portuguese locale to a real pt-PT accessible label using the locale’s usual AM/PM wording or equivalent local expression, so `src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx` reads a properly localized value.src/locale/nl_BE.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect仍然是未本地化术语。Line 28 现在会被
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx直接读作列表的aria-label;保留meridiem会让荷兰语环境中的屏幕阅读器读出外来术语。这里建议改成该 locale 更常用的 AM/PM/上下午表述。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/nl_BE.ts` at line 28, `meridiemSelect` in the nl_BE locale is still using the untranslated term “meridiem”, which is surfaced directly by `TimeColumn.tsx` as the list `aria-label`. Update the `meridiemSelect` string in the locale object to a Dutch phrase that matches the locale’s common AM/PM or ochtend/middag wording so screen readers don’t announce a foreign term.src/locale/sr_RS.ts-24-28 (1)
24-28: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win统一
Select提示语气。Line 24-28 改成了
Izaberite ...,但本文件其他选择提示仍是Izaberi ...。这组字符串会直接用于 aria-label,建议保持同一种语气,避免同一 locale 内部前后不一致。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/sr_RS.ts` around lines 24 - 28, The Serbian locale selection labels are inconsistent: the hour/minute/second/millisecond/meridiem entries in sr_RS.ts use “Izaberite ...” while the rest of the locale uses “Izaberi ...”. Update those select prompt strings in the locale object so they all follow the same phrasing style as the other selection labels and remain consistent for aria-label usage.src/locale/sr_Cyrl_RS.ts-24-28 (1)
24-28: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win保持选择提示的人称/语气一致。
Line 24-28 使用了
Изаберите ...,但同文件现有的timeSelect/dateSelect/monthSelect/yearSelect/decadeSelect仍是Изабери ...。这会让读屏提示在同一语言包里忽然切换语气,建议统一。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/sr_Cyrl_RS.ts` around lines 24 - 28, The Serbian time selection labels in this locale file use a different imperative form than the existing date/month/year/decade prompts, causing inconsistent screen-reader phrasing. Update the related entries in the locale object around the time selection strings so the wording matches the same tone used by timeSelect, dateSelect, monthSelect, yearSelect, and decadeSelect, keeping the names hourSelect, minuteSelect, secondSelect, millisecondSelect, and meridiemSelect easy to find.src/locale/sk_SK.ts-24-28 (1)
24-28: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win统一
*Select文案语气。Line 24-28 从现有的
Vybrať ...切到了Vyberte ...,和同文件的timeSelect/dateSelect/monthSelect/yearSelect/decadeSelect不一致。既然这些值会直接进入 aria-label,建议统一成同一种表达方式。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/sk_SK.ts` around lines 24 - 28, The `*Select` labels in the locale object are inconsistent with the rest of the same file: `hourSelect`, `minuteSelect`, `secondSelect`, `millisecondSelect`, and `meridiemSelect` use a different imperative form than `timeSelect`, `dateSelect`, `monthSelect`, `yearSelect`, and `decadeSelect`. Update the `sk_SK` locale entries in the translation map to use one consistent wording style across all `*Select` strings so the aria-label text reads uniformly.src/locale/da_DK.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect仍未本地化。Line 28 里的
meridiem还是英文;它会被TimeColumn直接拿去生成aria-label,所以丹麦语读屏文案会混入英文,和这次补全本地化字符串的目标不一致。请改成丹麦语里实际使用的说法,或至少改成本地习惯的AM/PM表述。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/da_DK.ts` at line 28, The meridiemSelect locale string in da_DK is still using an English term, so update the locale entry in the da_DK translation object to a Danish-native label or local AM/PM wording. Check the meridiemSelect field used by TimeColumn for aria-label generation and replace it with the proper Danish phrase so screen-reader text stays fully localized.src/locale/tl_PH.ts-29-29 (1)
29-29: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
meridiemSelect还是英文占位词。Line 29 的
meridiem没有本地化;这个值会进入时间面板的aria-label,因此菲律宾语环境下读屏会读到英文术语。建议改成该语言里实际使用的上/下午表述,或使用本地习惯的AM/PM。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/tl_PH.ts` at line 29, The locale string for meridiemSelect in tl_PH is still using an English placeholder, so update the translation in the tl_PH locale object to a proper Filipino meridiem label or the locally expected AM/PM wording. Use the existing locale entry for meridiemSelect as the target symbol and ensure the aria-label text in the time panel is fully localized.src/locale/uz_UZ.ts-29-29 (1)
29-29: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win避免在 aria 文案里直接暴露英文术语
Meridiem。Line 29 的
Meridiemni tanlang会直接进入时间列的 aria-label。这里保留英文技术词会让本地化不完整,建议改成乌兹别克语里更常见的 AM/PM/时段选择表述。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/uz_UZ.ts` at line 29, The aria label for the meridiem selector still exposes the English term “Meridiem,” so update the localized string in uz_UZ.ts for meridiemSelect to use a natural Uzbek AM/PM or time-period phrase instead. Keep the change within the locale entry itself so the time column’s aria-label reads fully localized text when rendered.src/locale/uk_UA.ts-28-28 (1)
28-28: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win将
meridiemSelect改成更自然的乌克兰语提示。Line 28 的
Виберіть меридієм会被TimeColumn直接用作 aria-label,技术词感太强,读屏可理解性偏弱。这里更适合换成用户常见表述,例如“Виберіть час доби”或直接说明 AM/PM。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/uk_UA.ts` at line 28, The `meridiemSelect` label in `uk_UA.ts` is too technical for the aria-label used by `TimeColumn`; update the string to a more natural Ukrainian phrase that users will recognize, such as a “time of day” or AM/PM-oriented prompt. Keep the change localized to the `meridiemSelect` entry in the locale object so the accessibility label reads clearly for screen readers.src/locale/fi_FI.ts-19-19 (1)
19-19: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win拼写错误:
Valise应为Valitse。
timeSelect: 'Valise aika'拼写有误,本文件其余的选择文案均为Valitse ...(如第 20–27 行),应统一为Valitse aika。✏️ 建议修改
- timeSelect: 'Valise aika', + timeSelect: 'Valitse aika',🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/fi_FI.ts` at line 19, The fi_FI locale entry in the time selection label has a spelling mistake: update the `timeSelect` string in `fi_FI.ts` from the incorrect “Valise” form to the consistent “Valitse” form used by the other selection labels in the same locale file. Keep the change localized to the `timeSelect` translation key and ensure it matches the surrounding Finnish wording style.src/locale/fr_BE.ts-20-20 (1)
20-20: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win复制粘贴错误:
dateSelect文案错误。
dateSelect: "Sélectionner l'heure"与第 19 行timeSelect完全相同,描述的是“时间”而非“日期”。这会让日期选择的 aria 文案/提示出现错误语义。应改为 “Sélectionner la date”。✏️ 建议修改
- dateSelect: "Sélectionner l'heure", + dateSelect: 'Sélectionner la date',🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/fr_BE.ts` at line 20, The `dateSelect` translation in `fr_BE.ts` is a copy-paste mistake and currently uses the same wording as `timeSelect`, so update the `dateSelect` entry in the locale object to the correct French text for selecting a date, and verify the nearby `timeSelect`/`dateSelect` labels remain distinct and semantically accurate.src/locale/es_MX.ts-29-29 (1)
29-29: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win“meridiem” 未本地化。
meridiemSelect: 'Seleccionar meridiem'中的 “meridiem” 是英文/拉丁语词,并非标准西班牙语。建议改为 “meridiano” 或使用 “AM/PM”,与其它语言包保持一致的本地化处理。✏️ 建议修改
- meridiemSelect: 'Seleccionar meridiem', + meridiemSelect: 'Seleccionar un meridiano',🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locale/es_MX.ts` at line 29, The es_MX locale entry for meridiemSelect still uses the non-localized word “meridiem”; update the string in the locale object to a proper Spanish equivalent such as “meridiano” or “AM/PM” so it matches the rest of the translations. Keep the change confined to the meridiemSelect key in the es_MX locale definition.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/interface.tsx`:
- Around line 69-82: The new locale fields on the public Locale type should not
be made required because that breaks existing custom locale objects. Update the
Locale definition to make these added fields optional, then adjust TimeColumn to
use fallback values whenever a field is missing so existing consumers keep
compiling and behavior stays unchanged.
In `@src/locale/bg_BG.ts`:
- Around line 15-18: Update the Bulgarian locale entries in the locale object so
time unit labels are not fixed plural nouns, since TimeColumn builds aria labels
like “${value} ${locale.hours}” and will read singular values incorrectly.
Adjust the locale shape used by TimeColumn to provide value-aware formatters or
separate singular/plural fields for hours, minutes, seconds, and milliseconds,
then wire the TimePanel/TimeColumn consumers to use those symbols instead of
static strings.
In `@src/locale/lt_LT.ts`:
- Around line 15-18: `TimeColumn.tsx` currently builds aria-labels by
concatenating a numeric value with static unit strings from `lt_LT`, which
produces incorrect Lithuanian forms like `1 Valandos`. Update the
`TimeColumn`/locale contract so the label is generated from the full numeric
value, not a fixed unit token, and adjust `lt_LT` to provide a value-aware
formatter or singular/plural-aware unit labels for `hours`, `minutes`,
`seconds`, and `milliseconds`. Use the `TimeColumn` and `lt_LT` symbols to
locate the affected logic.
In `@src/locale/nb_NO.ts`:
- Around line 15-18: The fixed unit strings in the locale contract are causing
incorrect aria-labels when TimeColumn concatenates numeric values with
hours/minutes/seconds/milliseconds. Update the Locale API used by TimeColumn and
the locale files (including nb_NO) so unit labels are generated from the value
at runtime, rather than stored as a single static string; refactor the relevant
formatter/template shape in TimeColumn and its locale consumers to support
singular/plural or language-specific inflection.
In `@src/locale/pl_PL.ts`:
- Around line 15-18: The current locale contract cannot produce correct Polish
time labels because TimeColumn builds aria-labels by concatenating numbers with
the plural-only strings from pl_PL. Update the Locale contract and the
getListItemLabel() path used by TimeColumn so the label can be chosen based on
the numeric value and return the correct Polish word form instead of a single
static field. Keep the fix centered around the locale interface and the
TimeColumn/getListItemLabel integration, rather than adjusting only the pl_PL
text values.
In `@src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx`:
- Around line 51-63: The aria-label generation in TimeColumn’s getListItemLabel
is too naive: it concatenates raw values with locale unit names, which breaks
pluralization and can misread meridiem items. Update the TimeColumn item label
logic to use the locale’s formatter/template or existing localized unit label
instead of hardcoding `${value} ${locale.xxx}`; in particular, make the meridiem
branch reuse the already localized label passed from TimePanelBody rather than
returning the raw value.
---
Minor comments:
In `@src/locale/da_DK.ts`:
- Line 28: The meridiemSelect locale string in da_DK is still using an English
term, so update the locale entry in the da_DK translation object to a
Danish-native label or local AM/PM wording. Check the meridiemSelect field used
by TimeColumn for aria-label generation and replace it with the proper Danish
phrase so screen-reader text stays fully localized.
In `@src/locale/es_MX.ts`:
- Line 29: The es_MX locale entry for meridiemSelect still uses the
non-localized word “meridiem”; update the string in the locale object to a
proper Spanish equivalent such as “meridiano” or “AM/PM” so it matches the rest
of the translations. Keep the change confined to the meridiemSelect key in the
es_MX locale definition.
In `@src/locale/fi_FI.ts`:
- Line 19: The fi_FI locale entry in the time selection label has a spelling
mistake: update the `timeSelect` string in `fi_FI.ts` from the incorrect
“Valise” form to the consistent “Valitse” form used by the other selection
labels in the same locale file. Keep the change localized to the `timeSelect`
translation key and ensure it matches the surrounding Finnish wording style.
In `@src/locale/fr_BE.ts`:
- Line 20: The `dateSelect` translation in `fr_BE.ts` is a copy-paste mistake
and currently uses the same wording as `timeSelect`, so update the `dateSelect`
entry in the locale object to the correct French text for selecting a date, and
verify the nearby `timeSelect`/`dateSelect` labels remain distinct and
semantically accurate.
In `@src/locale/fr_CA.ts`:
- Around line 15-18: The locale strings in fr_CA.ts for TimeColumn are using
plural unit labels that get concatenated directly in TimeColumn.tsx as “${value}
${unit}”, which produces incorrect aria-labels for singular values. Update the
unit entries referenced by TimeColumn to neutral forms that work for both
singular and plural, or move singular/plural selection into TimeColumn so the
generated labels are correct for all values.
In `@src/locale/fr_FR.ts`:
- Around line 15-18: The localized unit labels in fr_FR.ts are using plural
forms that get concatenated by TimeColumn.tsx into aria-labels like “1 Heures”
and “1 Secondes”. Update the entries for hours, minutes, seconds, and
milliseconds to neutral singular-safe wording, or adjust TimeColumn so it
handles singular/plural forms instead of blindly using ${value} ${unit}. Use the
TimeColumn and locale keys to find the affected path.
In `@src/locale/ga_IE.ts`:
- Around line 15-18: The Gaelic unit labels in ga_IE are being used as fixed
suffixes in the aria-label generation, so plural forms like hours/minutes need
to be replaced with number-neutral terms or handled with proper inflection
logic. Update the locale entries in the ga_IE time labels so `${value} ${unit}`
stays natural for all values, or adjust TimeColumn to choose the correct form
based on the numeric value, using the existing locale keys for hours, minutes,
seconds, and milliseconds.
In `@src/locale/gl_ES.ts`:
- Around line 15-18: The locale labels in gl_ES.ts use plural unit names that
make TimeColumn.tsx build incorrect aria-labels like “1 Horas” and “1 Segundos”.
Update the unit strings in the locale mapping to values that work for any
numeric value, or adjust TimeColumn.tsx so it handles singular/plural formatting
instead of concatenating `${value} ${unit}` directly; use the TimeColumn and
locale keys for hours, minutes, seconds, and milliseconds to locate the change.
In `@src/locale/he_IL.ts`:
- Around line 15-18: The time unit labels in he_IL currently use plural forms,
which will produce incorrect aria-label text when combined with a value like 1
in downstream rendering. Update the locale entries for the affected unit symbols
in the locale file to use value-independent wording, or adjust the TimeColumn
formatting logic to handle singular/plural inflection before composing the
label.
In `@src/locale/hi_IN.ts`:
- Around line 15-18: The fixed unit strings in the hi_IN locale are not suitable
for every aria-label value because TimeColumn concatenates them directly as
"${value} ${unit}", which produces incorrect forms like singular-plural
mismatches. Update the hi_IN entries for hours, minutes, seconds, and
milliseconds to use value-agnostic unit wording, or adjust TimeColumn to choose
the correct singular/plural form before building the aria-label.
In `@src/locale/hr_HR.ts`:
- Around line 15-18: The unit labels in the hr_HR locale are being used as a
fixed suffix by TimeColumn.tsx via `${value} ${unit}`, so the current
plural/gendered forms like hours and minutes produce incorrect strings for some
values. Update the locale entries referenced by the TimeColumn component to
neutral forms that work for any numeric value, or adjust TimeColumn to choose
the correct inflected form based on the value; use the unit keys in hr_HR.ts and
the TimeColumn.tsx formatting path to locate the change.
In `@src/locale/it_IT.ts`:
- Line 28: The localized label for meridiemSelect in the Italian locale uses the
wrong meaning (“meridiano”) instead of the AM/PM time period selector. Update
the it_IT translation entry for meridiemSelect to a phrase that clearly refers
to AM/PM selection, and keep the change limited to the locale string so the UI
and screen reader announce the correct time-period choice.
In `@src/locale/nl_BE.ts`:
- Line 28: `meridiemSelect` in the nl_BE locale is still using the untranslated
term “meridiem”, which is surfaced directly by `TimeColumn.tsx` as the list
`aria-label`. Update the `meridiemSelect` string in the locale object to a Dutch
phrase that matches the locale’s common AM/PM or ochtend/middag wording so
screen readers don’t announce a foreign term.
In `@src/locale/nl_NL.ts`:
- Line 28: The meridiemSelect locale string in nl_NL is still using the
untranslated term “meridiem”, so update the nl_NL entry to a Dutch-friendly
AM/PM label or equivalent local wording. Change the value in the locale object
used by TimeColumn’s aria-label so the string is natural for Dutch users, while
keeping the meridiemSelect key unchanged.
In `@src/locale/pt_BR.ts`:
- Line 28: The pt_BR locale string for meridiemSelect is still using the
English/technical term “meridiem”; update the pt_BR translation in the locale
object so the time-column aria-label uses a natural Brazilian Portuguese AM/PM
equivalent or local phrasing. Locate the meridiemSelect entry in the pt_BR
translation file and replace it with a fully localized label consistent with the
rest of the locale.
In `@src/locale/pt_PT.ts`:
- Line 28: The `meridiemSelect` locale string in `pt_PT.ts` is still not
user-facing enough for the `TimeColumn` aria-label. Update the `meridiemSelect`
entry in the Portuguese locale to a real pt-PT accessible label using the
locale’s usual AM/PM wording or equivalent local expression, so
`src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx` reads a properly
localized value.
In `@src/locale/sk_SK.ts`:
- Around line 24-28: The `*Select` labels in the locale object are inconsistent
with the rest of the same file: `hourSelect`, `minuteSelect`, `secondSelect`,
`millisecondSelect`, and `meridiemSelect` use a different imperative form than
`timeSelect`, `dateSelect`, `monthSelect`, `yearSelect`, and `decadeSelect`.
Update the `sk_SK` locale entries in the translation map to use one consistent
wording style across all `*Select` strings so the aria-label text reads
uniformly.
In `@src/locale/sr_Cyrl_RS.ts`:
- Around line 24-28: The Serbian time selection labels in this locale file use a
different imperative form than the existing date/month/year/decade prompts,
causing inconsistent screen-reader phrasing. Update the related entries in the
locale object around the time selection strings so the wording matches the same
tone used by timeSelect, dateSelect, monthSelect, yearSelect, and decadeSelect,
keeping the names hourSelect, minuteSelect, secondSelect, millisecondSelect, and
meridiemSelect easy to find.
In `@src/locale/sr_RS.ts`:
- Around line 24-28: The Serbian locale selection labels are inconsistent: the
hour/minute/second/millisecond/meridiem entries in sr_RS.ts use “Izaberite ...”
while the rest of the locale uses “Izaberi ...”. Update those select prompt
strings in the locale object so they all follow the same phrasing style as the
other selection labels and remain consistent for aria-label usage.
In `@src/locale/tl_PH.ts`:
- Line 29: The locale string for meridiemSelect in tl_PH is still using an
English placeholder, so update the translation in the tl_PH locale object to a
proper Filipino meridiem label or the locally expected AM/PM wording. Use the
existing locale entry for meridiemSelect as the target symbol and ensure the
aria-label text in the time panel is fully localized.
In `@src/locale/uk_UA.ts`:
- Line 28: The `meridiemSelect` label in `uk_UA.ts` is too technical for the
aria-label used by `TimeColumn`; update the string to a more natural Ukrainian
phrase that users will recognize, such as a “time of day” or AM/PM-oriented
prompt. Keep the change localized to the `meridiemSelect` entry in the locale
object so the accessibility label reads clearly for screen readers.
In `@src/locale/uz_UZ.ts`:
- Line 29: The aria label for the meridiem selector still exposes the English
term “Meridiem,” so update the localized string in uz_UZ.ts for meridiemSelect
to use a natural Uzbek AM/PM or time-period phrase instead. Keep the change
within the locale entry itself so the time column’s aria-label reads fully
localized text when rendered.
In `@src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx`:
- Around line 136-143: The TimeColumn listbox is not keyboard-accessible because
the ul only exposes role/listbox semantics without a focus target or active
descendant control. Update TimeColumn in TimePanelBody to make the listbox
focusable with tabIndex or wire it to a proper aria-activedescendant pattern,
and ensure the selected/active option is tracked through the existing option
rendering and scroll handling so keyboard and screen reader focus can reach this
column.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: db3663c3-5e45-4a06-b38c-acea32031967
⛔ Files ignored due to path filters (1)
tests/__snapshots__/panel.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (77)
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsxsrc/PickerPanel/TimePanel/TimePanelBody/index.tsxsrc/interface.tsxsrc/locale/am_ET.tssrc/locale/ar_EG.tssrc/locale/az_AZ.tssrc/locale/bg_BG.tssrc/locale/bn_BD.tssrc/locale/by_BY.tssrc/locale/ca_ES.tssrc/locale/cs_CZ.tssrc/locale/da_DK.tssrc/locale/de_DE.tssrc/locale/el_GR.tssrc/locale/en_GB.tssrc/locale/en_US.tssrc/locale/es_ES.tssrc/locale/es_MX.tssrc/locale/et_EE.tssrc/locale/eu_ES.tssrc/locale/fa_IR.tssrc/locale/fi_FI.tssrc/locale/fr_BE.tssrc/locale/fr_CA.tssrc/locale/fr_FR.tssrc/locale/ga_IE.tssrc/locale/gl_ES.tssrc/locale/he_IL.tssrc/locale/hi_IN.tssrc/locale/hr_HR.tssrc/locale/hu_HU.tssrc/locale/id_ID.tssrc/locale/is_IS.tssrc/locale/it_IT.tssrc/locale/ja_JP.tssrc/locale/ka_GE.tssrc/locale/kk_KZ.tssrc/locale/km_KH.tssrc/locale/kmr_IQ.tssrc/locale/kn_IN.tssrc/locale/ko_KR.tssrc/locale/lt_LT.tssrc/locale/lv_LV.tssrc/locale/mk_MK.tssrc/locale/ml_IN.tssrc/locale/mn_MN.tssrc/locale/mr_IN.tssrc/locale/ms_MY.tssrc/locale/my_MM.tssrc/locale/nb_NO.tssrc/locale/ne_NP.tssrc/locale/nl_BE.tssrc/locale/nl_NL.tssrc/locale/pl_PL.tssrc/locale/pt_BR.tssrc/locale/pt_PT.tssrc/locale/ro_RO.tssrc/locale/ru_RU.tssrc/locale/si_LK.tssrc/locale/sk_SK.tssrc/locale/sl_SI.tssrc/locale/sr_Cyrl_RS.tssrc/locale/sr_RS.tssrc/locale/sv_SE.tssrc/locale/ta_IN.tssrc/locale/te_IN.tssrc/locale/th_TH.tssrc/locale/tk_TK.tssrc/locale/tl_PH.tssrc/locale/tr_TR.tssrc/locale/ug_CN.tssrc/locale/uk_UA.tssrc/locale/ur_PK.tssrc/locale/uz_UZ.tssrc/locale/vi_VN.tssrc/locale/zh_CN.tssrc/locale/zh_TW.ts
| hours: string; | ||
| minutes: string; | ||
| seconds: string; | ||
| milliseconds: string; | ||
| previousMonth: string; | ||
| nextMonth: string; | ||
| monthSelect: string; | ||
| yearSelect: string; | ||
| decadeSelect: string; | ||
| hourSelect: string; | ||
| minuteSelect: string; | ||
| secondSelect: string; | ||
| millisecondSelect: string; | ||
| meridiemSelect: string; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
不要把新增 locale 字段设为必填。
Locale 是导出的公共类型。把这 9 个字段直接改成必填会让现有自定义 locale 对象在升级后全部类型报错,属于破坏性 API 变更。更稳妥的是先改成可选,并在 TimeColumn 里为缺省值提供 fallback。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/interface.tsx` around lines 69 - 82, The new locale fields on the public
Locale type should not be made required because that breaks existing custom
locale objects. Update the Locale definition to make these added fields
optional, then adjust TimeColumn to use fallback values whenever a field is
missing so existing consumers keep compiling and behavior stays unchanged.
| hours: 'Часове', | ||
| minutes: 'Минути', | ||
| seconds: 'Секунди', | ||
| milliseconds: 'Милисекунди', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
不要把时间项读法压缩成单个静态名词。
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx:34-65 会直接拼出 ${value} ${locale.hours} 这样的 aria-label。这里使用固定复数后,单数项会被读成 1 Часове、1 Секунди 这类错误词形,读屏文案会稳定出错。建议把这些字段改成按值生成的 formatter,或至少拆成 singular/plural 两套字段。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locale/bg_BG.ts` around lines 15 - 18, Update the Bulgarian locale
entries in the locale object so time unit labels are not fixed plural nouns,
since TimeColumn builds aria labels like “${value} ${locale.hours}” and will
read singular values incorrectly. Adjust the locale shape used by TimeColumn to
provide value-aware formatters or separate singular/plural fields for hours,
minutes, seconds, and milliseconds, then wire the TimePanel/TimeColumn consumers
to use those symbols instead of static strings.
| hours: 'Valandos', | ||
| minutes: 'Minutės', | ||
| seconds: 'Sekundės', | ||
| milliseconds: 'Milisekundės', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
单个静态单位词不足以生成正确的立陶宛语 aria-label。
TimeColumn.tsx 会直接拼接 ${value} ${locale.hours}。这里的 Valandos/Minutės/Sekundės/Milisekundės 是固定形式,结果会读出 1 Valandos、1 Minutės 这类不自然的标签。这个 PR 的无障碍改动在 lt_LT 下会因此退化,建议把 Locale/TimeColumn 合约改成可按数值生成标签,而不是只提供一个静态单位字符串。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locale/lt_LT.ts` around lines 15 - 18, `TimeColumn.tsx` currently builds
aria-labels by concatenating a numeric value with static unit strings from
`lt_LT`, which produces incorrect Lithuanian forms like `1 Valandos`. Update the
`TimeColumn`/locale contract so the label is generated from the full numeric
value, not a fixed unit token, and adjust `lt_LT` to provide a value-aware
formatter or singular/plural-aware unit labels for `hours`, `minutes`,
`seconds`, and `milliseconds`. Use the `TimeColumn` and `lt_LT` symbols to
locate the affected logic.
| hours: 'Timer', | ||
| minutes: 'Minutter', | ||
| seconds: 'Sekunder', | ||
| milliseconds: 'Millisekunder', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
这些单位名会生成错误的 option aria-label。
TimeColumn 现在会把数值直接拼到这些文案后面(见 src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx:34-66),所以这里会读成 1 Timer、1 Minutter、1 Sekunder。这不是仅靠翻译能修好的问题:Locale 合约目前只给了每个单位一个固定字符串,无法按数值做单复数/词形变化。建议把上游 contract 改成“按 value 生成单位文案”的格式化接口或模板,再统一回填各语言包。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locale/nb_NO.ts` around lines 15 - 18, The fixed unit strings in the
locale contract are causing incorrect aria-labels when TimeColumn concatenates
numeric values with hours/minutes/seconds/milliseconds. Update the Locale API
used by TimeColumn and the locale files (including nb_NO) so unit labels are
generated from the value at runtime, rather than stored as a single static
string; refactor the relevant formatter/template shape in TimeColumn and its
locale consumers to support singular/plural or language-specific inflection.
| hours: 'Godziny', | ||
| minutes: 'Minuty', | ||
| seconds: 'Sekundy', | ||
| milliseconds: 'Milisekundy', |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
当前 contract 无法生成正确的波兰语时间读法。
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx:34-66 会把数值直接与这些字段拼成 aria-label。以这里的值为例,实际会读出 1 Godziny、1 Minuty 这类错误词形。这个问题已经超出 locale 文案本身了:需要把 Locale/getListItemLabel() 改成能按数值选择词形的 contract,而不是继续依赖单个复数字段。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locale/pl_PL.ts` around lines 15 - 18, The current locale contract cannot
produce correct Polish time labels because TimeColumn builds aria-labels by
concatenating numbers with the plural-only strings from pl_PL. Update the Locale
contract and the getListItemLabel() path used by TimeColumn so the label can be
chosen based on the numeric value and return the correct Polish word form
instead of a single static field. Keep the fix centered around the locale
interface and the TimeColumn/getListItemLabel integration, rather than adjusting
only the pl_PL text values.
| function getListItemLabel(type: TimeUnitType, value: string | number, locale: Locale) { | ||
| switch (type) { | ||
| case 'hour': | ||
| return `${value} ${locale.hours}`; | ||
| case 'minute': | ||
| return `${value} ${locale.minutes}`; | ||
| case 'second': | ||
| return `${value} ${locale.seconds}`; | ||
| case 'millisecond': | ||
| return `${value} ${locale.milliseconds}`; | ||
| case 'meridiem': | ||
| return value.toString(); | ||
| default: |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
当前 item aria-label 的生成方式会把时间项读错。
这里把数值统一拼成 ${value} ${locale.xxx},en_US 下会读出 1 Hours,很多语言也需要更复杂的复数规则;meridiem 分支还直接返回 am/pm,会覆盖 TimePanelBody 里已经本地化的 label。建议把 item label 改成 locale formatter/模板,至少让 meridiem 复用当前 unit.label。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx` around lines 51 - 63,
The aria-label generation in TimeColumn’s getListItemLabel is too naive: it
concatenates raw values with locale unit names, which breaks pluralization and
can misread meridiem items. Update the TimeColumn item label logic to use the
locale’s formatter/template or existing localized unit label instead of
hardcoding `${value} ${locale.xxx}`; in particular, make the meridiem branch
reuse the already localized label passed from TimePanelBody rather than
returning the raw value.
Summary
This PR is a small chunk of a big one #972 focusing on providing correct semantics and making elements keyboard accessible for Time panels.
Summary by CodeRabbit
新功能
Bug 修复