Skip to content

Conversation

@Aviatorscode2
Copy link
Contributor

@Aviatorscode2 Aviatorscode2 commented Sep 19, 2025

Summary by CodeRabbit

  • New Features

    • Inbox Scheduling: per-day time ranges, timezone-aware, copy-to-multiple-days, auto-save with optimistic updates, critical workflows always delivered, supports optional default schedule.
  • Documentation

    • Added an "Inbox Features" section (Snooze & Schedule); detailed Schedule docs for web, React, and React Native; JS API & real-time schedule events documented; inbox navigation updated to surface Features.
  • Style

    • Expanded styling tokens for schedule UI and time selectors for granular customization.

@linear
Copy link

linear bot commented Sep 19, 2025

@netlify
Copy link

netlify bot commented Sep 19, 2025

Deploy Preview for docs-novu ready!

Name Link
🔨 Latest commit 87dcbe6
🔍 Latest deploy log https://app.netlify.com/projects/docs-novu/deploys/68d2a6b74228110008158ffd
😎 Deploy Preview https://deploy-preview-976--docs-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Adds a new Inbox "Features" manifest and Schedule page, removes "snooze" from the Inbox configuration manifest, updates the Inbox top-level meta to reference "features", expands styling keys for schedule UI, and adds useSchedule documentation for React and React Native plus Schedule docs in the JavaScript SDK.

Changes

Cohort / File(s) Summary
Inbox top-level manifests
content/docs/platform/inbox/meta.json, content/docs/platform/inbox/configuration/meta.json
inbox/meta.json now references "features" instead of "navigation-and-events"; configuration/meta.json removed "snooze" from its pages array.
Inbox Features (new)
content/docs/platform/inbox/features/meta.json, content/docs/platform/inbox/features/schedule.mdx
New features manifest ("<Inbox /> Features", icon Blocks, pages ["snooze","schedule"]) and a Schedule MDX page describing schedule UI, timezone handling, defaultSchedule prop, optimistic auto-save, edit/copy workflows, examples, and media references.
Styling additions
content/docs/platform/inbox/configuration/styling.mdx
Added schedule-related styling element keys (e.g., scheduleContainer, scheduleHeader, scheduleTable*, scheduleInfo*, dayScheduleCopy*, timeSelect__dropdownTrigger, timeSelect__dropdownContent) with signatures (context: { schedule?: Schedule }) => string.
Hook docs (new)
content/docs/platform/sdks/react/hooks/use-schedule.mdx, content/docs/platform/sdks/react-native/hooks/use-schedule.mdx, content/docs/platform/sdks/react-native/hooks/meta.json
Added documentation for useSchedule (React + React Native) including types, return shape, update flow, examples; updated React Native hooks manifest to include use-schedule.
JavaScript SDK docs
content/docs/platform/sdks/javascript/index.mdx
Documented Schedule type under Preferences, added Schedule.update API signature, and new real-time events for schedule get/update (pending/resolved).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App as Host App
  participant Inbox as Inbox UI
  participant Store as Preferences Store
  participant Router as Delivery Router

  rect #F8FBFF
    note right of App: defaultSchedule prop may be provided on mount
    App->>Inbox: Mount(defaultSchedule?)
  end

  User->>Inbox: Open Preferences → Schedule
  User->>Inbox: Toggle main schedule / Edit per-day ranges
  Inbox-->>Store: Save changes (optimistic auto-save)
  Store-->>Inbox: Persist confirmation

  alt Notification is non-critical
    Router->>Inbox: Check subscriber schedule
    Inbox-->>Router: Active? yes/no
    alt Inactive
      Router--x User: Suppress delivery
    else Active
      Router-->>User: Deliver notification
    end
  else Critical workflow
    Router-->>User: Deliver regardless of schedule
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested reviewers

  • jainpawan21
  • DianaHackmamba

Poem

I hop through docs where schedule seeds sprout,
Snooze steps aside — new features come about.
Times and copy, dropdowns all in rows,
Default hours planted where the daylight goes.
Inbox hums on — I nibble a carrot, and scout. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Docs for the inbox Schedule page" succinctly and accurately describes the primary change in this PR—adding schedule-related documentation for the Inbox and associated examples; it is concise and clear for team members scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch MRK-1057

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22ac35f and 87dcbe6.

