Skip to content

Develop#121

Merged
ucswift merged 3 commits into
masterfrom
develop
Jul 18, 2026
Merged

Develop#121
ucswift merged 3 commits into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added support for weather alert notifications, including localized labels and a “View Alert” action.
    • Notifications opened from taps or app launch now display reliably without duplicates.
    • Notification inbox details can open as a full-screen view while the inbox remains available.
  • Bug Fixes
    • Improved login error visibility with inline and modal error messages.
    • Standardized navigation buttons and header sizing for more consistent interaction.
  • Localization
    • Added push notification translations across supported languages.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 42 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

Run ID: 25cd976e-7509-49ab-ad8d-90c39d34c85d

📥 Commits

Reviewing files that changed from the base of the PR and between eda2d50 and a444b3d.

📒 Files selected for processing (1)
  • src/components/notifications/NotificationInbox.tsx
📝 Walkthrough

Walkthrough

The change adds weather push-notification parsing, modal actions, cold-start replay, and response deduplication. It also centralizes fixed-size header back buttons, improves login error rendering, keeps notification details alongside the inbox, and adds localized push-notification strings.

Changes

Shared navigation and notification UI

Layer / File(s) Summary
Shared fixed-size header controls
src/components/common/header-back-button.tsx, src/components/common/__tests__/*, src/app/call/..., src/app/poi/..., src/components/calls/call-detail-menu.tsx
A reusable 40x40 back button replaces inline header buttons, with matching sizing applied to the call detail menu.
Login error rendering
src/app/login/index.tsx, src/app/login/login-form.tsx
Login errors render conditionally in the modal and as an accessible inline banner.
Notification inbox overlay layout
src/components/notifications/NotificationInbox.tsx
Notification details render as a sibling overlay while the inbox remains visible; selection controls now expose accessibility and disabled states.

Weather push notifications

Layer / File(s) Summary
Weather notification contract
src/stores/push-notification/store.ts, src/stores/push-notification/__tests__/*
The parser recognizes W: event codes and returns the weather type and alert identifier.
Notification response and cold-start flow
src/services/push-notification.ts, src/services/__tests__/*
Foreground, tapped, and launch-time notifications share modal presentation logic, with duplicate responses suppressed.
Weather alert modal action
src/components/push-notification/push-notification-modal.tsx, src/components/push-notification/__tests__/*
Weather notifications display dedicated content and can load, track, dismiss, and navigate to an alert.
Push notification translations
src/translations/*.json
Push-notification labels and weather alert actions are added across nine locales.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExpoNotifications
  participant PushNotificationService
  participant PushNotificationModalStore
  participant PushNotificationModal
  participant WeatherAlertsStore
  ExpoNotifications->>PushNotificationService: deliver notification or launch response
  PushNotificationService->>PushNotificationService: validate eventCode and deduplicate response
  PushNotificationService->>PushNotificationModalStore: show notification modal
  PushNotificationModal->>WeatherAlertsStore: load weather alert
  WeatherAlertsStore-->>PushNotificationModal: return alert data
  PushNotificationModal->>PushNotificationModal: navigate to weather alert detail
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is just the branch name and does not describe the pull request’s changes. Replace it with a concise summary of the main change, such as adding weather push notifications and reusable header back buttons.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
src/components/push-notification/push-notification-modal.tsx (1)

159-168: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use NotificationIconProps and pass the calculated iconColor.

The iconColor variable is computed on line 159 to support the new amber color for weather alerts, but it is never passed to NotificationIcon. Furthermore, the NotificationIcon component currently ignores its defined NotificationIconProps interface and hardcodes the color to red (#EF4444), preventing your new color from being applied.

Pass the iconColor to the icon and update the component signature to utilize the interface.

🐛 Proposed fixes

Update the rendering of the icon here:

-  const iconColor = getNotificationColor(notification.type);
-  const typeText = getNotificationTypeText(notification.type);
-
-  return (
-    <Modal isOpen={isOpen} onClose={handleClose} size="md">
-      <ModalBackdrop />
-      <ModalContent className="mx-4">
-        <ModalHeader className="pb-4">
-          <HStack className="items-center space-x-3">
-            <NotificationIcon type={notification.type} />
+  const iconColor = getNotificationColor(notification.type);
+  const typeText = getNotificationTypeText(notification.type);
+
+  return (
+    <Modal isOpen={isOpen} onClose={handleClose} size="md">
+      <ModalBackdrop />
+      <ModalContent className="mx-4">
+        <ModalHeader className="pb-4">
+          <HStack className="items-center space-x-3">
+            <NotificationIcon type={notification.type} color={iconColor} />

And update the NotificationIcon definition (around line 21) to use the ignored interface:

const NotificationIcon = ({ type, color, size }: NotificationIconProps) => {
  const iconProps = {
    size: size || 24,
    color: color || '`#EF4444`',
    testID: 'notification-icon',
  };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/push-notification/push-notification-modal.tsx` around lines
159 - 168, Update NotificationIcon to destructure and use NotificationIconProps,
applying the optional color and size values with the existing red and 24px
defaults. In the modal rendering near iconColor, pass the calculated iconColor
to NotificationIcon so weather alerts use the intended color.
🧹 Nitpick comments (3)
src/app/login/index.tsx (1)

109-134: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid conditionally rendering the Modal component to preserve exit animations.

Gluestack-UI's Modal handles its own conditional rendering (via AnimatePresence). Wrapping it in {isErrorModalVisible ? <Modal .../> : null} forces it to unmount instantly when closed, which breaks the exit transition.

Consider rendering the Modal unconditionally and letting the isOpen prop dictate visibility.

🛠️ Proposed refactor
-      {isErrorModalVisible ? (
-        <Modal isOpen={isErrorModalVisible} onClose={() => setIsErrorModalVisible(false)} size="full">
-          <ModalBackdrop />
-          <ModalContent className="m-4 w-full max-w-3xl rounded-2xl">
-            <ModalHeader>
-              <Text className="text-xl font-semibold">{t('login.errorModal.title')}</Text>
-            </ModalHeader>
-            <ModalBody>
-              <Text>{t('login.errorModal.message')}</Text>
-              {error ? <Text className="mt-2 text-sm text-gray-500">{error}</Text> : null}
-            </ModalBody>
-            <ModalFooter>
-              <Button
-                variant="solid"
-                size="sm"
-                action="primary"
-                onPress={() => {
-                  setIsErrorModalVisible(false);
-                }}
-              >
-                <ButtonText>{t('login.errorModal.confirmButton')}</ButtonText>
-              </Button>
-            </ModalFooter>
-          </ModalContent>
-        </Modal>
-      ) : null}
+      <Modal isOpen={isErrorModalVisible} onClose={() => setIsErrorModalVisible(false)} size="full">
+        <ModalBackdrop />
+        <ModalContent className="m-4 w-full max-w-3xl rounded-2xl">
+          <ModalHeader>
+            <Text className="text-xl font-semibold">{t('login.errorModal.title')}</Text>
+          </ModalHeader>
+          <ModalBody>
+            <Text>{t('login.errorModal.message')}</Text>
+            {error ? <Text className="mt-2 text-sm text-gray-500">{error}</Text> : null}
+          </ModalBody>
+          <ModalFooter>
+            <Button
+              variant="solid"
+              size="sm"
+              action="primary"
+              onPress={() => {
+                setIsErrorModalVisible(false);
+              }}
+            >
+              <ButtonText>{t('login.errorModal.confirmButton')}</ButtonText>
+            </Button>
+          </ModalFooter>
+        </ModalContent>
+      </Modal>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/login/index.tsx` around lines 109 - 134, Update the error modal
rendering around isErrorModalVisible to always mount the Modal component,
relying on its isOpen prop to control visibility and preserve exit animations.
Keep the existing modal contents, close handler, and error message behavior
unchanged.
src/services/__tests__/push-notification.test.ts (2)

347-355: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the new any escape hatches.

Define typed mock input, construct requests with their identifiers, and use a precise test interface instead of as any.

As per coding guidelines, “Avoid using any; use precise types.”

Also applies to: 441-457

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/__tests__/push-notification.test.ts` around lines 347 - 355,
Update createMockResponse and the related mock setup to eliminate all any casts.
Define a typed input for createMockNotification, construct the notification
request with its identifier rather than mutating it through as any, and
introduce a precise test response interface/type instead of casting to
Notifications.NotificationResponse.

Source: Coding guidelines


436-468: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test cold-start replay through initialization.

The test configures the response after singleton initialization and invokes the private helper directly. Removing the initialization call at src/services/push-notification.ts Line 190 would still pass. Mock the response before importing a fresh service instance and assert automatic presentation.

As per coding guidelines, “Create Jest tests for all generated components, services, and logic.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/__tests__/push-notification.test.ts` around lines 436 - 468,
Update the cold-start test around presentLaunchNotificationResponse to mock
getLastNotificationResponseAsync before importing a fresh
pushNotificationService instance, then trigger normal service initialization and
assert the modal is presented automatically. Remove the direct private-helper
invocation so the test fails if the initialization call in the service is
removed, while preserving the existing notification payload assertions.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/notifications/NotificationInbox.tsx`:
- Around line 266-286: Update the Select All condition in NotificationInbox to
require a non-empty notifications list before comparing
selectedNotificationIds.size with notifications.length, preventing the empty
state from being treated as fully selected. Use this condition consistently for
the toggle handler, accessibility label, and icon, rendering CheckCircle when
all notifications are selected and Circle otherwise.

---

Outside diff comments:
In `@src/components/push-notification/push-notification-modal.tsx`:
- Around line 159-168: Update NotificationIcon to destructure and use
NotificationIconProps, applying the optional color and size values with the
existing red and 24px defaults. In the modal rendering near iconColor, pass the
calculated iconColor to NotificationIcon so weather alerts use the intended
color.

---

Nitpick comments:
In `@src/app/login/index.tsx`:
- Around line 109-134: Update the error modal rendering around
isErrorModalVisible to always mount the Modal component, relying on its isOpen
prop to control visibility and preserve exit animations. Keep the existing modal
contents, close handler, and error message behavior unchanged.

In `@src/services/__tests__/push-notification.test.ts`:
- Around line 347-355: Update createMockResponse and the related mock setup to
eliminate all any casts. Define a typed input for createMockNotification,
construct the notification request with its identifier rather than mutating it
through as any, and introduce a precise test response interface/type instead of
casting to Notifications.NotificationResponse.
- Around line 436-468: Update the cold-start test around
presentLaunchNotificationResponse to mock getLastNotificationResponseAsync
before importing a fresh pushNotificationService instance, then trigger normal
service initialization and assert the modal is presented automatically. Remove
the direct private-helper invocation so the test fails if the initialization
call in the service is removed, while preserving the existing notification
payload assertions.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: ec91efc0-cc28-4ce8-b5fb-458bf289a273

📥 Commits

Reviewing files that changed from the base of the PR and between a6e28b6 and eda2d50.

📒 Files selected for processing (24)
  • src/app/call/[id]/index.tsx
  • src/app/login/index.tsx
  • src/app/login/login-form.tsx
  • src/app/poi/[id].tsx
  • src/components/calls/call-detail-menu.tsx
  • src/components/common/__tests__/header-back-button.test.tsx
  • src/components/common/header-back-button.tsx
  • src/components/notifications/NotificationInbox.tsx
  • src/components/push-notification/__tests__/push-notification-modal.test.tsx
  • src/components/push-notification/push-notification-modal.tsx
  • src/services/__tests__/push-notification-channels.test.ts
  • src/services/__tests__/push-notification.test.ts
  • src/services/push-notification.ts
  • src/stores/push-notification/__tests__/store.test.ts
  • src/stores/push-notification/store.ts
  • src/translations/ar.json
  • src/translations/de.json
  • src/translations/en.json
  • src/translations/es.json
  • src/translations/fr.json
  • src/translations/it.json
  • src/translations/pl.json
  • src/translations/sv.json
  • src/translations/uk.json

Comment thread src/components/notifications/NotificationInbox.tsx
@ucswift

ucswift commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Approve

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is approved.

@ucswift
ucswift merged commit 98892c3 into master Jul 18, 2026
13 of 14 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 19, 2026
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.

1 participant