Skip to content

Top Rep categories on profile hover-card#1625

Merged
ragnep merged 11 commits intomainfrom
hover-card-rep-categories
Dec 8, 2025
Merged

Top Rep categories on profile hover-card#1625
ragnep merged 11 commits intomainfrom
hover-card-rep-categories

Conversation

@ragnep
Copy link
Copy Markdown
Contributor

@ragnep ragnep commented Dec 2, 2025

Summary by CodeRabbit

  • New Features

    • Added "Top Rep" to profile tooltips and size variants for user stats rows; introduced a reusable notification header and a wave navigation helper.
  • Style

    • Standardized author display, follow button placement and spacing; adjusted small follow button sizing, search close-button border, and profile bio truncation.
  • Refactor

    • M moved notification header above drop content across notification types for a consistent layout.
  • Tests

    • Updated mocks and image assertions to match the new header/layout composition.

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

Signed-off-by: ragnep <ragneinfo@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 2, 2025

Walkthrough

Refactors notification items to render a new NotificationHeader component, centralizes wave navigation via a new useWaveNavigation hook, adds UserProfileTooltipTopRep, introduces size support for UserStatsRow, tweaks small UI classes, and updates tests/mocks. No public API removals; two new components and one new hook added.

Changes

Cohort / File(s) Summary
Notification header refactor
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx, components/brain/notifications/drop-reacted/NotificationDropReacted.tsx, components/brain/notifications/drop-replied/NotificationDropReplied.tsx, components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx, components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx, components/brain/notifications/wave-created/NotificationWaveCreated.tsx
Replaced inline avatar/author blocks with NotificationHeader; moved follow/wave actions into header actions prop; removed duplicated Link/tooltip/avatar logic; replaced router-based navigation with useWaveNavigation handlers; composed header above Drop content.
New NotificationHeader component
components/brain/notifications/subcomponents/NotificationHeader.tsx
Added NotificationHeader (default export) that renders avatar, linked handle (with tooltip wrapper), optional children, and optional actions slot; local NotificationHeaderProps interface provided.
Navigation utilities / hook
components/brain/notifications/utils/navigationUtils.ts
Added getIsDirectMessage(wave, fallback) and useWaveNavigation() which exposes navigateToWave(waveId, serialNo, isDirectMessage) and createQuoteClickHandler(fallbackIsDm?); uses router and device info to build/push wave routes.
Profile tooltip + top rep
components/user/utils/profile/UserProfileTooltip.tsx, components/user/utils/profile/UserProfileTooltipTopRep.tsx
UserProfileTooltip now uses UserCICAndLevel, fetches profile rep rates, and renders new UserProfileTooltipTopRep (default export) which selects/sorts top 3 rep categories and formats ratings.
User stats sizing
components/user/utils/stats/UserStatsRow.tsx
Added public enum UserStatsRowSize and size?: UserStatsRowSize prop (default MEDIUM); applied SIZE_CLASSES mapping to stat label classes for size-based styling.
Small UI class tweaks
components/user/utils/UserFollowBtn.tsx, components/user/utils/UserCICAndLevel.tsx, components/header/header-search/HeaderSearchModal.tsx
Adjusted SMALL follow button padding classes, changed MEDIUM CIC top offset, and added tw-border-solid to Close Search button classes.
Tests updated / mocks added
__tests__/components/brain/notifications/NotificationWaveCreated.test.tsx, __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx, __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx, __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
Updated image src assertion to use containment; added mocks for NotificationHeader, NotificationsFollowBtn, and useDeviceInfo to isolate components in tests; adjusted other test mocks accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant Notif as Notification component
  participant Header as NotificationHeader
  participant Hook as useWaveNavigation
  participant Router as NextRouter

  Notif->>Header: render(author, children, actions)
  Header-->>Notif: user invokes action (reply / quote / follow)
  Notif->>Hook: call navigateToWave(waveId, serialNo, isDirectMessage)
  Hook->>Router: router.push(getWaveRoute(..., isDirectMessage, isApp))
  Router-->>Hook: route change completes
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay special attention to:
    • NotificationHeader: avatar fallback, tooltip link behavior, responsive layout.
    • useWaveNavigation: isApp detection, getWaveRoute arguments, createQuoteClickHandler correctness.
    • UserProfileTooltipTopRep: sorting and number formatting correctness.
    • UserStatsRow size mapping: verify downstream consumers handle new size prop.
    • Test mocks: ensure they reflect production behavior for device context and header usage.

Possibly related PRs

Suggested reviewers

  • prxt6529
  • simo6529

Poem

🐰 I hopped in with a tidy head,

moved avatars to a brand-new bed.
Headers hum and routes now steer,
top rep twinkles, stats shrink or cheer.
A carrot nod — code freshly fed!

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 PR title 'Top Rep categories on profile hover-card' accurately describes the primary change: adding top reputation categories to the profile tooltip/hover-card component.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hover-card-rep-categories

📜 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 0d11560 and 846f5c4.

📒 Files selected for processing (1)
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/brain/notifications/drop-replied/NotificationDropReplied.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). (1)
  • GitHub Check: Analyze (javascript-typescript)

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
Copy Markdown

@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: 5

Caution

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

⚠️ Outside diff range comments (1)
components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx (1)

20-31: Replace <img> with Next.js <Image> component.

The avatar rendering uses an HTML <img> tag instead of the Next.js <Image> component, violating coding guidelines.

As per coding guidelines:

+import Image from "next/image";
+
-        {notification.related_identity.pfp ? (
-          <img
-            src={getScaledImageUri(
-              notification.related_identity.pfp,
-              ImageScale.W_AUTO_H_50
-            )}
-            alt="#"
-            className="tw-flex-shrink-0 tw-object-contain tw-h-full tw-w-full tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700"
-          />
-        ) : (
-          <div className="tw-flex-shrink-0 tw-object-contain tw-h-full tw-w-full tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700" />
-        )}
+        {notification.related_identity.pfp ? (
+          <Image
+            src={getScaledImageUri(
+              notification.related_identity.pfp,
+              ImageScale.W_AUTO_H_50
+            )}
+            alt={notification.related_identity.handle ?? "User avatar"}
+            width={28}
+            height={28}
+            className="tw-flex-shrink-0 tw-object-contain tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700"
+          />
+        ) : (
+          <div className="tw-flex-shrink-0 tw-h-7 tw-w-7 tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700" />
+        )}
🧹 Nitpick comments (1)
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (1)

65-131: Consider extracting avatar rendering into a reusable component.

The avatar rendering pattern (lines 69-81) is duplicated across multiple notification components in this PR (NotificationDropQuoted, NotificationDropReacted, NotificationDropReplied, NotificationIdentitySubscribed). Consider extracting this into a shared NotificationAvatar component to reduce duplication and improve maintainability.

Example structure:

interface NotificationAvatarProps {
  readonly pfp: string | null;
  readonly handle: string | null;
}

function NotificationAvatar({ pfp, handle }: NotificationAvatarProps) {
  return (
    <div className="tw-h-7 tw-w-7 tw-flex-shrink-0">
      {pfp ? (
        <Image
          src={getScaledImageUri(pfp, ImageScale.W_AUTO_H_50)}
          alt={handle ?? "User avatar"}
          width={28}
          height={28}
          className="tw-flex-shrink-0 tw-object-contain tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700"
        />
      ) : (
        <div className="tw-flex-shrink-0 tw-h-7 tw-w-7 tw-rounded-md tw-bg-iron-800 tw-ring-1 tw-ring-iron-700" />
      )}
    </div>
  );
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f51d9c and ec6a5e8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (2 hunks)
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1 hunks)
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx (2 hunks)
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (2 hunks)
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx (3 hunks)
  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx (3 hunks)
  • components/header/header-search/HeaderSearchModal.tsx (1 hunks)
  • components/user/utils/UserCICAndLevel.tsx (1 hunks)
  • components/user/utils/UserFollowBtn.tsx (1 hunks)
  • components/user/utils/profile/UserProfileTooltip.tsx (4 hunks)
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed since main via npm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) via npm run lint
Use <Link> from Next.js for internal navigation instead of <a> tags or HTML anchors
Use <Image> from next/image instead of HTML <img> elements

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/user/utils/UserFollowBtn.tsx
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx
  • components/user/utils/profile/UserProfileTooltip.tsx
  • components/header/header-search/HeaderSearchModal.tsx
  • components/user/utils/UserCICAndLevel.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/user/utils/UserFollowBtn.tsx
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx
  • components/user/utils/profile/UserProfileTooltip.tsx
  • components/header/header-search/HeaderSearchModal.tsx
  • components/user/utils/UserCICAndLevel.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: All code must pass TypeScript type checking via npm run type-check (tsc --noEmit)
Use 'use cache' directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/user/utils/UserFollowBtn.tsx
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx
  • components/user/utils/profile/UserProfileTooltip.tsx
  • components/header/header-search/HeaderSearchModal.tsx
  • components/user/utils/UserCICAndLevel.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
🧠 Learnings (2)
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Link>` from Next.js for internal navigation instead of `<a>` tags or HTML anchors

Applied to files:

  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Image>` from `next/image` instead of HTML `<img>` elements

Applied to files:

  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
🧬 Code graph analysis (8)
components/brain/notifications/wave-created/NotificationWaveCreated.tsx (2)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/utils/tooltip/UserProfileTooltipWrapper.tsx (1)
  • UserProfileTooltipWrapper (12-34)
components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (1)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/user/utils/profile/UserProfileTooltipTopRep.tsx (2)
entities/IProfile.ts (1)
  • ApiProfileRepRatesState (327-333)
helpers/Helpers.ts (1)
  • formatNumberWithCommas (102-119)
components/user/utils/profile/UserProfileTooltip.tsx (4)
entities/IProfile.ts (1)
  • ApiProfileRepRatesState (327-333)
components/user/utils/UserCICAndLevel.tsx (1)
  • UserCICAndLevel (11-45)
helpers/Helpers.ts (1)
  • cicToType (485-503)
components/user/utils/profile/UserProfileTooltipTopRep.tsx (1)
  • UserProfileTooltipTopRep (7-52)
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (5)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/utils/tooltip/UserProfileTooltipWrapper.tsx (1)
  • UserProfileTooltipWrapper (12-34)
helpers/Helpers.ts (1)
  • getTimeAgoShort (563-589)
components/waves/drops/Drop.tsx (1)
  • Drop (41-119)
helpers/waves/drop.helpers.ts (1)
  • Drop (14-14)
