Skip to content

Conversation

@sbansal1999
Copy link
Contributor

@sbansal1999 sbansal1999 commented Jan 3, 2026

Description

The time shown earlier was not in user's timezone.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Expanded activity details now include response metrics and probe info: total response time, HTTP status code, probe region and IP (when available), plus error details.
  • Improvements

    • Timestamps are converted and displayed in your local timezone for clearer, context-aware activity times.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 3, 2026

@sbansal1999 is attempting to deploy a commit to the Databuddy OSS Team on Vercel.

A member of the Team first needs to authorize it.

@sbansal1999 sbansal1999 changed the base branch from main to staging January 3, 2026 18:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Walkthrough

Updated recent-activity component to parse timestamps as UTC and convert to the viewer’s local timezone using dayjs utc/timezone plugins; also extended the Check type with timing, HTTP response, probe metadata, and optional error fields.

Changes

Cohort / File(s) Summary
Timestamp & Type Enhancement
apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
Added and extended dayjs with utc and timezone plugins; introduced userTimezone = dayjs.tz.guess() and changed timestamp rendering to dayjs.utc(check.timestamp).tz(userTimezone).format("MMM D, HH:mm:ss"); expanded Check type with total_ms, http_code, probe_region, optional probe_ip, and optional error fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting timestamp display from previous timezone to user's timezone in the uptime table.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@sbansal1999 sbansal1999 changed the title fix: Use user timezone's time in uptime table. fix: Use user's timezone time in uptime table. Jan 3, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 3, 2026

Greptile Summary

Fixed timezone display issue in the uptime monitoring table by converting UTC timestamps to the user's local timezone.

Changes

  • Added dayjs/plugin/timezone and dayjs/plugin/utc imports
  • Extended dayjs with timezone and UTC plugins
  • Changed timestamp formatting from dayjs(check.timestamp) to dayjs.utc(check.timestamp).tz(dayjs.tz.guess())

This ensures users see check timestamps in their local timezone rather than UTC, improving the user experience by displaying times in a familiar format.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple, focused change that adds proper timezone handling using dayjs plugins. The implementation follows established patterns in the codebase and only affects timestamp display formatting without changing any business logic or data flow.
  • No files require special attention

Important Files Changed

Filename Overview
apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx Added timezone plugins and converted UTC timestamps to user's local timezone for display

Sequence Diagram

sequenceDiagram
    participant Browser
    participant RecentActivity
    participant DayJS
    participant IntlAPI as Intl API
    
    Browser->>RecentActivity: Render with checks data
    Note over RecentActivity: check.timestamp (UTC string)
    
    RecentActivity->>DayJS: dayjs.utc(check.timestamp)
    DayJS-->>RecentActivity: UTC dayjs object
    
    RecentActivity->>IntlAPI: dayjs.tz.guess()
    IntlAPI-->>RecentActivity: User's timezone (e.g., "America/New_York")
    
    RecentActivity->>DayJS: .tz(userTimezone)
    DayJS-->>RecentActivity: Converted to user timezone
    
    RecentActivity->>DayJS: .format("MMM D, HH:mm:ss")
    DayJS-->>RecentActivity: Formatted local time string
    
    RecentActivity->>Browser: Display timestamp in user's timezone
Loading

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

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 718f7c0 and 68f13fe.

📒 Files selected for processing (1)
  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx,js,jsx,vue}

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

**/*.{ts,tsx,js,jsx,vue}: Never block paste in <input> or <textarea> elements
Enter submits focused text input; in <textarea>, ⌘/Ctrl+Enter submits; Enter adds newline
Compatible with password managers and 2FA; allow pasting one-time codes

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{html,htm,tsx,jsx,vue}

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

**/*.{html,htm,tsx,jsx,vue}: Use autocomplete attribute with meaningful name; use correct type and inputmode
Disable spellcheck for email/code/username inputs using spellcheck="false"
Links are <a> or <Link> components for navigation; support Cmd/Ctrl/middle-click
Use polite aria-live for toasts and inline validation feedback
Autofocus on desktop when there's a single primary input; rarely on mobile to avoid layout shift
<title> tag must match current context
Use redundant status cues (not color-only); icon-only elements have text labels
Use accurate accessible names via aria-label; mark decorative elements with aria-hidden; verify in Accessibility Tree
Icon-only buttons must have descriptive aria-label
Prefer native semantics (button, a, label, table) before ARIA
Use non-breaking spaces to glue terms: 10&nbsp;MB, ⌘&nbsp;+&nbsp;K, Vercel&nbsp;SDK
Preload only above-the-fold images; lazy-load the rest

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,js,jsx}

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

**/*.{ts,tsx,js,jsx}: Trim values to handle text expansion and trailing spaces in form submissions
URL reflects state (deep-link filters/tabs/pagination/expanded panels); prefer libraries like nuqs
Back/Forward buttons restore scroll position
Delay first tooltip in a group; subsequent peers have no delay
Use locale-aware formatting for dates, times, numbers, and currency
Batch layout reads/writes; avoid unnecessary reflows/repaints
Virtualize large lists using libraries like virtua

**/*.{ts,tsx,js,jsx}: Don't use accessKey attribute on any HTML element.
Don't set aria-hidden="true" on focusable elements.
Don't add ARIA roles, states, and properties to elements that don't support them.
Don't use distracting elements like <marquee> or <blink>.
Only use the scope prop on <th> elements.
Don't assign non-interactive ARIA roles to interactive HTML elements.
Make sure label elements have text content and are associated with an input.
Don't assign interactive ARIA roles to non-interactive HTML elements.
Don't assign tabIndex to non-interactive HTML elements.
Don't use positive integers for tabIndex property.
Don't include "image", "picture", or "photo" in img alt prop.
Don't use explicit role property that's the same as the implicit/default role.
Make static elements with click handlers use a valid role attribute.
Always include a title element for SVG elements.
Give all elements requiring alt text meaningful information for screen readers.
Make sure anchors have content that's accessible to screen readers.
Assign tabIndex to non-interactive HTML elements with aria-activedescendant.
Include all required ARIA attributes for elements with ARIA roles.
Make sure ARIA properties are valid for the element's supported roles.
Always include a type attribute for button elements.
Make elements with interactive roles and handlers focusable.
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden).
Always include...

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{css,scss,sass,less,html,htm,tsx,jsx,vue}

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

**/*.{css,scss,sass,less,html,htm,tsx,jsx,vue}: No dead zones on checkboxes/radios; label and control share one generous hit target
Use scroll-margin-top on headings for anchored links; include 'Skip to content' link; use hierarchical <h1>–<h6>
Prevent Cumulative Layout Shift (CLS) from images by using explicit dimensions or reserved space

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,js,jsx,css,scss,sass,less}

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

**/*.{ts,tsx,js,jsx,css,scss,sass,less}: During drag operations, disable text selection and set inert on dragged element and containers
Animations must be interruptible and input-driven; avoid autoplay

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{tsx,jsx,vue}

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

Don't ship the schema—visuals may omit labels but accessible names must still exist

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{tsx,jsx}

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

Prefer uncontrolled inputs; make controlled loops cheap (optimize keystroke cost)

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,jsx}

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

**/*.{ts,tsx,jsx}: Use semantic elements instead of role attributes in JSX.
Don't use unnecessary fragments.
Don't pass children as props.
Don't use the return value of React.render.
Make sure all dependencies are correctly specified in React hooks.
Make sure all React hooks are called from the top level of component functions.
Don't forget key props in iterators and collection literals.
Don't destructure props inside JSX components in Solid projects.
Don't define React components inside other components.
Don't use event handlers on non-interactive elements.
Don't assign to React component props.
Don't use both children and dangerouslySetInnerHTML props on the same element.
Don't use dangerous JSX props.
Don't use Array index in keys.
Don't insert comments as text nodes.
Don't assign JSX properties multiple times.
Don't add extra closing tags for components without children.
Use <>...</> instead of <Fragment>...</Fragment>.
Watch out for possible "wrong" semicolons inside JSX elements.
Make sure void (self-closing) elements don't have children.
Don't use target="_blank" without rel="noopener".
Don't use <img> elements in Next.js projects.
Don't use <head> elements in Next.js projects.

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx}

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

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types.
Don't use empty type parameters in type aliases and interfaces.
Don't use any or unknown as type constraints.
Don't return a value from a function with the return type 'void'.
Don't use the TypeScript directive @ts-ignore.
Don't use TypeScript enums.
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.
Don't use TypeScript namespaces.
Don't use non-null assertions with the ! postfix operator.
Don't use parameter properties in class constructors.
Don't use user-defined types.
Use as const instead of literal types and type annotations.
Use either T[] or Array<T> consistently.
Initialize each enum member value explicitly.
Use export type for types.
Use import type for types.
Make sure all enum members are literal values.
Don't use TypeScript const enum.
Don't declare empty interfaces.
Don't let variables evolve into any type through reassignments.
Don't use the any type.
Don't misuse the non-null assertion operator (!) in TypeScript files.
Don't use implicit any type on variable declarations.
Don't merge interfaces and classes unsafely.
Don't use overload signatures that aren't next to each other.
Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.
Use consistent accessibility modifiers on class properties and methods.
Use function types instead of object types with call signatures.
Don't use void type outside of generic or return types.

**/*.{ts,tsx}: Do NOT use types 'any', 'unknown' or 'never'. Use proper explicit types
Suffix functions with 'Action' in types, like 'type Test = { testAction }'

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
!(**/pages/_document.{ts,tsx,jsx})**/*.{ts,tsx,jsx}

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

Don't import next/document outside of pages/_document.jsx in Next.js projects.

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,html,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file.html|file.ts|file.css> instead of webpack or esbuild for bundling

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-MUST-DO.mdc)

**/*.{jsx,tsx}: When using 'text-right' utility class, always add 'text-balance' to prevent poor text layout
Think about mobile responsiveness when doing any UI tasks or changes
Always use 'rounded' Tailwind class, never 'rounded-xl' or 'rounded-md'
Don't use lucide for icons, ONLY use phosphor icons. Use width='duotone' for most icons, use fill for arrows, and don't add width attribute for plus icons
Decouple state management, data transformations, and API interactions from the React lifecycle in View Components
Simplify data flow to eliminate prop drilling and callback hell in components
Prioritize modularity and testability in all components
ALWAYS use error boundaries properly in React applications
Use 'Icon' suffix at the end of phosphor react icon imports, like CaretIcon not Caret. This is the default import, NOT as a named import
Almost NEVER use useEffect unless it's critical

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-MUST-DO.mdc)

**/*.{js,jsx,ts,tsx}: Split off components, utils, and reusable code to ensure better loading speed and less complexity
Use lower-case-like-this naming convention for variables, functions, and identifiers
NEVER add placeholders, mock data, or anything similar to production code
Use Dayjs for date handling, NEVER use date-fns. Use Tanstack query for hooks, NEVER use SWR
Use json.stringify() when adding debugging code
Never use barrel exports or create index files

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/01-MUST-DO.mdc:0-0
Timestamp: 2025-12-25T14:32:46.935Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use Dayjs for date handling, NEVER use date-fns. Use Tanstack query for hooks, NEVER use SWR
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-02T22:57:07.791Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Date.now() to get milliseconds since the Unix Epoch.
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/guidelines.mdc:0-0
Timestamp: 2025-12-02T22:55:00.415Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use locale-aware formatting for dates, times, numbers, and currency
📚 Learning: 2025-12-25T14:32:46.935Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/01-MUST-DO.mdc:0-0
Timestamp: 2025-12-25T14:32:46.935Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use Dayjs for date handling, NEVER use date-fns. Use Tanstack query for hooks, NEVER use SWR

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-02T22:57:07.791Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-02T22:57:07.791Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Date.now() to get milliseconds since the Unix Epoch.

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-02T22:55:00.415Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/guidelines.mdc:0-0
Timestamp: 2025-12-02T22:55:00.415Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use locale-aware formatting for dates, times, numbers, and currency

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-25T14:32:46.935Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/01-MUST-DO.mdc:0-0
Timestamp: 2025-12-25T14:32:46.935Z
Learning: Applies to **/*.{jsx,tsx} : Use 'Icon' suffix at the end of phosphor react icon imports, like CaretIcon not Caret. This is the default import, NOT as a named import

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🔇 Additional comments (2)
apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx (2)

9-10: LGTM! Correct dayjs plugin imports.

The timezone and UTC plugin imports are appropriate for implementing user timezone conversion.


22-23: LGTM! Proper dayjs plugin initialization.

The plugins are correctly extended at the module level, and the order is appropriate (UTC before timezone).

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

♻️ Duplicate comments (1)
apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx (1)

133-136: Address locale-aware formatting requirement.

The hardcoded format string "MMM D, HH:mm:ss" doesn't respect user locale preferences. Per coding guidelines, date and time formatting should be locale-aware.

Consider configuring dayjs with the user's locale and using localized format tokens, or use Intl.DateTimeFormat for locale-aware formatting.

🔎 Proposed fix using Intl.DateTimeFormat
 <TableCell className="text-center text-muted-foreground text-xs">
-	{dayjs
-		.utc(check.timestamp)
-		.tz(userTimezone)
-		.format("MMM D, HH:mm:ss")}
+	{new Intl.DateTimeFormat(undefined, {
+		month: "short",
+		day: "numeric",
+		hour: "2-digit",
+		minute: "2-digit",
+		second: "2-digit",
+		timeZone: userTimezone,
+	}).format(new Date(check.timestamp))}
 </TableCell>

Based on coding guidelines and previous review feedback.

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68f13fe and 753fb2a.

📒 Files selected for processing (1)
  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx,js,jsx,vue}

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

**/*.{ts,tsx,js,jsx,vue}: Never block paste in <input> or <textarea> elements
Enter submits focused text input; in <textarea>, ⌘/Ctrl+Enter submits; Enter adds newline
Compatible with password managers and 2FA; allow pasting one-time codes

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{html,htm,tsx,jsx,vue}

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

**/*.{html,htm,tsx,jsx,vue}: Use autocomplete attribute with meaningful name; use correct type and inputmode
Disable spellcheck for email/code/username inputs using spellcheck="false"
Links are <a> or <Link> components for navigation; support Cmd/Ctrl/middle-click
Use polite aria-live for toasts and inline validation feedback
Autofocus on desktop when there's a single primary input; rarely on mobile to avoid layout shift
<title> tag must match current context
Use redundant status cues (not color-only); icon-only elements have text labels
Use accurate accessible names via aria-label; mark decorative elements with aria-hidden; verify in Accessibility Tree
Icon-only buttons must have descriptive aria-label
Prefer native semantics (button, a, label, table) before ARIA
Use non-breaking spaces to glue terms: 10&nbsp;MB, ⌘&nbsp;+&nbsp;K, Vercel&nbsp;SDK
Preload only above-the-fold images; lazy-load the rest

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,js,jsx}

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

**/*.{ts,tsx,js,jsx}: Trim values to handle text expansion and trailing spaces in form submissions
URL reflects state (deep-link filters/tabs/pagination/expanded panels); prefer libraries like nuqs
Back/Forward buttons restore scroll position
Delay first tooltip in a group; subsequent peers have no delay
Use locale-aware formatting for dates, times, numbers, and currency
Batch layout reads/writes; avoid unnecessary reflows/repaints
Virtualize large lists using libraries like virtua

**/*.{ts,tsx,js,jsx}: Don't use accessKey attribute on any HTML element.
Don't set aria-hidden="true" on focusable elements.
Don't add ARIA roles, states, and properties to elements that don't support them.
Don't use distracting elements like <marquee> or <blink>.
Only use the scope prop on <th> elements.
Don't assign non-interactive ARIA roles to interactive HTML elements.
Make sure label elements have text content and are associated with an input.
Don't assign interactive ARIA roles to non-interactive HTML elements.
Don't assign tabIndex to non-interactive HTML elements.
Don't use positive integers for tabIndex property.
Don't include "image", "picture", or "photo" in img alt prop.
Don't use explicit role property that's the same as the implicit/default role.
Make static elements with click handlers use a valid role attribute.
Always include a title element for SVG elements.
Give all elements requiring alt text meaningful information for screen readers.
Make sure anchors have content that's accessible to screen readers.
Assign tabIndex to non-interactive HTML elements with aria-activedescendant.
Include all required ARIA attributes for elements with ARIA roles.
Make sure ARIA properties are valid for the element's supported roles.
Always include a type attribute for button elements.
Make elements with interactive roles and handlers focusable.
Give heading elements content that's accessible to screen readers (not hidden with aria-hidden).
Always include...

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{css,scss,sass,less,html,htm,tsx,jsx,vue}

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

**/*.{css,scss,sass,less,html,htm,tsx,jsx,vue}: No dead zones on checkboxes/radios; label and control share one generous hit target
Use scroll-margin-top on headings for anchored links; include 'Skip to content' link; use hierarchical <h1>–<h6>
Prevent Cumulative Layout Shift (CLS) from images by using explicit dimensions or reserved space

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,js,jsx,css,scss,sass,less}

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

**/*.{ts,tsx,js,jsx,css,scss,sass,less}: During drag operations, disable text selection and set inert on dragged element and containers
Animations must be interruptible and input-driven; avoid autoplay

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{tsx,jsx,vue}

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

Don't ship the schema—visuals may omit labels but accessible names must still exist

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{tsx,jsx}

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

Prefer uncontrolled inputs; make controlled loops cheap (optimize keystroke cost)

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,jsx}

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

**/*.{ts,tsx,jsx}: Use semantic elements instead of role attributes in JSX.
Don't use unnecessary fragments.
Don't pass children as props.
Don't use the return value of React.render.
Make sure all dependencies are correctly specified in React hooks.
Make sure all React hooks are called from the top level of component functions.
Don't forget key props in iterators and collection literals.
Don't destructure props inside JSX components in Solid projects.
Don't define React components inside other components.
Don't use event handlers on non-interactive elements.
Don't assign to React component props.
Don't use both children and dangerouslySetInnerHTML props on the same element.
Don't use dangerous JSX props.
Don't use Array index in keys.
Don't insert comments as text nodes.
Don't assign JSX properties multiple times.
Don't add extra closing tags for components without children.
Use <>...</> instead of <Fragment>...</Fragment>.
Watch out for possible "wrong" semicolons inside JSX elements.
Make sure void (self-closing) elements don't have children.
Don't use target="_blank" without rel="noopener".
Don't use <img> elements in Next.js projects.
Don't use <head> elements in Next.js projects.

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx}

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

**/*.{ts,tsx}: Don't use primitive type aliases or misleading types.
Don't use empty type parameters in type aliases and interfaces.
Don't use any or unknown as type constraints.
Don't return a value from a function with the return type 'void'.
Don't use the TypeScript directive @ts-ignore.
Don't use TypeScript enums.
Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.
Don't use TypeScript namespaces.
Don't use non-null assertions with the ! postfix operator.
Don't use parameter properties in class constructors.
Don't use user-defined types.
Use as const instead of literal types and type annotations.
Use either T[] or Array<T> consistently.
Initialize each enum member value explicitly.
Use export type for types.
Use import type for types.
Make sure all enum members are literal values.
Don't use TypeScript const enum.
Don't declare empty interfaces.
Don't let variables evolve into any type through reassignments.
Don't use the any type.
Don't misuse the non-null assertion operator (!) in TypeScript files.
Don't use implicit any type on variable declarations.
Don't merge interfaces and classes unsafely.
Don't use overload signatures that aren't next to each other.
Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.
Use consistent accessibility modifiers on class properties and methods.
Use function types instead of object types with call signatures.
Don't use void type outside of generic or return types.

**/*.{ts,tsx}: Do NOT use types 'any', 'unknown' or 'never'. Use proper explicit types
Suffix functions with 'Action' in types, like 'type Test = { testAction }'

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
!(**/pages/_document.{ts,tsx,jsx})**/*.{ts,tsx,jsx}

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

Don't import next/document outside of pages/_document.jsx in Next.js projects.

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{ts,tsx,html,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file.html|file.ts|file.css> instead of webpack or esbuild for bundling

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-MUST-DO.mdc)

**/*.{jsx,tsx}: When using 'text-right' utility class, always add 'text-balance' to prevent poor text layout
Think about mobile responsiveness when doing any UI tasks or changes
Always use 'rounded' Tailwind class, never 'rounded-xl' or 'rounded-md'
Don't use lucide for icons, ONLY use phosphor icons. Use width='duotone' for most icons, use fill for arrows, and don't add width attribute for plus icons
Decouple state management, data transformations, and API interactions from the React lifecycle in View Components
Simplify data flow to eliminate prop drilling and callback hell in components
Prioritize modularity and testability in all components
ALWAYS use error boundaries properly in React applications
Use 'Icon' suffix at the end of phosphor react icon imports, like CaretIcon not Caret. This is the default import, NOT as a named import
Almost NEVER use useEffect unless it's critical

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-MUST-DO.mdc)

**/*.{js,jsx,ts,tsx}: Split off components, utils, and reusable code to ensure better loading speed and less complexity
Use lower-case-like-this naming convention for variables, functions, and identifiers
NEVER add placeholders, mock data, or anything similar to production code
Use Dayjs for date handling, NEVER use date-fns. Use Tanstack query for hooks, NEVER use SWR
Use json.stringify() when adding debugging code
Never use barrel exports or create index files

Files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🧠 Learnings (4)
📚 Learning: 2025-12-25T14:32:46.935Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/01-MUST-DO.mdc:0-0
Timestamp: 2025-12-25T14:32:46.935Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use Dayjs for date handling, NEVER use date-fns. Use Tanstack query for hooks, NEVER use SWR

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-02T22:57:07.791Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/ultracite.mdc:0-0
Timestamp: 2025-12-02T22:57:07.791Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Date.now() to get milliseconds since the Unix Epoch.

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-02T22:55:00.415Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/guidelines.mdc:0-0
Timestamp: 2025-12-02T22:55:00.415Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use locale-aware formatting for dates, times, numbers, and currency

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
📚 Learning: 2025-12-25T14:32:46.935Z
Learnt from: CR
Repo: databuddy-analytics/Databuddy PR: 0
File: .cursor/rules/01-MUST-DO.mdc:0-0
Timestamp: 2025-12-25T14:32:46.935Z
Learning: Applies to **/*.{jsx,tsx} : Use 'Icon' suffix at the end of phosphor react icon imports, like CaretIcon not Caret. This is the default import, NOT as a named import

Applied to files:

  • apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
🔇 Additional comments (2)
apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx (2)

9-10: LGTM! Correct dayjs plugin imports.

The timezone and utc plugin imports are correct and necessary for timezone conversion functionality.


27-35: LGTM! Type definition properly extended.

The Check type correctly includes all necessary fields with explicit types and appropriate optional markers.

Comment on lines +22 to +25
dayjs.extend(utc);
dayjs.extend(timezone);

const userTimezone = dayjs.tz.guess();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Module-level timezone computation breaks SSR and defeats the PR's purpose.

Computing userTimezone at module level causes it to run during server-side rendering or at build time, capturing the server's timezone instead of the user's. This directly contradicts the PR objective of using the user's timezone.

Move the timezone computation inside the component function to ensure it executes client-side:

🔎 Proposed fix
 dayjs.extend(utc);
 dayjs.extend(timezone);
-
-const userTimezone = dayjs.tz.guess();
-
 type Check = {
 	timestamp: string;
 export function RecentActivity({ checks, isLoading }: RecentActivityProps) {
+	const userTimezone = dayjs.tz.guess();
+
 	if (isLoading) {
 		return (
🤖 Prompt for AI Agents
In apps/dashboard/app/(main)/websites/[id]/pulse/_components/recent-activity.tsx
around lines 22–25, computing userTimezone at module scope causes the timezone
to be resolved during SSR/build (server timezone) instead of per-user; remove
the module-level const userTimezone and instead compute the timezone inside the
React component at runtime on the client (e.g., use a useState + useEffect to
call dayjs.tz.guess() and set it, or mark the file "use client" and call
dayjs.tz.guess() directly in the component body), while keeping
dayjs.extend(utc) and dayjs.extend(timezone) at module level if desired.

@sbansal1999
Copy link
Contributor Author

Closing this one, as I feel a server side change can fix this in a better way.

@sbansal1999 sbansal1999 closed this Jan 3, 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