Skip to content

RIC-T40 Call notes and Inbox fix - #24

Merged
ucswift merged 2 commits into
masterfrom
develop
Jul 26, 2026
Merged

RIC-T40 Call notes and Inbox fix#24
ucswift merged 2 commits into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Jul 26, 2026

Copy link
Copy Markdown
Member

Description

This PR addresses issues with call notes modal keyboard handling and notification inbox performance:

  1. Call Notes & Images Modal Keyboard Fix: Wrapped the modal content in KeyboardProvider from react-native-keyboard-controller in both the call notes modal and call images modal. This fixes the KeyboardStickyView component which requires a KeyboardProvider ancestor to function properly for keyboard-aware input behavior.

  2. Notification Detail Refetch Loop Fix: Fixed an issue where marking a notification as read could trigger an infinite refetch loop due to an unstable refetch reference. Added a ref-based guard to ensure refetch only happens once per notification, and separated the animation logic into its own effect so it doesn't re-run unnecessarily.

  3. Notification Inbox Performance Optimization: Extracted the notification list item into a dedicated NotificationRow component wrapped with React.memo to prevent unnecessary re-renders across the list. Converted event handlers (onPress, onLongPress, renderItem, renderFooter, etc.) to stable useCallback references and memoized date formatting, improving scrolling performance for the notification list.

  4. Test Updates: Updated the call notes modal test to mock the newly added KeyboardProvider component and applied code formatting improvements.

@Resgrid-Bot

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ucswift, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb65cd62-bf06-4e1c-a90f-14a552095300

📥 Commits

Reviewing files that changed from the base of the PR and between d613aa5 and a82e9a2.

📒 Files selected for processing (5)
  • src/components/calls/__tests__/call-notes-modal-new.test.tsx
  • src/components/calls/call-images-modal.tsx
  • src/components/calls/call-notes-modal.tsx
  • src/components/notifications/NotificationDetail.tsx
  • src/components/notifications/NotificationInbox.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

<Heading size="lg">{isAddingImage ? t('callImages.add_new') : t('callImages.title')}</Heading>
<HStack className="items-center space-x-2">
{!isAddingImage && !isLoadingImages ? (
<Button size="sm" variant="outline" onPress={() => setIsAddingImage(true)}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Performance regression: inline arrow functions in JSX props create new function instances on every render. Extract the handler into a stable definition outside the render path.

Kody rule violation: Avoid using .bind() or arrow functions in JSX props

Prompt for LLM

File src/components/calls/call-images-modal.tsx:

Line 420:

Performance regression: inline arrow functions in JSX props create new function instances on every render. Extract the handler into a stable definition outside the render path.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

[item]
);

const formattedDate = React.useMemo(() => new Date(notification.createdAt).toLocaleDateString(), [notification.createdAt]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Invalid Date propagation: notification.createdAt is derived from item.createdAt where item is typed any, allowing undefined values to reach new Date() and yield the string "Invalid Date" from .toLocaleDateString(). Guard the value before use or validate during notification construction.

Kody rule violation: Add null checks to prevent NullReferenceException

Prompt for LLM

File src/components/notifications/NotificationInbox.tsx:

Line 53:

Invalid Date propagation: `notification.createdAt` is derived from `item.createdAt` where `item` is typed `any`, allowing undefined values to reach `new Date()` and yield the string "Invalid Date" from `.toLocaleDateString()`. Guard the value before use or validate during notification construction.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.


const handlePress = React.useCallback(() => onPress(notification), [onPress, notification]);
const handleLongPress = React.useCallback(() => onLongPress(notification.id), [onLongPress, notification.id]);
const handleNavigate = React.useCallback(() => onNavigateToReference(notification.referenceType!, notification.referenceId!), [onNavigateToReference, notification.referenceType, notification.referenceId]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules high

Null reference risk: non-null assertions notification.referenceType! and notification.referenceId! bypass safety for fields sourced via optional chaining from item.payload?.referenceType / item.payload?.referenceId. Guard inside the callback before calling onNavigateToReference rather than asserting with !.

Kody rule violation: Add null checks before accessing properties

Prompt for LLM

File src/components/notifications/NotificationInbox.tsx:

Line 58:

Null reference risk: non-null assertions `notification.referenceType!` and `notification.referenceId!` bypass safety for fields sourced via optional chaining from `item.payload?.referenceType` / `item.payload?.referenceId`. Guard inside the callback before calling `onNavigateToReference` rather than asserting with `!`.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

const renderEmpty = React.useCallback(
() => (
<View style={styles.emptyContainer}>
<Text>No updates available</Text>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Kody Rules low

Untranslatable string: the hardcoded text "No updates available" prevents localization and violates i18n best practices. Replace it with a next-intl or next-i18next dictionary lookup using useTranslations('notifications').

Kody rule violation: Internationalize user-facing text with next-intl or next-i18next

Prompt for LLM

File src/components/notifications/NotificationInbox.tsx:

Line 272:

Untranslatable string: the hardcoded text "No updates available" prevents localization and violates i18n best practices. Replace it with a `next-intl` or `next-i18next` dictionary lookup using `useTranslations('notifications')`.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

@Resgrid-Bot

Resgrid-Bot commented Jul 26, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@ucswift
ucswift merged commit c2590d7 into master Jul 26, 2026
9 checks passed
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