components/brain/notifications/drop-replied/NotificationDropReplied.tsx (1)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx (1)
components/utils/tooltip/UserProfileTooltipWrapper.tsx (1)
  • UserProfileTooltipWrapper (12-34)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (10)
components/header/header-search/HeaderSearchModal.tsx (1)

933-933: LGTM! Minor styling improvement.

The addition of tw-border-solid makes the border style explicit and aligns with best practices for clarity.

components/user/utils/UserFollowBtn.tsx (1)

30-30: LGTM! Button sizing adjustment aligns with layout updates.

The increased padding for the SMALL button size is consistent with the updated notification header layouts where follow buttons are now inline with author information.

components/user/utils/UserCICAndLevel.tsx (1)

31-31: LGTM! Positioning adjustment improves visual alignment.

The updated vertical positioning for the MEDIUM size CIC indicator improves alignment with the level badge.

components/user/utils/profile/UserProfileTooltipTopRep.tsx (1)

40-46: No changes needed—the color classes are properly defined.

The custom color classes tw-text-green and tw-text-red are correctly defined in your Tailwind configuration as root-level colors (green: "#3CCB7F" and red: "#F97066"), which generates the utilities tw-text-green and tw-text-red automatically. This pattern is used consistently throughout the codebase and is valid Tailwind syntax.

components/brain/notifications/wave-created/NotificationWaveCreated.tsx (1)

46-99: Layout restructure looks good.

The refactored layout successfully consolidates the follow buttons into a right-aligned container and integrates the UserProfileTooltipWrapper for enhanced user experience. The responsive breakpoints and spacing are well-structured.

components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (1)

71-112: Layout restructure aligns well with PR objectives.

The header refactoring successfully moves the follow button into the main content flow with proper responsive behavior. The integration of UserProfileTooltipWrapper enhances the user experience.

components/user/utils/profile/UserProfileTooltip.tsx (4)

38-48: New reputation ratings query implemented correctly.

The repRates query follows the established patterns with proper query key structure, error handling via react-query, and appropriate enabling conditions. The endpoint format is consistent with the API structure.


93-124: Layout restructure successfully integrates new components.

The refactored layout effectively incorporates UserCICAndLevel and repositions the follow button while maintaining proper responsive behavior and spacing. The consolidation of CIC and level into a single component improves maintainability.


126-126: Verify the bio truncation reduction is intentional.

The line-clamp has been reduced from 6 lines to 2 lines, which significantly limits the bio text displayed. This might truncate important user information in the tooltip.

Please confirm whether reducing the bio display from 6 lines to 2 lines aligns with the design requirements for the tooltip. This substantial reduction may negatively impact users with longer bio descriptions.


162-162: Top REP component integration looks good.

The UserProfileTooltipTopRep component is properly integrated at the bottom of the tooltip, receiving the repRates data as expected. This aligns with the PR objective of displaying top reputation categories on the profile hover-card.

Comment thread components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx Outdated
Comment thread components/brain/notifications/drop-reacted/NotificationDropReacted.tsx Outdated
Comment thread components/brain/notifications/drop-replied/NotificationDropReplied.tsx Outdated
Comment thread components/brain/notifications/wave-created/NotificationWaveCreated.tsx Outdated
Signed-off-by: ragnep <ragneinfo@gmail.com>
Copy link
Copy Markdown

@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: 2

♻️ Duplicate comments (2)
components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (1)

63-105: Consistent refactoring using NotificationHeader.

The refactoring properly delegates avatar rendering to NotificationHeader and maintains the Drop content below. This resolves the previous review comment about <img> usage since avatar rendering is now centralized.

components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)

164-198: Clean refactoring with NotificationHeader.

The restructuring properly uses NotificationHeader with actionElement as children and delegates avatar rendering to the shared component. The Drop props and handlers are correctly maintained.

🧹 Nitpick comments (3)
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (2)

4-4: Unused import: Link.

The Link import appears to be unused after the refactoring to NotificationHeader. Consider removing it.

-import Link from "next/link";

94-100: Consider using Next.js <Image> for custom emoji.

While less critical than avatar images, the coding guidelines specify using <Image> from next/image instead of HTML <img> elements. Custom emojis could benefit from Next.js image optimization.

+import Image from "next/image";
       emojiNode = (
-        <img
+        <Image
           src={custom.skins[0].src}
           alt={rawId}
+          width={20}
+          height={20}
           className="tw-max-w-5 tw-max-h-5 tw-object-contain"
         />
       );

Note: Ensure the emoji CDN domain is configured in next.config.js remotePatterns.

components/brain/notifications/wave-created/NotificationWaveCreated.tsx (1)

64-68: Consider handling the loading state for wave name.

When wave is loading, the Link renders with a valid href but empty text content. This could briefly show a clickable but empty link.

You could conditionally render the link only when the wave name is available:

-        <Link
-          href={invitationHref}
-          className="tw-text-sm tw-font-medium tw-no-underline tw-text-primary-400 hover:tw-text-primary-300">
-          {wave?.name}
-        </Link>
+        {wave?.name && (
+          <Link
+            href={invitationHref}
+            className="tw-text-sm tw-font-medium tw-no-underline tw-text-primary-400 hover:tw-text-primary-300">
+            {wave.name}
+          </Link>
+        )}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec6a5e8 and ab73ebc.

📒 Files selected for processing (7)
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (3 hunks)
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (3 hunks)
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx (2 hunks)
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (2 hunks)
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx (1 hunks)
  • components/brain/notifications/subcomponents/NotificationHeader.tsx (1 hunks)
  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed since main via npm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) via npm run lint
Use <Link> from Next.js for internal navigation instead of <a> tags or HTML anchors
Use <Image> from next/image instead of HTML <img> elements

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/subcomponents/NotificationHeader.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/subcomponents/NotificationHeader.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: All code must pass TypeScript type checking via npm run type-check (tsc --noEmit)
Use 'use cache' directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16

Files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/subcomponents/NotificationHeader.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
🧠 Learnings (4)
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Image>` from `next/image` instead of HTML `<img>` elements

Applied to files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Link>` from Next.js for internal navigation instead of `<a>` tags or HTML anchors

Applied to files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions; do not add `// eslint-disable` comments unless explicitly instructed

Applied to files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{tsx,jsx} : Use FontAwesome for icons in React components

Applied to files:

  • components/brain/notifications/wave-created/NotificationWaveCreated.tsx
🧬 Code graph analysis (5)
components/brain/notifications/wave-created/NotificationWaveCreated.tsx (3)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (12-49)
components/waves/header/WaveHeaderFollow.tsx (1)
  • WaveHeaderFollow (38-186)
helpers/Helpers.ts (1)
  • getTimeAgoShort (563-589)
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (4)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (12-49)
helpers/Helpers.ts (1)
  • getTimeAgoShort (563-589)
components/waves/drops/Drop.tsx (1)
  • Drop (41-119)
helpers/waves/drop.helpers.ts (1)
  • Drop (14-14)
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (12-49)
components/brain/notifications/subcomponents/NotificationHeader.tsx (3)
generated/models/ApiProfileMin.ts (1)
  • ApiProfileMin (16-133)
helpers/image.helpers.ts (1)
  • getScaledImageUri (17-45)
components/utils/tooltip/UserProfileTooltipWrapper.tsx (1)
  • UserProfileTooltipWrapper (12-34)
components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (3)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (12-49)
helpers/Helpers.ts (1)
  • getTimeAgoShort (563-589)
components/waves/drops/Drop.tsx (1)
  • Drop (41-119)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (3)
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (1)

59-101: Clean refactoring to use NotificationHeader component.

The restructuring to use NotificationHeader with the "quoted you" label and timestamp as children is well-organized. The Drop component receives all necessary props for interaction handling.

components/brain/notifications/identity-subscribed/NotificationIdentitySubscribed.tsx (1)

12-33: Clean refactoring to use NotificationHeader.

The component now uses the shared NotificationHeader with proper props for author, actions, and children content. This aligns well with the other notification components.

components/brain/notifications/wave-created/NotificationWaveCreated.tsx (1)

41-76: Clean refactor to header-centric composition.

The component correctly uses NotificationHeader to consolidate author, content, and actions rendering. The conditional rendering of WaveHeaderFollow when wave is available provides graceful degradation during loading or error states.

Comment thread components/brain/notifications/subcomponents/NotificationHeader.tsx
Comment thread components/brain/notifications/subcomponents/NotificationHeader.tsx
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Copy link
Copy Markdown

@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 (3)
__tests__/components/notifications/NotificationsContext.test.tsx (2)

83-98: Consider removing hardcoded timeout to avoid flaky tests.

The hardcoded 700ms timeout couples the test to internal iOS delay implementation details. If the delay changes, the test becomes brittle or flaky.

Consider alternatives:

  • Mock out the delay mechanism entirely
  • Use a test helper that waits for the actual callback registration
  • Replace time-based waiting with condition-based waiting

Apply this approach to decouple from timing:

-    // Wait for initialization to complete (includes 500ms iOS delay)
-    await act(async () => {
-      await new Promise((r) => setTimeout(r, 700));
-    });
-
-    expect(actionCallback).not.toBeNull();
+    // Wait until callback is registered
+    await act(async () => {
+      while (!actionCallback) {
+        await new Promise((r) => setTimeout(r, 50));
+      }
+    });

5-5: Consider adding type safety to test mocks.

Multiple uses of any type reduce type safety. While common in tests, adding proper types improves maintainability and catches interface changes.

Example for line 86:

import type { ActionPerformed } from '@capacitor/push-notifications';

PushNotifications.addListener.mockImplementation(
  (evt: string, cb: (action: ActionPerformed) => Promise<void>) => {
    if (evt === "pushNotificationActionPerformed") {
      actionCallback = cb;
    }
    return Promise.resolve();
  }
);

Also applies to: 86-86

__tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx (1)

12-15: NotificationHeader mock cleanly isolates the header from navigation behavior

The mock keeps the tests focused on reply/quote navigation while still rendering children and exposing a stable data-testid, which is a good pattern for isolating layout-only subcomponents in this suite. If you later want coverage for the new header integration, you could optionally add a simple assertion that screen.getByTestId('notification-header') is present in one of the existing tests.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe84f2b and 65cc6d1.

📒 Files selected for processing (3)
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx (2 hunks)
  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx (1 hunks)
  • __tests__/components/notifications/NotificationsContext.test.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Enforce ≥ 80% line coverage for files changed since main via npm run test
All code must pass ESLint (Next's Core Web Vitals + React Hooks rules) via npm run lint
Use <Link> from Next.js for internal navigation instead of <a> tags or HTML anchors
Use <Image> from next/image instead of HTML <img> elements

Files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
  • __tests__/components/notifications/NotificationsContext.test.tsx
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
  • __tests__/components/notifications/NotificationsContext.test.tsx
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: All code must pass TypeScript type checking via npm run type-check (tsc --noEmit)
Use 'use cache' directive at the top of Server Components or functions to explicitly opt-in to caching in Next.js 16

Files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
  • __tests__/components/notifications/NotificationsContext.test.tsx
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx
**/__tests__/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Tests should live in __tests__/ directory or be named ComponentName.test.tsx

Files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
  • __tests__/components/notifications/NotificationsContext.test.tsx
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx
🧠 Learnings (5)
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Applies to __tests__/**/__tests__/**/*.{ts,tsx,js,jsx} : Give each test a clear, descriptive name that conveys the scenario and expected outcome

Applied to files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Applies to __tests__/**/__tests__/**/*.{ts,tsx,js,jsx} : Organize test files in `__tests__` directory mirroring source folder structure (components, contexts, hooks, utils) to keep structure familiar

Applied to files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Tests should live in `__tests__/` directory or be named `ComponentName.test.tsx`

Applied to files:

  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
📚 Learning: 2025-11-25T08:37:14.950Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.950Z
Learning: Mock external dependencies and APIs in tests

Applied to files:

  • __tests__/components/notifications/NotificationsContext.test.tsx
  • __tests__/components/brain/notifications/NotificationWaveCreated.test.tsx
📚 Learning: 2025-11-25T08:37:36.725Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:36.725Z
Learning: Write Integration Tests for interactions between components or with API routes

Applied to files:

  • __tests__/components/notifications/NotificationsContext.test.tsx
🧬 Code graph analysis (1)
__tests__/components/notifications/NotificationsContext.test.tsx (1)
components/notifications/NotificationsContext.tsx (1)
  • useNotificationsContext (273-281)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (5)
__tests__/components/brain/notifications/NotificationWaveCreated.test.tsx (2)

9-9: LGTM! More realistic path in mock.

The leading slash makes the mock return value more representative of actual URL paths.


38-38: LGTM! More resilient assertion.

Using toContain instead of exact matching makes the test more robust to Next.js image optimization transformations (e.g., query parameters, prefixes).

__tests__/components/notifications/NotificationsContext.test.tsx (2)

17-17: LGTM! Auth mock supports authenticated context.

Returning a connectedProfile object enables tests that depend on authenticated user state.


80-81: LGTM! Explicit router mock pattern.

The explicit mock retrieval approach is clear and valid, though slightly more verbose than spying.

__tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx (1)

17-20: NotificationsFollowBtn mock is minimal and appropriate for current test scope

This no-op mock prevents follow-button behavior from affecting these navigation tests while still ensuring the component can render without errors. It aligns with the existing Drop mock pattern in this file and keeps the test surface small.

Signed-off-by: ragnep <ragneinfo@gmail.com>
Signed-off-by: ragnep <ragneinfo@gmail.com>
Copy link
Copy Markdown

@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 (1)
components/header/header-search/HeaderSearchModal.tsx (1)

933-933: Optional: tw-border-solid is redundant in Tailwind CSS.

The tw-border-solid class is redundant since Tailwind's tw-border utility applies a solid border style by default. Additionally, other buttons in this file (e.g., lines 839-842, 1011-1034) use tw-border without explicitly specifying tw-border-solid, creating a minor inconsistency.

You can either:

  1. Remove tw-border-solid here for brevity, or
  2. Add it to the other border-styled buttons (lines 839-842, 1011-1034) for consistency
-                  className="tw-hidden sm:tw-inline-flex tw-h-9 tw-w-9 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-iron-700 tw-bg-iron-900 tw-text-iron-300 tw-border-solid hover:tw-border-iron-500 hover:tw-bg-iron-800 hover:tw-text-white tw-transition tw-duration-150">
+                  className="tw-hidden sm:tw-inline-flex tw-h-9 tw-w-9 tw-items-center tw-justify-center tw-rounded-full tw-border tw-border-iron-700 tw-bg-iron-900 tw-text-iron-300 hover:tw-border-iron-500 hover:tw-bg-iron-800 hover:tw-text-white tw-transition tw-duration-150">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65cc6d1 and 3a35f71.

📒 Files selected for processing (5)
  • components/brain/notifications/subcomponents/NotificationHeader.tsx (1 hunks)
  • components/header/header-search/HeaderSearchModal.tsx (1 hunks)
  • components/user/utils/profile/UserProfileTooltip.tsx (4 hunks)
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx (1 hunks)
  • components/user/utils/stats/UserStatsRow.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/brain/notifications/subcomponents/NotificationHeader.tsx
  • components/user/utils/profile/UserProfileTooltipTopRep.tsx
  • components/user/utils/profile/UserProfileTooltip.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Replace <img> elements with <Image /> from next/image to satisfy @next/next/no-img-element ESLint rule
Use <Link href="/path"> from Next.js for internal navigation instead of plain HTML links to satisfy @next/next/no-html-link-for-pages ESLint rule

Files:

  • components/user/utils/stats/UserStatsRow.tsx
  • components/header/header-search/HeaderSearchModal.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • components/user/utils/stats/UserStatsRow.tsx
  • components/header/header-search/HeaderSearchModal.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks)
Use framework APIs: internal links should use <Link>, images should use next/image, and adopt Next's ESLint rules (Core Web Vitals)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks rules)
Follow existing code style and naming conventions; maintain clean code standards (measured by SonarQube)

Files:

  • components/user/utils/stats/UserStatsRow.tsx
  • components/header/header-search/HeaderSearchModal.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Must pass tsc --noEmit type checking
Prefer direct named imports for React hooks and types (import { useMemo, useRef, FC, etc. } from "react") over React. namespace usage (React.useMemo, React.useRef, etc.)
If the react-hooks/exhaustive-deps lint rule is triggered: if the Effect only derives state, remove the Effect and compute during render; if listening to an external system and needing fresh props/state, wrap non-reactive logic in useEffectEvent

**/*.{ts,tsx}: Must pass tsc --noEmit for TypeScript type checking
Prefer Server Components over Client Components; use Server Functions/Server Actions ('use server') for mutations
Remove unnecessary Effects; if Effect only derives state, compute during render instead
Use useEffectEvent for non-reactive logic inside Effects to avoid unnecessary re-runs
Use framework APIs: <Link> for internal links, next/image for images, adopt Next's ESLint rules
Use 'use cache' directive and Cache Components features for explicit opt-in caching in Next.js 16
Use TypeScript and React functional components with hooks
When parsing Seize URLs or similar, fail fast if base origin is unavailable; do not fall back to placeholder origins
Replace <img> elements with <Image /> from next/image
Use <Link href="/path"> for internal navigation instead of plain HTML links
Move data fetches to Server Components; handle mutations through Server Functions/Server Actions with 'use server' directive

Files:

  • components/user/utils/stats/UserStatsRow.tsx
  • components/header/header-search/HeaderSearchModal.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Link href="/path">` from Next.js for internal navigation instead of plain HTML links to satisfy `next/next/no-html-link-for-pages` ESLint rule

Applied to files:

  • components/user/utils/stats/UserStatsRow.tsx
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.{ts,tsx} : Use `<Link href="/path">` for internal navigation instead of plain HTML links

Applied to files:

  • components/user/utils/stats/UserStatsRow.tsx
🧬 Code graph analysis (1)
components/user/utils/stats/UserStatsRow.tsx (1)
helpers/Helpers.ts (2)
  • formatStatFloor (127-137)
  • formatNumberWithCommas (103-120)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (2)
components/user/utils/stats/UserStatsRow.tsx (2)

6-23: Size enum and mapping are well-typed and future-proof

The UserStatsRowSize enum, SIZE_CLASSES record, and the optional size prop with a default value are wired together cleanly. Defaulted destructuring ensures size is always a valid enum at runtime, and the record keeps variant-specific class names centralized for easy extension later (e.g., adding a LARGE size). As per coding guidelines, this keeps props readonly and maintains a clear, typed public surface.

Also applies to: 35-36, 48-49, 53-53


62-77: Consistent use of size-based classes across all stat labels

All metric value and label spans now derive their typography from the computed classes.text / classes.rate, giving a consistent small/medium variant across TDH, xTDH, NIC, Rep, and Followers while preserving existing colors and weights. This is a straightforward, low-risk styling refactor with no behavioral changes. Based on learnings, internal links correctly use <Link> and props remain readonly as expected.

Also applies to: 87-102, 112-117, 126-131, 140-145

Signed-off-by: ragnep <ragneinfo@gmail.com>
Copy link
Copy Markdown

@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 (3)
components/brain/notifications/utils/navigationUtils.ts (1)

9-22: Consider memoizing navigateToWave with useCallback.

The navigateToWave function is recreated on every render. If downstream components pass it to child components or use it in dependency arrays, this could cause unnecessary re-renders or effect re-runs.

+import { useCallback } from "react";
 import { useRouter } from "next/navigation";
 import { getWaveRoute } from "@/helpers/navigation.helpers";
 import useDeviceInfo from "@/hooks/useDeviceInfo";

 export function useWaveNavigation() {
   const router = useRouter();
   const { isApp } = useDeviceInfo();

-  const navigateToWave = (
+  const navigateToWave = useCallback((
     waveId: string,
     serialNo: number,
     isDirectMessage: boolean
   ) => {
     router.push(
       getWaveRoute({
         waveId,
         serialNo,
         isDirectMessage,
         isApp,
       })
     );
-  };
+  }, [router, isApp]);

   return { navigateToWave };
 }
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)

91-96: Consider replacing <img> with next/image for custom emoji.

The coding guidelines specify using <Image> from next/image instead of HTML <img> elements. While the avatar <img> issue from past reviews is resolved via NotificationHeader, this custom emoji image still uses a native <img> tag.

+import Image from "next/image";

// In the emojiNode assignment:
-      emojiNode = (
-        <img
-          src={custom.skins[0].src}
-          alt={rawId}
-          className="tw-max-w-5 tw-max-h-5 tw-object-contain"
-        />
-      );
+      emojiNode = (
+        <Image
+          src={custom.skins[0].src}
+          alt={rawId}
+          width={20}
+          height={20}
+          className="tw-object-contain"
+          unoptimized
+        />
+      );

Note: If the emoji source URLs are from an external domain, ensure they're added to next.config.js remotePatterns. The unoptimized prop is useful if emoji sources don't benefit from Next.js image optimization.

components/brain/notifications/drop-replied/NotificationDropReplied.tsx (1)

30-30: Consider defining proper types for wave chat properties.

The as any casts bypass TypeScript's type checking. While the code works correctly with optional chaining as a fallback, consider defining an extended type or interface that includes the chat property structure to improve type safety.

Also applies to: 39-39

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a35f71 and 3d50513.

📒 Files selected for processing (8)
  • __tests__/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx (1 hunks)
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx (1 hunks)
  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx (1 hunks)
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (3 hunks)
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (4 hunks)
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx (2 hunks)
  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (2 hunks)
  • components/brain/notifications/utils/navigationUtils.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/components/brain/notifications/drop-quoted/NotificationDropQuoted.test.tsx
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Replace <img> elements with <Image /> from next/image to satisfy @next/next/no-img-element ESLint rule
Use <Link href="/path"> from Next.js for internal navigation instead of plain HTML links to satisfy @next/next/no-html-link-for-pages ESLint rule

Files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/utils/navigationUtils.ts
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

Files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks)
Use framework APIs: internal links should use <Link>, images should use next/image, and adopt Next's ESLint rules (Core Web Vitals)

**/*.{js,jsx,ts,tsx}: Code must satisfy ESLint (Next's Core Web Vitals + React Hooks rules)
Follow existing code style and naming conventions; maintain clean code standards (measured by SonarQube)

Files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/utils/navigationUtils.ts
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Must pass tsc --noEmit type checking
Prefer direct named imports for React hooks and types (import { useMemo, useRef, FC, etc. } from "react") over React. namespace usage (React.useMemo, React.useRef, etc.)
If the react-hooks/exhaustive-deps lint rule is triggered: if the Effect only derives state, remove the Effect and compute during render; if listening to an external system and needing fresh props/state, wrap non-reactive logic in useEffectEvent

**/*.{ts,tsx}: Must pass tsc --noEmit for TypeScript type checking
Prefer Server Components over Client Components; use Server Functions/Server Actions ('use server') for mutations
Remove unnecessary Effects; if Effect only derives state, compute during render instead
Use useEffectEvent for non-reactive logic inside Effects to avoid unnecessary re-runs
Use framework APIs: <Link> for internal links, next/image for images, adopt Next's ESLint rules
Use 'use cache' directive and Cache Components features for explicit opt-in caching in Next.js 16
Use TypeScript and React functional components with hooks
When parsing Seize URLs or similar, fail fast if base origin is unavailable; do not fall back to placeholder origins
Replace <img> elements with <Image /> from next/image
Use <Link href="/path"> for internal navigation instead of plain HTML links
Move data fetches to Server Components; handle mutations through Server Functions/Server Actions with 'use server' directive

Files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/utils/navigationUtils.ts
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/@(__tests__|*.test).{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Tests should live in __tests__/ or ComponentName.test.tsx; mock external dependencies and APIs in tests

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Place tests in __tests__/ directory or as ComponentName.test.tsx alongside components

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Mock external dependencies and APIs in tests

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
__tests__/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use Jest + ts-jest for TypeScript testing

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Functions must have ≤ 15 cognitive complexity; extract deep ternaries (>3 levels) and break down complex logic

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
__tests__/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (tests/AGENTS.md)

__tests__/**/*.{ts,tsx,js}: Prefer for...of loops over forEach as it allows break/continue and works with async/await
Use array.at(-1) and array.at(-2) instead of index-based array access for negative indexing
Use String.prototype.replaceAll() instead of replace() for global string replacements
Use globalThis.fetch() instead of direct fetch() calls
Organize imports with one import per module in order: external → internal → types, with no duplicates
Use element.remove() instead of parent.removeChild(element) for DOM manipulation
Catch errors only when meaningful; no empty catch blocks; log errors with context
Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (?.)

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
__tests__/**/{components,contexts,hooks}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use semantic HTML elements (<label>, <output>) over ARIA attributes when possible; every form control must have a label

Files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
🧠 Learnings (19)
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.{ts,tsx} : Replace `<img>` elements with `<Image />` from `next/image`

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Replace `<img>` elements with `<Image />` from `next/image` to satisfy `next/next/no-img-element` ESLint rule

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.{ts,tsx} : Use framework APIs: `<Link>` for internal links, `next/image` for images, adopt Next's ESLint rules

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use framework APIs: internal links should use `<Link>`, images should use `next/image`, and adopt Next's ESLint rules (Core Web Vitals)

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Fix with modernization (no `// eslint-disable` unless explicitly instructed); prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/drop-replied/NotificationDropReplied.tsx
  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Link href="/path">` from Next.js for internal navigation instead of plain HTML links to satisfy `next/next/no-html-link-for-pages` ESLint rule

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
  • components/brain/notifications/utils/navigationUtils.ts
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{tsx,jsx} : Use FontAwesome for icons in React components

Applied to files:

  • components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Code must satisfy ESLint (Next's Core Web Vitals + React Hooks)

Applied to files:

  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Code must satisfy ESLint (Next's Core Web Vitals + React Hooks rules)

Applied to files:

  • components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.test.{ts,tsx} : Mock external dependencies and APIs in tests

Applied to files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: Applies to **/@(__tests__|*.test).{ts,tsx} : Tests should live in `__tests__/` or `ComponentName.test.tsx`; mock external dependencies and APIs in tests

Applied to files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-05T10:55:43.458Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.458Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests

Applied to files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-05T10:55:43.458Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.458Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Keep tests independent, deterministic, and fast with production-like data

Applied to files:

  • __tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx
  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-03T14:52:34.255Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.255Z
Learning: TypeScript + React functional components with hooks; follow existing code style and naming conventions; maintain clean code standards (measured by SonarQube)

Applied to files:

  • components/brain/notifications/drop-reacted/NotificationDropReacted.tsx
  • components/brain/notifications/utils/navigationUtils.ts
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript and React functional components with hooks

Applied to files:

  • components/brain/notifications/utils/navigationUtils.ts
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to app/**/page.{ts,tsx} : Export `generateMetadata` in App Router routes using the `getAppMetadata` helper from '@/components/providers/metadata'

Applied to files:

  • components/brain/notifications/utils/navigationUtils.ts
📚 Learning: 2025-12-05T10:55:43.458Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.458Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (`?.`)

Applied to files:

  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-05T10:55:30.859Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.859Z
Learning: Applies to **/__tests__/**/*.{ts,tsx} : Place tests in `__tests__/` directory or as `ComponentName.test.tsx` alongside components

Applied to files:

  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
📚 Learning: 2025-12-05T10:55:43.458Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.458Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Test accessibility with keyboard navigation and screen reader compatibility

Applied to files:

  • __tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx
🧬 Code graph analysis (4)
components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (3)
components/brain/notifications/utils/navigationUtils.ts (1)
  • useWaveNavigation (5-25)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (14-53)
helpers/Helpers.ts (1)
  • getTimeAgoShort (575-601)
components/brain/notifications/drop-replied/NotificationDropReplied.tsx (6)
components/brain/notifications/utils/navigationUtils.ts (1)
  • useWaveNavigation (5-25)
generated/models/ApiDrop.ts (1)
  • ApiDrop (28-229)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (14-53)
helpers/Helpers.ts (1)
  • getTimeAgoShort (575-601)
components/waves/drops/Drop.tsx (1)
  • Drop (41-119)
helpers/waves/drop.helpers.ts (1)
  • Drop (14-14)
components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (2)
components/brain/notifications/utils/navigationUtils.ts (1)
  • useWaveNavigation (5-25)
components/brain/notifications/subcomponents/NotificationHeader.tsx (1)
  • NotificationHeader (14-53)
components/brain/notifications/utils/navigationUtils.ts (2)
hooks/useDeviceInfo.ts (1)
  • useDeviceInfo (23-93)
helpers/navigation.helpers.ts (1)
  • getWaveRoute (19-68)
⏰ 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: Analyze (javascript-typescript)
🔇 Additional comments (8)
__tests__/components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.test.tsx (1)

20-23: LGTM!

The mock for useDeviceInfo is correctly placed before the component import and follows the established pattern for module mocks in this test file. This ensures the navigation hook works correctly in a non-app context.

__tests__/components/brain/notifications/drop-replied/NotificationDropReplied.test.tsx (1)

13-16: LGTM!

The useDeviceInfo mock is correctly structured and positioned, enabling the test to verify navigation behavior in a non-app context consistently with other notification component tests.

components/brain/notifications/drop-quoted/NotificationDropQuoted.tsx (1)

46-88: LGTM!

Clean refactor using the NotificationHeader component pattern. The previous <img> concern from past reviews is resolved since NotificationHeader internally uses next/image. Navigation logic is properly delegated to useWaveNavigation.

components/brain/notifications/identity-mentioned/NotificationIdentityMentioned.tsx (1)

45-87: LGTM!

The refactor to use NotificationHeader is well-executed. The previous <img> concern from past reviews is resolved since avatar rendering is now handled by NotificationHeader which uses next/image internally. Navigation logic is cleanly delegated to useWaveNavigation.

components/brain/notifications/drop-reacted/NotificationDropReacted.tsx (1)

146-180: LGTM on the header refactor!

The refactor to use NotificationHeader for author/avatar rendering is well-executed. Navigation logic is cleanly delegated to useWaveNavigation, and the overall structure follows the established pattern across notification components.

components/brain/notifications/drop-replied/NotificationDropReplied.tsx (3)

13-14: LGTM! Clean refactoring to shared components.

The refactoring to use NotificationHeader and useWaveNavigation improves consistency across notification components and eliminates code duplication. The header now properly uses Next.js <Image> (via NotificationHeader), resolving the previous review concern about the <img> tag.

Also applies to: 29-64


34-43: LGTM! Navigation handlers correctly implemented.

The handlers properly extract wave context and delegate to navigateToWave, correctly handling direct message flags for both the base wave and quoted drops.


66-85: LGTM! Drop component props correctly configured.

The Drop component receives all required props with appropriate values for the notification context, including the navigation handlers and display flags.

Signed-off-by: ragnep <ragneinfo@gmail.com>
analyticsflowee
analyticsflowee previously approved these changes Dec 8, 2025
Signed-off-by: ragnep <ragneinfo@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
4.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@ragnep ragnep merged commit 4547ea3 into main Dec 8, 2025
7 of 8 checks passed
@ragnep ragnep deleted the hover-card-rep-categories branch December 8, 2025 11:46
@coderabbitai coderabbitai Bot mentioned this pull request Mar 9, 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.

2 participants