Skip to content

fix: notification preference options are not visible#7162

Merged
Rohit3523 merged 6 commits into
developfrom
notification-toggle-fix
Apr 22, 2026
Merged

fix: notification preference options are not visible#7162
Rohit3523 merged 6 commits into
developfrom
notification-toggle-fix

Conversation

@Rohit3523

@Rohit3523 Rohit3523 commented Apr 15, 2026

Copy link
Copy Markdown
Member

Proposed changes

If we go to the notification preference settings under the profile and click on any alert option, it shows a bottom sheet with empty content.

Regression introduced in #6970

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-2120

How to test or reproduce

  1. Go to the Profile.
  2. Click on the Preferences icon (located at the top right).
  3. Click on Alerts.
  4. You will see a bottom sheet with items.

Screenshots

Before After
Screenshot 2026-04-16 at 2 32 01 AM Screenshot 2026-04-16 at 2 31 45 AM

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

  • Tests

    • Expanded notification preferences test coverage with comprehensive flows for in-app notifications, push notifications, and email preferences.
  • Refactor

    • Enhanced component flexibility with improved styling capabilities.
  • Style

    • Improved visual layout consistency for notification preference option items.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

These changes address notification preference visibility issues by adding optional style props to list components and applying fixed-height styling in the ListPicker component. Test coverage is expanded to verify notification preferences across in-app, push, and email channels with their respective options.

Changes

Cohort / File(s) Summary
List Component Style Props
app/containers/List/ListItem.tsx, app/containers/List/ListRadio.tsx
Added optional style?: ViewStyle prop to IListItem and IListRadio interfaces. ListItem merges the passed style with existing background-color styling.
Notification Preferences Styling
app/views/UserNotificationPreferencesView/ListPicker.tsx
Applied fixed-height style (48px) to List.Radio options and added dynamic testID attributes formatted as notification-preferences-${preference}-${i.value} for option identification.
Notification Preferences Test Coverage
.maestro/tests/assorted/user-preferences.yaml
Removed duplicate visibility check and added comprehensive test flow validating in-app, push, and email notification preference alerts, options, troubleshooting sections, and navigation workflows.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: notification preference options are not visible' directly matches the main objective of making notification preference options visible in the bottom sheet.
Linked Issues check ✅ Passed The PR addresses the core objective of CORE-2120 by adding styles and test IDs to List.Radio components, implementing proper visibility and testability for notification preference options in the bottom sheet.
Out of Scope Changes check ✅ Passed All changes are scoped to notification preference visibility: ListItem/ListRadio prop additions enable styling, ListPicker applies fixed height styling to options, and test case additions ensure proper functionality validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Rohit3523 Rohit3523 had a problem deploying to official_android_build April 15, 2026 21:06 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build April 15, 2026 21:06 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build April 15, 2026 21:06 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build April 15, 2026 21:35 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build April 15, 2026 21:35 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build April 15, 2026 21:35 — with GitHub Actions Error

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/containers/List/ListItem.tsx (1)

259-271: ⚠️ Potential issue | 🟡 Minor

Apply style in the non-press branch too.

IListItem exposes style, but when onPress is absent (Line 269), the style is dropped. That makes behavior inconsistent across the two render paths.

🐛 Proposed fix
 	return (
-		<View style={{ backgroundColor: props.backgroundColor || colors.surfaceRoom }}>
+		<View style={[{ backgroundColor: props.backgroundColor || colors.surfaceRoom }, props.style]}>
 			<Content {...props} />
 		</View>
 	);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/containers/List/ListItem.tsx` around lines 259 - 271, The non-press
render path in ListItem drops the passed-in style from IListItem; when
props.onPress is falsy the returned View uses only backgroundColor and ignores
props.style, causing inconsistent styling compared to the Button branch. Fix by
merging/applying props.style on the non-press View (e.g., combine props.style
with the backgroundColor-derived style) so Content receives the same visual
styling as the Button path; update ListItem to use props.style alongside
backgroundColor (symbols to edit: ListItem, IListItem props.style,
backgroundColor, colors.surfaceRoom, Button, Content).
🧹 Nitpick comments (2)
app/containers/List/ListRadio.tsx (1)

2-2: Remove duplicated style declaration from IListRadio.

IListRadio already inherits style from IListItem, so redeclaring it adds drift risk for no gain.

♻️ Proposed cleanup
-import type { ViewStyle } from 'react-native';
@@
 interface IListRadio extends IListItem {
 	value: any;
 	isSelected: boolean;
-	style?: ViewStyle;
 }

Also applies to: 9-13

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/containers/List/ListRadio.tsx` at line 2, IListRadio declares a duplicate
style prop that it already inherits from IListItem; remove the redundant "style"
declaration from the IListRadio interface in ListRadio.tsx (and any duplicated
declarations around lines 9–13) so the interface relies on the inherited style
from IListItem, keeping the rest of IListRadio unchanged.
app/containers/List/ListItem.tsx (1)

216-219: Use StyleProp<ViewStyle> for list style props.

Line 218 and Line 256 currently type style as ViewStyle, which is narrower than RN style prop usage and can block array/registered styles.

♻️ Proposed typing update
 import {
 	I18nManager,
 	type StyleProp,
@@
 interface IListButtonPress extends IListItemButton {
 	onPress: Function;
-	style?: ViewStyle;
+	style?: StyleProp<ViewStyle>;
 }
@@
 export interface IListItem extends Omit<IListItemContent, 'theme'>, Omit<IListItemButton, 'theme'> {
 	backgroundColor?: string;
 	onPress?: Function;
-	style?: ViewStyle;
+	style?: StyleProp<ViewStyle>;
 }

Also applies to: 253-257

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/containers/List/ListItem.tsx` around lines 216 - 219, The style prop
types are too narrow: change the type of style on IListButtonPress and on the
other list item interface that currently declares style (IListItemButton) from
ViewStyle to StyleProp<ViewStyle>, and add/import StyleProp (and ViewStyle if
not already) from 'react-native' so array/registered styles are accepted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.maestro/tests/assorted/user-preferences.yaml:
- Around line 59-60: Replace the flaky text-based assertion with a stable testID
check: instead of "assertVisible: Vibrate for new messages" use the element id
user-notification-preference-view-in-app-vibration (or the test selector that
maps to it) to assert presence/visibility; update the test step that references
the visible string to use the testID selector for the element
(user-notification-preference-view-in-app-vibration) so the E2E check targets
the stable identifier rather than localized text.

In `@app/views/UserNotificationPreferencesView/ListPicker.tsx`:
- Line 59: The testID currently uses the option label which is fragile: replace
the test selector template `notification-preferences-${preference}-${i.label}`
with `notification-preferences-${preference}-${i.value}` so testIDs are tied to
stable option values rather than translatable/mutable labels; update the JSX
prop where testID is set (the template string in ListPicker's option rendering)
to use i.value.

---

Outside diff comments:
In `@app/containers/List/ListItem.tsx`:
- Around line 259-271: The non-press render path in ListItem drops the passed-in
style from IListItem; when props.onPress is falsy the returned View uses only
backgroundColor and ignores props.style, causing inconsistent styling compared
to the Button branch. Fix by merging/applying props.style on the non-press View
(e.g., combine props.style with the backgroundColor-derived style) so Content
receives the same visual styling as the Button path; update ListItem to use
props.style alongside backgroundColor (symbols to edit: ListItem, IListItem
props.style, backgroundColor, colors.surfaceRoom, Button, Content).

---

Nitpick comments:
In `@app/containers/List/ListItem.tsx`:
- Around line 216-219: The style prop types are too narrow: change the type of
style on IListButtonPress and on the other list item interface that currently
declares style (IListItemButton) from ViewStyle to StyleProp<ViewStyle>, and
add/import StyleProp (and ViewStyle if not already) from 'react-native' so
array/registered styles are accepted.

In `@app/containers/List/ListRadio.tsx`:
- Line 2: IListRadio declares a duplicate style prop that it already inherits
from IListItem; remove the redundant "style" declaration from the IListRadio
interface in ListRadio.tsx (and any duplicated declarations around lines 9–13)
so the interface relies on the inherited style from IListItem, keeping the rest
of IListRadio unchanged.
🪄 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: 1b55d390-36da-4d8a-90fc-ece33fc0fabf

📥 Commits

Reviewing files that changed from the base of the PR and between 9d43512 and 96d7723.

📒 Files selected for processing (4)
  • .maestro/tests/assorted/user-preferences.yaml
  • app/containers/List/ListItem.tsx
  • app/containers/List/ListRadio.tsx
  • app/views/UserNotificationPreferencesView/ListPicker.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line

Files:

  • app/containers/List/ListRadio.tsx
  • app/views/UserNotificationPreferencesView/ListPicker.tsx
  • app/containers/List/ListItem.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use ESLint with @rocket.chat/eslint-config base configuration including React, React Native, TypeScript, and Jest plugins

Files:

  • app/containers/List/ListRadio.tsx
  • app/views/UserNotificationPreferencesView/ListPicker.tsx
  • app/containers/List/ListItem.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use TypeScript with strict mode enabled and configure baseUrl to app/ for import resolution

**/*.{ts,tsx}: Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Prefer interfaces over type aliases for defining object shapes in TypeScript
Use enums for sets of related constants rather than magic strings or numbers

Files:

  • app/containers/List/ListRadio.tsx
  • app/views/UserNotificationPreferencesView/ListPicker.tsx
  • app/containers/List/ListItem.tsx
app/containers/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Place reusable UI components in app/containers/ directory

Files:

  • app/containers/List/ListRadio.tsx
  • app/containers/List/ListItem.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions

Files:

  • app/containers/List/ListRadio.tsx
  • app/views/UserNotificationPreferencesView/ListPicker.tsx
  • app/containers/List/ListItem.tsx
app/views/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Place screen components in app/views/ directory

Files:

  • app/views/UserNotificationPreferencesView/ListPicker.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: OtavioStasiak
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6499
File: app/containers/ServerItem/index.tsx:34-36
Timestamp: 2025-12-17T15:56:22.578Z
Learning: In the Rocket.Chat React Native codebase, for radio button components on iOS, include the selection state ("Selected"/"Unselected") in the accessibilityLabel instead of using accessibilityState={{ checked: hasCheck }}, because iOS VoiceOver has known issues with accessibilityRole="radio" + accessibilityState that prevent correct state announcement.
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7046
File: app/containers/InAppNotification/NotifierComponent.stories.tsx:46-75
Timestamp: 2026-03-10T15:21:45.098Z
Learning: In `app/containers/InAppNotification/NotifierComponent.tsx` (React Native, Rocket.Chat), `NotifierComponent` is exported as a Redux-connected component via `connect(mapStateToProps)`. The `isMasterDetail` prop is automatically injected from `state.app.isMasterDetail` and does not need to be passed explicitly at call sites or in Storybook stories that use the default (connected) export.
📚 Learning: 2026-03-05T14:28:10.004Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6997
File: .maestro/tests/room/message-markdown-click.yaml:28-39
Timestamp: 2026-03-05T14:28:10.004Z
Learning: In Maestro YAML selector fields (text, id) within the Rocket.Chat React Native repository, use the contains pattern '.*keyword.*' (leading and trailing '.*') for matching text. The pattern '.*keyword*.' is incorrect and will fail to match cases where the keyword appears at the end of the element's text. This guideline applies to all Maestro YAML selector fields across the codebase.

Applied to files:

  • .maestro/tests/assorted/user-preferences.yaml

Comment thread .maestro/tests/assorted/user-preferences.yaml Outdated
Comment thread app/views/UserNotificationPreferencesView/ListPicker.tsx Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build April 15, 2026 22:57 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build April 15, 2026 22:57 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build April 15, 2026 22:57 — with GitHub Actions Error
@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing April 16, 2026 19:05 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 marked this pull request as ready for review April 16, 2026 19:08
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build April 16, 2026 19:09 — with GitHub Actions Failure
@Rohit3523 Rohit3523 had a problem deploying to official_android_build April 16, 2026 19:09 — with GitHub Actions Failure
@Rohit3523 Rohit3523 had a problem deploying to official_ios_build April 16, 2026 19:09 — with GitHub Actions Failure
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build April 16, 2026 19:09 — with GitHub Actions Failure

@OtavioStasiak OtavioStasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Rohit3523 Rohit3523 merged commit 507fe3a into develop Apr 22, 2026
31 of 39 checks passed
@Rohit3523 Rohit3523 deleted the notification-toggle-fix branch April 22, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants