Skip to content

feat(a11y): toasts to native dialogs#6514

Merged
OtavioStasiak merged 29 commits intodevelopfrom
feat-a11y-toasts-to-native-dialogs
Sep 25, 2025
Merged

feat(a11y): toasts to native dialogs#6514
OtavioStasiak merged 29 commits intodevelopfrom
feat-a11y-toasts-to-native-dialogs

Conversation

@OtavioStasiak
Copy link
Contributor

@OtavioStasiak OtavioStasiak commented Jul 30, 2025

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

  • Open the app;
  • Go to AccessibilityAndAppearanceView and change the toast to dialogs;
  • Go to statusView;
  • Change your status;
  • Click on save;

Screenshots

Simulator Screenshot - iPhone 16 - 2025-09-19 at 17 16 35 Simulator Screenshot - iPhone 16 - 2025-09-19 at 17 16 40 Simulator Screenshot - iPhone 16 - 2025-09-19 at 17 16 48

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • New setting to show alerts as auto-dismissing toasts or manual dialogs, with an in-app picker and persisted preference; toast/dialog display follows this preference.
  • Accessibility

    • Action sheet items gain improved accessibility labels and optional subtitles; title sizing and spacing refined.
  • Localization

    • Added translations for the new accessibility/appearance options across many locales.
  • Tests

    • New end-to-end tests covering toast vs dialog flows, status edits, login and cleanup.

@OtavioStasiak OtavioStasiak had a problem deploying to official_android_build July 30, 2025 13:31 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_ios_build July 30, 2025 13:31 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_android_build July 30, 2025 13:31 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak had a problem deploying to upload_experimental_android July 30, 2025 14:01 — with GitHub Actions Error
@github-actions
Copy link

Android Build Available

Rocket.Chat Experimental 4.63.0.93296

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTiOnozLfxMgmPjgnj1O7jL-2xTyDZifnMXwfutasqqXzkyMmeenSE_1ChoTYwCART5oBeP-nHwOUPwlEgl

@github-actions
Copy link

iOS Build Available

Rocket.Chat Experimental 4.63.0.96969

@OtavioStasiak OtavioStasiak temporarily deployed to experimental_android_build August 1, 2025 18:05 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak temporarily deployed to experimental_ios_build August 1, 2025 18:05 — with GitHub Actions Inactive
@OtavioStasiak OtavioStasiak had a problem deploying to upload_experimental_android August 1, 2025 18:24 — with GitHub Actions Error
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

Android Build Available

Rocket.Chat Experimental 4.64.0.93301

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNRbb-ieTauA4kSJRQp1PFv85dnHiJurE1A6cIiWM49BsPjK3UAge3O35UKAJ64-zIzTsgxNj0HoTw37Ysr-

@OtavioStasiak OtavioStasiak temporarily deployed to experimental_ios_build August 1, 2025 18:58 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

iOS Build Available

Rocket.Chat Experimental 4.64.0.98157

@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build September 2, 2025 21:21 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build September 3, 2025 17:01 — with GitHub Actions Error
@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build September 11, 2025 15:56 — with GitHub Actions Error
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between eb9d3cf and 71c7195.

📒 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx (3)

71-82: Tighten a11y label construction and remove unnecessary optional chaining

Avoid 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 assertions

String 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 71c7195 and a368220.

📒 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 changes

If 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 prop additionalAcessibilityLabel (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.

@OtavioStasiak OtavioStasiak had a problem deploying to experimental_android_build September 25, 2025 20:12 — with GitHub Actions Failure
@OtavioStasiak OtavioStasiak merged commit 605cc45 into develop Sep 25, 2025
6 of 16 checks passed
@OtavioStasiak OtavioStasiak deleted the feat-a11y-toasts-to-native-dialogs branch September 25, 2025 20:30
OtavioStasiak added a commit that referenced this pull request Oct 21, 2025
* 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>
@coderabbitai coderabbitai bot mentioned this pull request Nov 6, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants