Skip to content

feat(dashboard): Add lookback window option to digest delay tabs fixes NV-7002#9832

Merged
scopsy merged 2 commits intonextfrom
nv-7002-back-off-strategy-digest-in-new-dashboard
Jan 14, 2026
Merged

feat(dashboard): Add lookback window option to digest delay tabs fixes NV-7002#9832
scopsy merged 2 commits intonextfrom
nv-7002-back-off-strategy-digest-in-new-dashboard

Conversation

@scopsy
Copy link
Contributor

@scopsy scopsy commented Jan 14, 2026

Introduces a LookbackWindow component for digest steps, allowing users to configure when to start collecting events (immediately, 5min, 30min, or custom). Updates keys.ts with new lookback keys and integrates the component into digest-delay-tabs.tsx for improved workflow flexibility.

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Introduces a LookbackWindow component for digest steps, allowing users to configure when to start collecting events (immediately, 5min, 30min, or custom). Updates keys.ts with new lookback keys and integrates the component into digest-delay-tabs.tsx for improved workflow flexibility.
@linear
Copy link

linear bot commented Jan 14, 2026

@netlify
Copy link

netlify bot commented Jan 14, 2026

Deploy preview added

Name Link
🔨 Latest commit 410a2fd
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/69677ff69017e10008954538
😎 Deploy Preview https://deploy-preview-9832.dashboard-v2.novu-staging.co
📱 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 Jan 14, 2026

Walkthrough

This change introduces a new LookbackWindow component to the digest delay tabs workflow editor. A new file lookback-window.tsx defines a React component that manages digest lookback window configuration through react-hook-form integration. It provides predefined lookback options (immediately, 5min, 30min) and a custom configuration input. Two new exported constants in keys.ts define form field paths for lookback amount and unit. The digest-delay-tabs.tsx component was updated to import and conditionally render the LookbackWindow component when digest mode is enabled, alongside layout adjustments including flex container styling.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a lookback window option to digest delay tabs, which aligns with the feature addition shown in the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the LookbackWindow component introduction and its integration into digest-delay-tabs.

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



📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0b7c06 and 410a2fd.

📒 Files selected for processing (1)
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
⏰ 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). (6)
  • GitHub Check: E2E test API / Test E2E
  • GitHub Check: Redirect rules - dashboard-v2-novu-staging
  • GitHub Check: Header rules - dashboard-v2-novu-staging
  • GitHub Check: Pages changed - dashboard-v2-novu-staging
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (typescript)

✏️ Tip: You can disable this entire section by setting review_details to false in your review 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.

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)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx (1)

56-62: LookbackWindow state is preserved but not restored when switching tabs.

The controlValues object (including lookBackWindow) is preserved at line 52, but lines 59-62 only restore amount, unit, cron, and type. If a user configures a lookback window, switches to the Scheduled tab, and switches back to Regular, the lookback configuration is lost.

