Conversation
This comment has been minimized.
This comment has been minimized.
|
Warning Review limit reached
Next review available in: 29 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ 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 |
| <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)}> |
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Description
This PR addresses issues with call notes modal keyboard handling and notification inbox performance:
Call Notes & Images Modal Keyboard Fix: Wrapped the modal content in
KeyboardProviderfromreact-native-keyboard-controllerin both the call notes modal and call images modal. This fixes theKeyboardStickyViewcomponent which requires aKeyboardProviderancestor to function properly for keyboard-aware input behavior.Notification Detail Refetch Loop Fix: Fixed an issue where marking a notification as read could trigger an infinite refetch loop due to an unstable
refetchreference. 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.Notification Inbox Performance Optimization: Extracted the notification list item into a dedicated
NotificationRowcomponent wrapped withReact.memoto prevent unnecessary re-renders across the list. Converted event handlers (onPress,onLongPress,renderItem,renderFooter, etc.) to stableuseCallbackreferences and memoized date formatting, improving scrolling performance for the notification list.Test Updates: Updated the call notes modal test to mock the newly added
KeyboardProvidercomponent and applied code formatting improvements.