feat(a11y): toasts to native dialogs#6514
Conversation
|
Android Build Available Rocket.Chat Experimental 4.63.0.93296 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTiOnozLfxMgmPjgnj1O7jL-2xTyDZifnMXwfutasqqXzkyMmeenSE_1ChoTYwCART5oBeP-nHwOUPwlEgl |
|
iOS Build Available Rocket.Chat Experimental 4.63.0.96969 |
|
Android Build Available Rocket.Chat Experimental 4.64.0.93301 Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNRbb-ieTauA4kSJRQp1PFv85dnHiJurE1A6cIiWM49BsPjK3UAge3O35UKAJ64-zIzTsgxNj0HoTw37Ysr- |
|
iOS Build Available Rocket.Chat Experimental 4.64.0.98157 |
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/i18n/locales/cs.json (1)
7-11: Polish the Czech wording.The sentences currently mix styles (“Vyžaduje ….” with trailing period, “Toast upozornění”). Please align with common UI phrasing:
- "A11y_appearance_dialog_require_manual_dismissal": "Vyžaduje ruční zavření.", + "A11y_appearance_dialog_require_manual_dismissal": "Vyžaduje ruční zavření", ... - "A11y_appearance_toasts": "Toast upozornění", + "A11y_appearance_toasts": "Toastová upozornění",That keeps the strings stylistically consistent with surrounding keys and sounds natural.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (9)
app/i18n/locales/ar.json(1 hunks)app/i18n/locales/cs.json(1 hunks)app/i18n/locales/de.json(1 hunks)app/i18n/locales/hu.json(1 hunks)app/i18n/locales/sl-SI.json(1 hunks)app/i18n/locales/sv.json(1 hunks)app/i18n/locales/te-IN.json(1 hunks)app/i18n/locales/tr.json(1 hunks)app/i18n/locales/zh-TW.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- app/i18n/locales/sv.json
- app/i18n/locales/ar.json
- app/i18n/locales/zh-TW.json
- app/i18n/locales/hu.json
🔇 Additional comments (2)
app/i18n/locales/te-IN.json (1)
7-11: Nice cleanup on the Telugu strings.The new labels are now fully in Telugu, and “టోస్ట్ నోటిఫికేషన్లు” reads clearly in the UI.
app/i18n/locales/tr.json (1)
3-7: Turkish phrasing looks good.“Toast bildirimleri” and the rest of the copy now read naturally for native speakers.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx (3)
71-82: Tighten a11y label construction and remove unnecessary optional chainingAvoid producing a stray period when description is empty and drop optional chaining on non-null variables.
-const getOptions = (): TActionSheetOptionsItem[] => - OPTIONS.map(i => ({ +const getOptions = (): TActionSheetOptionsItem[] => + OPTIONS.map(i => ({ title: i.label, - subtitle: i?.description || undefined, - accessibilityLabel: `${i.label}. ${i?.description || ''}. ${ - option?.value === i.value ? I18n.t('Checked') : I18n.t('Unchecked') - }`, + subtitle: i.description || undefined, + accessibilityLabel: `${i.label}${i.description ? `. ${i.description}` : ''}. ${option.value === i.value ? I18n.t('Checked') : I18n.t('Unchecked')}`, onPress: () => { hideActionSheet(); onChangeValue(i.value); }, - right: option?.value === i.value ? () => <CustomIcon name={'check'} size={20} color={colors.strokeHighlight} /> : undefined + right: option.value === i.value ? () => <CustomIcon name="check" size={20} color={colors.strokeHighlight} /> : undefined }));
71-82: Add testIDs to ActionSheet items for E2E reliability (Maestro)Helps target options deterministically in tests.
OPTIONS.map(i => ({ title: i.label, + testID: `listpicker-option-${i.value.toLowerCase()}`,
58-65: Drop unnecessary type assertionsString literals already satisfy the union; the casts add noise without benefit.
- value: 'TOAST' as TAlertDisplayType, + value: 'TOAST', ... - value: 'DIALOG' as TAlertDisplayType, + value: 'DIALOG',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx (3)
app/views/AccessibilityAndAppearanceView/index.tsx (1)
TAlertDisplayType(21-21)app/containers/ActionSheet/Provider.tsx (2)
useActionSheet(41-41)TActionSheetOptionsItem(7-17)app/theme.tsx (1)
useTheme(29-29)
🔇 Additional comments (2)
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx (2)
55-66: Ensure i18n-driven text updates when locale changesIf locale changes outside React’s lifecycle, these labels may not re-render (previously raised in review). Verify this component re-renders on locale change; if not, subscribe to i18n change events or use a translation hook/context that triggers updates.
If needed, I can propose a small hook to subscribe to your i18n’s “locale changed” event and force a re-render.
Also applies to: 68-68, 90-101
103-104: Ignore incorrect prop rename suggestion
The propadditionalAcessibilityLabel(single-c) is defined and consumed in app/containers/List/ListItem.tsx, so renaming it here would break its implementation. Leave it as is.Likely an incorrect or invalid review comment.
* feat: new i18n translation * feat: add listPicker * feat: layout and code improvements * fix: copy and a11y label read * feat: added hint to Toasts option * feat: e2e tests * fix: jest mock and imports * fix: jest * fix: code improvements * fix: zh-CN translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: te-IN translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: no translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: nl translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: hu translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: fi translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: es translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: tr translation * chore: code improvements * chore: code improvements * fix: remove extra pause if there is no subtitle * fix: i18n ListPicker * fix: i18n translation * fix: it translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update app/i18n/locales/sv.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: translation * fix: remove unused useMemo --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Proposed changes
Introduces a picker to select how alerts are displayed (Toasts or Native dialogs).
Issue(s)
https://rocketchat.atlassian.net/browse/MA-105
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
New Features
Accessibility
Localization
Tests