🐛 Proposed fix to restore lookBackWindow
     if (preservedFormValues) {
       setValue(AMOUNT_KEY, preservedFormValues.amount, { shouldDirty: true });
       setValue(UNIT_KEY, preservedFormValues.unit, { shouldDirty: true });
       setValue(CRON_KEY, preservedFormValues.cron, { shouldDirty: true });
       setValue(TYPE_KEY, preservedFormValues.type, { shouldDirty: true });
+      setValue('controlValues.lookBackWindow', preservedFormValues.lookBackWindow, { shouldDirty: true });
     } else if (value === SCHEDULED_TYPE) {

You'll also need to import the key or use the string path directly. Additionally, consider clearing lookBackWindow when switching to SCHEDULED_TYPE without preserved values (line 63-67) to maintain consistency.

🧹 Nitpick comments (2)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx (2)

56-64: Edge case: Custom values matching preset amounts may be overwritten.

When switching to 'custom', if the user had previously set exactly 5 or 30 minutes as a custom value, it will be reset to 10 minutes. This appears intentional to provide sensible defaults when transitioning from presets, but consider whether preserving user-entered values of 5 or 30 is desired.


78-99: FormField name doesn't correspond to actual form state.

The name="lookbackType" doesn't map to a real form field—lookbackType is a derived value computed via useMemo. This may cause react-hook-form to register an unused field. Consider removing the FormField wrapper and using just FormItem for layout, or using a descriptive name like _lookbackTypeDisplay to indicate it's not a real field.

♻️ Suggested refactor
-      <FormField
-        control={control}
-        name="lookbackType"
-        render={() => (
-          <FormItem>
-            <FormControl>
-              <Select value={lookbackType} onValueChange={handleLookbackTypeChange} disabled={isReadOnly}>
-                <SelectTrigger className="w-full" size="2xs">
-                  <SelectValue />
-                </SelectTrigger>
-                <SelectContent>
-                  {LOOKBACK_OPTIONS.map(({ label, value }) => (
-                    <SelectItem key={value} value={value}>
-                      {label}
-                    </SelectItem>
-                  ))}
-                </SelectContent>
-              </Select>
-            </FormControl>
-          </FormItem>
-        )}
-      />
+      <FormItem>
+        <FormControl>
+          <Select value={lookbackType} onValueChange={handleLookbackTypeChange} disabled={isReadOnly}>
+            <SelectTrigger className="w-full" size="2xs">
+              <SelectValue />
+            </SelectTrigger>
+            <SelectContent>
+              {LOOKBACK_OPTIONS.map(({ label, value }) => (
+                <SelectItem key={value} value={value}>
+                  {label}
+                </SelectItem>
+              ))}
+            </SelectContent>
+          </Select>
+        </FormControl>
+      </FormItem>
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69a78a3 and d0b7c06.

📒 Files selected for processing (3)
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use descriptive variable names with auxiliary verbs (isLoading, hasError)
Add blank lines before return statements
Import motion components from 'motion/react' instead of 'motion-react'

**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication, minimize code duplication as possible
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Structure files: exported component, subcomponents, helpers, static content, types
Don't leave comments in code, unless they explain something complex and not trivial
Don't use nested ternaries
Favor named exports for components
Use TypeScript for all code; prefer interfaces over types
In front end code, use types over interfaces
Use functional components with TypeScript types
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
Add blank lines before return statements
When importing "motion-react" package, import it from "motion/react"

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use functional and declarative programming patterns; avoid classes

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Favor named exports for components

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
apps/{dashboard,web}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Prefer types over interfaces in frontend code

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
apps/dashboard/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use lowercase with dashes for directories and files in dashboard (e.g., components/auth-wizard)

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
apps/dashboard/**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Favor named exports for components in dashboard

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
apps/dashboard/**/*

📄 CodeRabbit inference engine (.cursor/rules/figma.mdc)

apps/dashboard/**/*: Use the assets endpoint from Figma Dev Mode MCP Server to serve image and SVG assets
If the Figma Dev Mode MCP Server returns a localhost source for an image or SVG, use that image or SVG source directly without modification
Do not import or add new icon packages; all assets should come from the Figma payload
Do not use or create placeholders if a localhost source is provided by the Figma Dev Mode MCP Server

Use lowercase with dashes for directory and file names (e.g., components/auth-wizard)

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
apps/dashboard/**/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Favor named exports for components

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
**

📄 CodeRabbit inference engine (.cursor/rules/novu.mdc)

Use lowercase with dashes for directories and files (e.g., components/auth-wizard)

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/novu.mdc)

**/*.tsx: Use declarative JSX
Wrap client components in Suspense with fallback
Use dynamic loading for non-critical components

Files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
🧠 Learnings (2)
📚 Learning: 2025-11-25T11:29:52.304Z
Learnt from: CR
Repo: novuhq/novu PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T11:29:52.304Z
Learning: Applies to apps/dashboard/**/*.{tsx,ts} : Favor named exports for components in dashboard

Applied to files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx
  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
📚 Learning: 2025-12-22T14:14:49.363Z
Learnt from: CR
Repo: novuhq/novu PR: 0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-12-22T14:14:49.363Z
Learning: Applies to apps/dashboard/**/components/**/*.{ts,tsx} : Favor named exports for components

Applied to files:

  • apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx (2)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/regular-type.tsx (1)
  • RegularType (10-47)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx (1)
  • LookbackWindow (37-118)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx (3)
apps/dashboard/src/components/workflow-editor/steps/save-form-context.ts (1)
  • useSaveForm (9-9)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts (2)
  • LOOKBACK_AMOUNT_KEY (5-5)
  • LOOKBACK_UNIT_KEY (6-6)
apps/dashboard/src/components/workflow-editor/steps/time-units.ts (1)
  • TIME_UNIT_OPTIONS (3-28)
⏰ 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). (6)
  • GitHub Check: E2E test API / Test E2E
  • GitHub Check: Redirect rules - dashboard-v2-novu-staging
  • GitHub Check: Header rules - dashboard-v2-novu-staging
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Pages changed - dashboard-v2-novu-staging
🔇 Additional comments (6)
apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/keys.ts (1)

5-6: LGTM!

The new keys follow the existing naming convention and path structure pattern established by the other keys in this file.

apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/lookback-window.tsx (3)

1-19: LGTM!

Imports are well-organized, and the type definition follows the frontend coding guideline of preferring types over interfaces.


21-35: LGTM!

The deriveLookbackType helper is a clean pure function that correctly maps form state to preset options.


100-115: LGTM!

The conditional rendering for custom input is clean and follows the same pattern as RegularType for the AmountInput configuration.

apps/dashboard/src/components/workflow-editor/steps/digest-delay-tabs/digest-delay-tabs.tsx (2)

11-11: LGTM!

Import correctly references the new LookbackWindow component.


140-150: LGTM!

The integration cleanly adds the LookbackWindow component with appropriate conditional rendering for digest mode and a visual separator.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@scopsy scopsy merged commit 765acb4 into next Jan 14, 2026
29 checks passed
@scopsy scopsy deleted the nv-7002-back-off-strategy-digest-in-new-dashboard branch January 14, 2026 14:42
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.

1 participant