📒 Files selected for processing (1)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - docs-novu
  • GitHub Check: Header rules - docs-novu
  • GitHub Check: Pages changed - docs-novu
  • GitHub Check: Build and Lint

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

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: 1

🧹 Nitpick comments (6)
content/docs/platform/inbox/configuration/meta.json (1)

4-6: Description still mentions “snooze” after moving it to Features. Update copy.

Replace the description to match the current pages.

Apply:

-  "description": "Learn how to configure your inbox with styling, tabs, preferences, data objects, and snooze functionality"
+  "description": "Learn how to configure your inbox with styling, icons, tabs, preferences, and data objects."
content/docs/platform/inbox/features/meta.json (1)

1-6: Tweak section description to reflect Features (Snooze, Schedule) rather than appearance/theming.

Current text overlaps with “Configuration.” Suggest clearer wording.

Apply:

-  "description": "Learn how to customize the appearance and behavior of the inbox component to match your application’s design system."
+  "description": "Explore built-in Inbox features like Snooze and Schedule, and learn how they affect notification delivery."
content/docs/platform/inbox/features/schedule.mdx (4)

9-11: Add descriptive alt text for accessibility.

Empty alt hinders screen reader users; also add alt for the GIF below.

Apply:

-![](/images/inbox/schedule.png)
+![Inbox Schedule preferences with daily availability toggles and time ranges](/images/inbox/schedule.png)

And at Lines 63-64:

-![Copying times to multiple days](/images/inbox/schedule.gif)
+![Copying one day's time range to multiple days in the Schedule UI](/images/inbox/schedule.gif)

24-29: Timezone example: avoid “CET” which is incorrect during DST; prefer city/zone or “local time”.

Minor clarity fix to prevent confusion in summer months.

Apply:

-For example, if a subscriber in Warsaw sets their schedule from 9:00 AM to 5:00 PM, they will receive notifications during those hours in Central European Time (CET).
+For example, if a subscriber in Warsaw sets their schedule from 9:00 AM to 5:00 PM, they will receive notifications during those local hours (Europe/Warsaw), with daylight saving time applied automatically.

36-46: Minor copy tighten for “Enable the main schedule” and daily availability bullets.

Optional: streamline phrasing and remove redundancy.

Apply:

- The entire feature is controlled by a main schedule toggle. When a subscriber turns this on, they can begin configuring individual days. When it's off, all other settings are inactive, and notifications are delivered normally.
+ A main Schedule toggle controls the feature. When on, subscribers can configure individual days. When off, per‑day settings are inactive and notifications are delivered normally.

65-68: “Automatic saving” — consider adding a short note about eventual consistency.

If persistence is asynchronous, add a sentence like “Changes may take a moment to propagate.”

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f3c740 and f86683d.

⛔ Files ignored due to path filters (2)
  • public/images/inbox/schedule.gif is excluded by !**/*.gif
  • public/images/inbox/schedule.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • content/docs/platform/inbox/configuration/meta.json (1 hunks)
  • content/docs/platform/inbox/features/meta.json (1 hunks)
  • content/docs/platform/inbox/features/schedule.mdx (1 hunks)
  • content/docs/platform/inbox/meta.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - docs-novu
  • GitHub Check: Header rules - docs-novu
  • GitHub Check: Pages changed - docs-novu
  • GitHub Check: Build and Lint
🔇 Additional comments (5)
content/docs/platform/inbox/features/schedule.mdx (4)

11-11: Verify terminology: “critical workflows” matches product naming.

If the product uses “priority”/“always deliver,” align the term and consider linking to the definition.


58-62: UI label casing check: “Copy times to...”

Ensure the button text matches the UI exactly; if the ellipsis is a single glyph (…) or not present, mirror it here.


1-98: Assets present — no action required

Both images exist at public/images/inbox/schedule.png and public/images/inbox/schedule.gif.


71-97: Validate the defaultSchedule prop shape & time format against @novu/react Inbox API.

Confirm keys (defaultSchedule.isEnabled, weeklySchedule → day names → hours[{start,end}]) and whether 12‑hour strings with AM/PM (e.g. "09:00 AM") are accepted; if the component requires 24‑hour "HH:mm" or ISO timestamps, update the example in content/docs/platform/inbox/features/schedule.mdx (lines 71–97).

content/docs/platform/inbox/meta.json (1)

5-5: Nav entry “features” looks good — confirm no stale links to removed navigation-and-events

The ripgrep run in the sandbox produced no output; absence of output isn't proof of absence. Re-run locally and confirm no references remain, e.g.:

rg -n --hidden -S -C2 "navigation-and-events" content || true
git grep -n "navigation-and-events" -- content || true

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

Caution

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

⚠️ Outside diff range comments (1)
content/docs/platform/inbox/configuration/styling.mdx (1)

406-411: Unreachable branch in example (thresholds inverted).

> 1 short-circuits the later > 10 check; the yellow path is never hit.

-        if (unreadCount.total > 1) {
-          return '[--bell-gradient-start:var(--color-red-500)] [--bell-gradient-end:var(--color-red-500)]';
-        }
-        return unreadCount.total > 10
-          ? '[--bell-gradient-start:var(--color-yellow-500)] [--bell-gradient-end:var(--color-yellow-500)]'
-          : '[--bell-gradient-start:var(--color-gray-500)] [--bell-gradient-end:var(--color-gray-500)]';
+        if (unreadCount.total > 10) {
+          return '[--bell-gradient-start:var(--color-yellow-500)] [--bell-gradient-end:var(--color-yellow-500)]';
+        }
+        if (unreadCount.total > 1) {
+          return '[--bell-gradient-start:var(--color-red-500)] [--bell-gradient-end:var(--color-red-500)]';
+        }
+        return '[--bell-gradient-start:var(--color-gray-500)] [--bell-gradient-end:var(--color-gray-500)]';
🧹 Nitpick comments (5)
content/docs/platform/inbox/configuration/styling.mdx (5)

9-9: Remove unused Tabs import.

Tab, Tabs are not used in this MDX and may trip lint/MDX bundlers.

-import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

4-4: Hyphenate “pre-built”.

Minor docs polish.

-description: 'Learn how to style the pre built Inbox component'
+description: 'Learn how to style the pre-built Inbox component'

288-289: Fix typos in Accordion title.

Spelling/grammar: “elements” and “customized”.

-  <Accordion title="List of elemets that can be customize using the callback function">
+  <Accordion title="List of elements that can be customized using the callback function">

88-139: Add severity color variables to the TypeTable.

You reference colorSeverityHigh/Medium/Low later; list them here for completeness.

   type={{
     colorBackground: {
       type: 'string',
       description: 'The background color of the inbox component.',
     },
@@
     colorShadow: {
       type: 'string',
       description: 'The color of shadows applied to elements.',
     },
+    colorSeverityHigh: {
+      type: 'string',
+      description: 'Color for high severity notifications and bell accent.',
+    },
+    colorSeverityMedium: {
+      type: 'string',
+      description: 'Color for medium severity notifications and bell accent.',
+    },
+    colorSeverityLow: {
+      type: 'string',
+      description: 'Color for low severity notifications and bell accent.',
+    },
     fontSize: {
       type: 'string',
       description: 'The base font size for text in the inbox.',
     },

363-388: Schedule keys look consistent; consider linking Schedule type.

The callback signatures use Schedule but the type isn’t introduced on this page. Add a short note or link to the Schedule feature page or its type definition.

Would you like me to propose a small “Schedule context” blurb with a minimal interface example?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f86683d and abd6e8e.

📒 Files selected for processing (1)
  • content/docs/platform/inbox/configuration/styling.mdx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Lint
🔇 Additional comments (1)
content/docs/platform/inbox/configuration/styling.mdx (1)

163-171: Fix selector naming and parity with detailed keys.

Short elements table (content/docs/platform/inbox/configuration/styling.mdx lines 163–171) lists dayScheduleCopy__dropdownContent but the detailed elements list (lines 364–387) does not; add scheduleDescription to the short table and confirm whether dayScheduleCopy__dropdownContent is actually exported by @novu/react—remove it if not.

 | Notification list container  | `notificationList`                    |
-| Schedule container           | `scheduleContainer`                     |
-| Schedule header              | `scheduleHeader`                        |
-| Schedule body                | `scheduleBody`                          |
-| Schedule table               | `scheduleTable`                         |
-| Day schedule copy title      | `dayScheduleCopyTitle`                  |
-| Day schedule copy menu       | `dayScheduleCopy__dropdownContent`      |
-| Time select dropdown         | `timeSelect__dropdownTrigger`           |
-| Time select list             | `timeSelect__dropdownContent`           |
+| Schedule container           | `scheduleContainer`                   |
+| Schedule header              | `scheduleHeader`                      |
+| Schedule description         | `scheduleDescription`                 |
+| Schedule body                | `scheduleBody`                        |
+| Schedule table               | `scheduleTable`                       |
+| Day schedule copy title      | `dayScheduleCopyTitle`                |
+| Time select dropdown         | `timeSelect__dropdownTrigger`         |
+| Time select list             | `timeSelect__dropdownContent`         |

Aviatorscode2 and others added 2 commits September 21, 2025 23:41
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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 (8)
content/docs/platform/sdks/react/hooks/use-schedule.mdx (8)

6-8: Remove unused imports.

Tab/Tabs aren’t used; keep the file lean.

 import { TypeTable } from 'fumadocs-ui/components/type-table';
-import { Tab, Tabs } from "fumadocs-ui/components/tabs";

41-50: Don’t hardcode “default: true” for booleans.

isLoading/isFetching are dynamic. Remove the default fields to avoid misleading readers.

     isLoading: {
       type: "boolean",
-      description: "True during the initial load, false otherwise",
-      default: "true",
+      description: "True during the initial load; false after success/error",
     },
     isFetching: {
       type: "boolean",
       description:
         "True while any request is in flight (initial load or refetch), false otherwise",
-      default: "true",
     },

84-86: Clarify time format, timezone, and validation for hours.

Readers need the accepted format and TZ assumption to avoid API errors.

     hours: {
       type: "Array<{ start: string; end: string; }>",
-      description: "An array of time ranges for when notifications are allowed. Multiple ranges per day are supported (for example, 9-12 AM and 2-5 PM).",
+      description: "Array of allowed time ranges. Supported formats: 'HH:mm' (24‑hour) or 'h:mm A' (12‑hour). Times are interpreted in the subscriber’s timezone. Ranges must not overlap and start must be earlier than end.",
     },

94-106: Fix time format and call the updater consistently.

Avoid mixing 24‑hour with AM/PM, and call the updater as documented (see Return value comment).

-const handleClick = async () => {
-  await schedule?.update({
+const handleClick = async () => {
+  await update({
     isEnabled: true,
     weeklySchedule: {
       monday: {
         isEnabled: true,
-        hours: [{ start: '08:00 AM', end: '18:00 PM' }],
+        hours: [{ start: '08:00 AM', end: '06:00 PM' }],
       },
     }
   })
 };

113-117: Destructure the updater from the hook.

Keep example API consistent and Typescript-friendly.

-import { useSchedule } from "@novu/react";
+import { useSchedule } from "@novu/react";
 
 function ScheduleManager() {
-  const { schedule, isLoading, error, refetch } = useSchedule();
+  const { schedule, isLoading, error, refetch, update } = useSchedule();

121-147: Use the updater function and await refetch for consistency.

Also removes optional chaining on the updater.

   const handleUpdateSchedule = async () => {
     try {
-      await schedule?.update({
+      await update({
         isEnabled: true,
         weeklySchedule: {
           monday: {
             isEnabled: true,
             hours: [
               { start: '09:00 AM', end: '12:00 PM' },
               { start: '02:00 PM', end: '05:00 PM' },
             ],
           },
           tuesday: {
             isEnabled: true,
             hours: [{ start: '09:00 AM', end: '05:00 PM' }],
           },
           // Other days can be left undefined or explicitly disabled
           wednesday: {
             isEnabled: false,
             hours: [],
           },
         },
       });
 
-      // Refresh the schedule data after updating
-      refetch();
+      // Refresh the schedule data after updating
+      await refetch();
     } catch (e) {
       console.error("Failed to update schedule:", e);
     }
   };

161-165: Use optional chaining (or local alias) when mapping Monday hours.

Prevents TS narrowing issues and avoids edge-case NPEs if types change.

-            {schedule.weeklySchedule.monday.hours.map((range, index) => (
+            {schedule?.weeklySchedule?.monday?.hours?.map((range, index) => (
               <li key={index}>{`${range.start} - ${range.end}`}</li>
             ))}

68-72: Enumerate allowed day keys for weeklySchedule.

Small clarity gain; avoids ambiguity in community translations and validations.

     weeklySchedule: {
       type: "object",
-      description: "An object containing the schedule for each day of the week (for example, monday, tuesday). Each key holds a DaySchedule object.",
+      description: "Object with keys: monday, tuesday, wednesday, thursday, friday, saturday, sunday. Each key holds a DaySchedule object.",
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83b6862 and 4b5d63e.

📒 Files selected for processing (1)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - docs-novu
  • GitHub Check: Header rules - docs-novu
  • GitHub Check: Pages changed - docs-novu
  • GitHub Check: Build and Lint
🔇 Additional comments (1)
content/docs/platform/sdks/react/hooks/use-schedule.mdx (1)

31-56: Return value docs conflict with example usage (schedule.update)

content/docs/platform/sdks/react/hooks/use-schedule.mdx — lines 31-56: schedule is documented as plain data (Schedule | undefined) but examples call schedule.update(...). Either expose an updater separately or document schedule as an object with methods. Proposed Option A (update TypeTable and examples):

 <TypeTable
   type={{
     schedule: {
       type: "Schedule | undefined",
       description: "The subscriber's current schedule object",
       typeDescription: "undefined if data is not yet loaded",
     },
+    update: {
+      type: "(patch: Partial<Schedule>) => Promise<Schedule>",
+      description: "Create or update the subscriber's schedule.",
+    },
+    isUpdating: {
+      type: "boolean",
+      description: "True while an update request is in flight.",
+    },
     error: {
       type: "NovuError | undefined",
       description: "Error object if the request failed",
     },
     isLoading: {
-      description: "True during the initial load, false otherwise",
-      default: "true",
+      description: "True during the initial load; false after success/error",
     },
     isFetching: {
       type: "boolean",
       description:
         "True while any request is in flight (initial load or refetch), false otherwise",
-      default: "true",
     },
     refetch: {
-      type: "() => Promise<void>",
+      type: "() => Promise<unknown>",
       description: "Function to manually trigger a refetch of the schedule",
     },
   }}
 />


## Schedule type

The `Schedule` type from `@novu/react` includes these properties:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add intro paragraphs to the previous two sections so that they are consistent with this one.

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

Caution

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

⚠️ Outside diff range comments (1)
content/docs/platform/inbox/configuration/styling.mdx (1)

405-411: Fix unreachable condition in example logic.

unreadCount.total > 10 is checked only in the else branch of > 1, so it never runs. Reverse the order.

Apply this diff:

-      bellIcon: ({ unreadCount }) => {
-        if (unreadCount.total > 1) {
-          return '[--bell-gradient-start:var(--color-red-500)] [--bell-gradient-end:var(--color-red-500)]';
-        }
-        return unreadCount.total > 10
-          ? '[--bell-gradient-start:var(--color-yellow-500)] [--bell-gradient-end:var(--color-yellow-500)]'
-          : '[--bell-gradient-start:var(--color-gray-500)] [--bell-gradient-end:var(--color-gray-500)]';
-      },
+      bellIcon: ({ unreadCount }) => {
+        if (unreadCount.total > 10) {
+          return '[--bell-gradient-start:var(--color-yellow-500)] [--bell-gradient-end:var(--color-yellow-500)]';
+        }
+        if (unreadCount.total > 1) {
+          return '[--bell-gradient-start:var(--color-red-500)] [--bell-gradient-end:var(--color-red-500)]';
+        }
+        return '[--bell-gradient-start:var(--color-gray-500)] [--bell-gradient-end:var(--color-gray-500)]';
+      },
🧹 Nitpick comments (1)
content/docs/platform/inbox/configuration/styling.mdx (1)

168-171: Unify dropdown terminology for consistency.

Use “drop-down content” to match the “drop-down list” phrasing above and avoid mixing “menu/list”.

Apply this diff:

-| Day schedule copy menu       | `dayScheduleCopy__dropdownContent`      |
-| Time select list             | `timeSelect__dropdownContent`           |
+| Day schedule copy drop-down content | `dayScheduleCopy__dropdownContent` |
+| Time select drop-down content       | `timeSelect__dropdownContent`      |
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5d63e and a2b5aeb.

⛔ Files ignored due to path filters (1)
  • public/images/inbox/inbox-schedule.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • content/docs/platform/inbox/configuration/styling.mdx (2 hunks)
  • content/docs/platform/inbox/features/schedule.mdx (1 hunks)
  • content/docs/platform/sdks/react-native/hooks/meta.json (1 hunks)
  • content/docs/platform/sdks/react-native/hooks/use-schedule.mdx (1 hunks)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx
  • content/docs/platform/sdks/react-native/hooks/use-schedule.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/docs/platform/inbox/features/schedule.mdx
🔇 Additional comments (5)
content/docs/platform/inbox/configuration/styling.mdx (2)

169-169: Past suggestion applied — looks good.

“Time select drop-down list | timeSelect__dropdownTrigger” reflects the earlier review suggestion. No further changes needed here.


363-388: Confirm callback support for dropdown elements.

The Schedule callback list omits dayScheduleCopy__dropdownContent, timeSelect__dropdownTrigger, and timeSelect__dropdownContent. If these accept contextual callbacks, please add them; if not, add a brief note that these elements are class-only (no context).

content/docs/platform/sdks/react-native/hooks/meta.json (3)

2-9: LGTM: RN hooks meta now exposes use-schedule

Entry looks correct and consistent with existing slugs. JSON is valid.


8-8: Verify frontmatter slug parity for use-schedule

  • All pages listed in content/docs/platform/sdks/react-native/hooks/meta.json are present.
  • content/docs/platform/sdks/react-native/hooks/use-schedule.mdx has title "useSchedule" and no "slug" frontmatter — add slug: "use-schedule" or confirm the site/build derives the slug from the filename.

2-9: Optional: confirm nav ordering policy

Verification script produced no output so I couldn't compare ordering across SDKs. Confirm whether hooks are alphabetized after novu-provider elsewhere — if yes, reorder this file's "pages" array to match; otherwise ignore.

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 (8)
content/docs/platform/sdks/react/hooks/use-schedule.mdx (5)

60-73: Name the WeeklySchedule shape explicitly.

Readers benefit from seeing concrete keys. Consider adding a brief note like: “weeklySchedule has keys: monday … sunday (DaySchedule).”

I can add a tiny TypeTable for WeeklySchedule if you want.


77-88: Document expected time format for hours.

Specify whether times are 24‑hour (“HH:mm”) or 12‑hour with AM/PM. Without this, users may pass invalid values.

Want me to add a one‑liner note and validation example?


95-106: Fix invalid time literal (“18:00 PM”).

Use either 24‑hour or AM/PM consistently.

Apply:

-        hours: [{ start: '08:00 AM', end: '18:00 PM' }],
+        // 12-hour format
+        hours: [{ start: '08:00 AM', end: '06:00 PM' }],
+        // or 24-hour format
+        // hours: [{ start: '08:00', end: '18:00' }],

153-160: Guard against undefined hours to avoid runtime errors.

If monday.isEnabled is true but hours is missing, .map will throw.

Apply:

-            {schedule.weeklySchedule.monday.hours.map((range, index) => (
+            {(schedule.weeklySchedule.monday.hours ?? []).map((range, index) => (
               <li key={index}>{`${range.start} - ${range.end}`}</li>
             ))}

75-88: Add a subheading for DaySchedule for scannability.

Insert “### DaySchedule” before the structure.

Apply:

-Each `DaySchedule` object within `weeklySchedule` has the following structure:
+### DaySchedule
+
+Each `DaySchedule` object within `weeklySchedule` has the following structure:
content/docs/platform/sdks/javascript/index.mdx (3)

472-477: Prefer ts code fence for JS SDK snippets.

These examples aren’t JSX; switch tsxts for accuracy.

Apply:

-```tsx
+```ts
 const novu = new Novu(...);
 
 const { data: { schedule } } = await novu.preferences.schedule.get();

482-494: Same: use ts fence and compact example.

Apply:

-```tsx
+```ts
 const novu = new Novu(...);
 
 // Update schedule via preferences
 const { data: { schedule } } = await novu.preferences.schedule.update({
   weeklySchedule: {
     monday: {
       isEnabled: true,
       hours: [{ start: '09:00 AM', end: '05:00 PM' }],
     },
   },
 });
 
 // Or update directly from a Schedule instance
 const { data: { schedule: updatedSchedule } } =
   await schedule.update({ isEnabled: false });

---

`555-557`: **Show `get.resolved` example too for completeness.**

Add a snippet to help users subscribe to schedule fetch events.

Apply:

```diff
 novu.on('preferences.schedule.update.resolved', ({ data }) => {
   console.log('Schedule updated:', data.schedule);
 });
+
+novu.on('preferences.schedule.get.resolved', ({ data }) => {
+  console.log('Schedule fetched:', data.schedule);
+});
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44eb74e and 22ac35f.

📒 Files selected for processing (4)
  • content/docs/platform/inbox/features/schedule.mdx (1 hunks)
  • content/docs/platform/sdks/javascript/index.mdx (3 hunks)
  • content/docs/platform/sdks/react-native/hooks/use-schedule.mdx (1 hunks)
  • content/docs/platform/sdks/react/hooks/use-schedule.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • content/docs/platform/sdks/react-native/hooks/use-schedule.mdx
  • content/docs/platform/inbox/features/schedule.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - docs-novu
  • GitHub Check: Header rules - docs-novu
  • GitHub Check: Build and Lint
  • GitHub Check: Pages changed - docs-novu
🔇 Additional comments (6)
content/docs/platform/sdks/react/hooks/use-schedule.mdx (4)

13-25: Clarify error type and callback semantics for consistency.

Confirm that errors are surfaced as values (Result-style) and not thrown, and that onError receives a NovuError. If some implementations pass a generic Error, reflect that here.

Would you like me to propose wording that highlights the { data, error } pattern across hooks?


29-56: Tighten return types and remove misleading “default: true” flags.

  • refetch rarely needs to be called and its type isn’t () => Promise<void> in React Query. Either omit the explicit type or align with the actual TS type.
  • isLoading/isFetching don’t have static defaults; remove the “default: true” rows to avoid misleading readers.

Apply:

     isLoading: {
       type: "boolean",
-      description: "True during the initial load, false otherwise",
-      default: "true",
+      description: "True during the initial load; controlled by network state",
     },
     isFetching: {
       type: "boolean",
       description:
         "True while any request is in flight (initial load or refetch), false otherwise",
-      default: "true",
+      // no static default; depends on network state
     },
     refetch: {
-      type: "() => Promise<void>",
-      description: "Function to manually trigger a refetch of the schedule",
+      // Prefer not to hardcode a signature here; it’s React Query’s refetch fn.
+      type: "Refetch function",
+      description: "Manually trigger a refetch (usually unnecessary)",
     },

108-117: Drop refetch from the example; it auto‑updates.

The schedule returned by the hook re-renders on update; refetch isn’t needed in this example.

Apply:

-function ScheduleManager() {
-  const { schedule, isLoading, error, refetch } = useSchedule();
+function ScheduleManager() {
+  const { schedule, isLoading, error } = useSchedule();

121-143: Show result‑style update handling ({ data, error }) in example.

Public functions return values/errors instead of throwing; reflect that pattern.

Apply:

-  const handleUpdateSchedule = async () => {
-    await schedule?.update({
+  const handleUpdateSchedule = async () => {
+    const { data: updated, error } = await schedule?.update({
       isEnabled: true,
       weeklySchedule: {
         monday: {
           isEnabled: true,
           hours: [
             { start: '09:00 AM', end: '12:00 PM' },
             { start: '02:00 PM', end: '05:00 PM' },
           ],
         },
         tuesday: {
           isEnabled: true,
           hours: [{ start: '09:00 AM', end: '05:00 PM' }],
         },
         // Other days can be left undefined or explicitly disabled
         wednesday: {
           isEnabled: false,
           hours: [],
         },
       },
-    });    
+    });
+    if (error) {
+      // surface error in UI or toast
+      return;
+    }
+    // optionally use `updated`
   };
content/docs/platform/sdks/javascript/index.mdx (2)

530-533: Event names look good; consider adding corresponding .rejected events if they exist.

If there are error events (e.g., .rejected), list them for parity.

I can add them once you confirm the emitted names from the SDK.


504-518: Fix Schedule.update signature to allow toggling isEnabled.

File: content/docs/platform/sdks/javascript/index.mdx (lines ~504-518)

Docs show schedule.update({ isEnabled: false }) but the parameter is typed as Partial<WeeklySchedule>; change to Partial<Schedule>.

Apply:

     "update": {
       "description": "Update the schedule with partial data",
-      "type": "(schedule: Partial<WeeklySchedule>) => Result<Schedule>"
+      "type": "(schedule: Partial<Schedule>) => Result<Schedule>"
     }

@jainpawan21 jainpawan21 merged commit 79137d1 into main Sep 23, 2025
6 checks passed
@jainpawan21 jainpawan21 deleted the MRK-1057 branch September 23, 2025 15:18
@coderabbitai coderabbitai bot mentioned this pull request Oct 28, 2025
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.

5 participants