Skip to content

Seize sentry error fixes#1668

Merged
ragnep merged 5 commits intomainfrom
seize-sentry-error-fixes
Dec 18, 2025
Merged

Seize sentry error fixes#1668
ragnep merged 5 commits intomainfrom
seize-sentry-error-fixes

Conversation

@ragnep
Copy link
Copy Markdown
Contributor

@ragnep ragnep commented Dec 18, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Standardized vote button label from "Vote!" to "Vote" for consistent UI.
    • Unified vote tooltip formatting to use "Rep" (e.g., "50 Rep") for clearer units.
    • Fixed NFT description link markup so external links open correctly in a new tab.

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

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

coderabbitai Bot commented Dec 18, 2025

Walkthrough

Tests updated to use a label: string prop instead of creditType, normalize vote button text, relax some image-src assertions, and fix an HTML expectation. Two hooks were optimized: useWaveMessagesStore.getData now reads from a ref, and useDeviceInfo avoids redundant state updates via functional comparison.

Changes

Cohort / File(s) Summary
SingleWaveDrop component tests
__tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx, __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx, __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
Tests updated to pass label: string instead of creditType; removed ApiWaveCreditType import. Tooltip/expectation text adjusted from uppercase "REP" to "Rep". Vote button text assertions changed from "Vote!" to "Vote".
Wave leaderboard test
__tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
Relaxed image assertions: now check image presence and that src contains expected filename fragments instead of exact URL equality.
Helper test
__tests__/helpers/Helpers.test.ts
Updated expected HTML output for parseNftDescriptionToHtml to use double-quoted attributes and target="_blank".
Wave messages hook
contexts/wave/hooks/useWaveMessagesStore.ts
getData now reads from waveMessagesRef.current and is created with an empty dependency array; waveMessagesRef is kept in sync via effect.
Device info hook
hooks/useDeviceInfo.ts
Effect update now uses a functional state update that compares all DeviceInfo fields and returns previous state when unchanged to avoid unnecessary re-renders.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify all test updates correctly reflect the component prop API change and that no remaining creditType usages exist.
  • Confirm waveMessagesRef is reliably synchronized and that getData behavior matches prior semantics under concurrent updates.
  • Check useDeviceInfo comparison logic for correctness across edge cases (undefineds, value coercion).

Possibly related PRs

  • Mobile chat jump #1591 — modifies hooks/useDeviceInfo.ts (adds/islands isAppleMobile field and related changes), likely overlaps with the device-info updates here.

Suggested reviewers

  • simo6529
  • prxt6529

Poem

🐰 I hopped through tests with nimble feet,
Swapped creditType for label neat,
Trimmed the exclaim, let images rest,
Hooks now steady, state behaves best,
A tiny rabbit cheer — code tidy and sweet! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Seize sentry error fixes' is vague and generic. It mentions 'sentry error fixes' but the actual changes involve prop refactoring (creditType→label), tooltip text updates, button text changes, and ref-based state management—none of which clearly relate to 'Sentry error' context. Consider a more descriptive title that reflects the actual changes, such as 'Refactor credit type props to label strings and update component tests' or clarify what 'sentry error fixes' refers to in the changeset.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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 seize-sentry-error-fixes

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc0604b and 033428d.

📒 Files selected for processing (1)
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx (2 hunks)
🧰 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:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Mock external dependencies and APIs in tests

Files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
__tests__/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use Jest + ts-jest for TypeScript testing

Files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/{components,contexts,hooks}/**/*.{ts,tsx} : Use semantic HTML elements (`<label>`, `<output>`) over ARIA attributes when possible; every form control must have a label
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
Learning: Fix with modernization (no `// eslint-disable` unless explicitly instructed); prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (`?.`)
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Test high-risk areas including happy path workflows, invalid input errors, edge cases/boundaries, component & API interactions, and performance/security when relevant

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx} : Functions must have ≤ 15 cognitive complexity; extract deep ternaries (>3 levels) and break down complex logic

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Write tests following Arrange – Act – Assert pattern with one behaviour per test and clear, descriptive names

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-03T14:52:34.271Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/{components,contexts,hooks}/**/*.{ts,tsx} : Use semantic HTML elements (`<label>`, `<output>`) over ARIA attributes when possible; every form control must have a label

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Use `element.remove()` instead of `parent.removeChild(element)` for DOM manipulation

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Keep tests independent, deterministic, and fast with production-like data

Applied to files:

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

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.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)
🔇 Additional comments (1)
__tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx (1)

113-124: Image src assertions appropriately relaxed for test resilience.

The updated assertions using expect.stringContaining() make the tests more resilient to URL transformations (CDN, query parameters, next/image optimization) while still verifying that the correct image is loaded. The tests continue to validate the essential behavior: the image element exists, contains the expected filename, and has proper styling.

Also applies to: 140-150


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.

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 (2)
__tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx (2)

113-123: Consider whether relaxing the image src assertion reduces meaningful test coverage.

The test previously validated that the voter's profile picture src matched the expected URL but now only checks that an image element exists. While this makes the test less brittle, it also reduces coverage by not verifying that the correct image is displayed.

If the relaxation is intentional (e.g., due to image URL transformations or CDN changes), consider adding a comment explaining why. Otherwise, consider restoring the src validation:

 const voterPfp = voterLink.querySelector('img');
 expect(voterPfp).toBeInTheDocument();
+expect(voterPfp).toHaveAttribute('src', 'https://example.com/voter.jpg');
 expect(voterPfp).toHaveClass('tw-size-5', 'tw-rounded-md');

139-148: Consider whether relaxing the image src assertion reduces meaningful test coverage.

Similar to the voter profile picture test, this now only checks for the presence of an author image element without verifying the src attribute matches the expected URL.

If intentional, consider documenting why. Otherwise, restore the src validation:

 const authorPfp = authorLink.querySelector('img');
 expect(authorPfp).toBeInTheDocument();
+expect(authorPfp).toHaveAttribute('src', 'https://example.com/author.jpg');
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3508ed and dc0604b.

📒 Files selected for processing (7)
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx (2 hunks)
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx (4 hunks)
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx (4 hunks)
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx (2 hunks)
  • __tests__/helpers/Helpers.test.ts (1 hunks)
  • contexts/wave/hooks/useWaveMessagesStore.ts (1 hunks)
  • hooks/useDeviceInfo.ts (1 hunks)
🧰 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:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • hooks/useDeviceInfo.ts
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
  • contexts/wave/hooks/useWaveMessagesStore.ts
**/*.{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:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • hooks/useDeviceInfo.ts
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
  • contexts/wave/hooks/useWaveMessagesStore.ts
**/*.{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:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • hooks/useDeviceInfo.ts
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
  • contexts/wave/hooks/useWaveMessagesStore.ts
**/@(__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__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
**/__tests__/**/*.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

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

Files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Mock external dependencies and APIs in tests

Files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
__tests__/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (tests/AGENTS.md)

Use Jest + ts-jest for TypeScript testing

Files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.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__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.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__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.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/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/{components,contexts,hooks}/**/*.{ts,tsx} : Use semantic HTML elements (`<label>`, `<output>`) over ARIA attributes when possible; every form control must have a label
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
Learning: Fix with modernization (no `// eslint-disable` unless explicitly instructed); prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Avoid double negatives in code; prefer explicit logic and remove redundant annotations; use optional chaining (`?.`)
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
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__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/{components,contexts,hooks}/**/*.{ts,tsx} : Use semantic HTML elements (`<label>`, `<output>`) over ARIA attributes when possible; every form control must have a label

Applied to files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Use `String.prototype.replaceAll()` instead of `replace()` for global string replacements

Applied to files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
📚 Learning: 2025-11-25T08:37:44.688Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: app/api/AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:44.688Z
Learning: All changes must pass the same commands listed in the top-level AGENTS.md: `npm run test`, `npm run lint`, and `npm run type-check` (or the targeted `test:cov:changed` when appropriate).

Applied to files:

  • __tests__/helpers/Helpers.test.ts
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Write tests following Arrange – Act – Assert pattern with one behaviour per test and clear, descriptive names

Applied to files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-03T14:52:34.271Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
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__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx} : Functions must have ≤ 15 cognitive complexity; extract deep ternaries (>3 levels) and break down complex logic

Applied to files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Keep tests independent, deterministic, and fast with production-like data

Applied to files:

  • __tests__/helpers/Helpers.test.ts
  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/*.test.{ts,tsx,js} : Test high-risk areas including happy path workflows, invalid input errors, edge cases/boundaries, component & API interactions, and performance/security when relevant

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/*.{ts,tsx,js} : Use `element.remove()` instead of `parent.removeChild(element)` for DOM manipulation

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Use testing-library/react + user-event for React component tests

Applied to files:

  • __tests__/components/waves/leaderboard/sidebar/WaveLeaderboardRightSidebarActivityLog.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
📚 Learning: 2025-12-05T10:55:43.476Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-05T10:55:43.476Z
Learning: Applies to __tests__/**/__tests__/**/components/**/*.test.{ts,tsx} : Test accessibility with keyboard navigation and screen reader compatibility

Applied to files:

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

Applied to files:

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

Applied to files:

  • __tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx
  • __tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx
📚 Learning: 2025-12-05T10:55:30.871Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.871Z
Learning: Applies to **/*.{ts,tsx} : Remove unnecessary Effects; if Effect only derives state, compute during render instead

Applied to files:

  • hooks/useDeviceInfo.ts
📚 Learning: 2025-12-05T10:55:30.871Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-05T10:55:30.871Z
Learning: Applies to **/*.{ts,tsx} : Use `useEffectEvent` for non-reactive logic inside Effects to avoid unnecessary re-runs

Applied to files:

  • hooks/useDeviceInfo.ts
📚 Learning: 2025-12-03T14:52:34.271Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
Learning: Applies to **/*.{ts,tsx} : 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`

Applied to files:

  • hooks/useDeviceInfo.ts
📚 Learning: 2025-12-03T14:52:34.271Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T14:52:34.271Z
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:

  • hooks/useDeviceInfo.ts
🧬 Code graph analysis (2)
__tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx (1)
components/waves/drop/SingleWaveDropVoteInput.tsx (1)
  • SingleWaveDropVoteInput (25-307)
contexts/wave/hooks/useWaveMessagesStore.ts (1)
contexts/wave/hooks/types.ts (1)
  • WaveMessages (17-24)
⏰ 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 (6)
__tests__/helpers/Helpers.test.ts (1)

77-77: LGTM! Correct HTML attribute quoting and target value.

The test expectation now correctly validates double-quoted attributes and target="_blank" (the standard value for opening in a new tab) instead of the incorrect target="blank".

hooks/useDeviceInfo.ts (1)

74-86: LGTM! Effective optimization to prevent redundant re-renders.

The functional state update now compares all fields before updating, returning the previous state object when unchanged. This prevents unnecessary re-renders when device info hasn't actually changed, which is particularly valuable for a hook that listens to multiple event sources.

contexts/wave/hooks/useWaveMessagesStore.ts (1)

86-88: Verify ref-based getData doesn't introduce timing issues.

The implementation now reads from waveMessagesRef.current with an empty dependency array, making getData stable across renders. While this is good for preventing callback churn, there's a potential timing edge case: if getData is called synchronously after a state update but before the sync effect (lines 81-83) runs, it might return stale data.

This is likely intentional for performance, but verify that all callers of getData can handle this async gap or that your usage patterns don't expose this race condition. In React 19, effects are more predictable, but the theoretical race still exists.

Consider adding a brief comment explaining the ref-based approach if this optimization is intentional:

+// Stable getter that reads from ref to avoid callback recreation on every state change
 const getData = useCallback((key: string): WaveMessages | undefined => {
   return waveMessagesRef.current[key];
 }, []);
__tests__/components/waves/drop/SingleWaveDropVoteSubmit.test.tsx (1)

143-148: LGTM! Test expectations updated to match button text change.

All test assertions now correctly expect "Vote" instead of "Vote!", aligning with the simplified button text in the component.

Also applies to: 157-169, 231-243, 274-280

__tests__/components/waves/drop/SingleWaveDropVoteInput.test.tsx (1)

14-14: LGTM! Tests updated to reflect component API change from creditType to label.

The tests now correctly pass a label string prop instead of the creditType enum, aligning with the component's new API surface.

Also applies to: 38-42

__tests__/components/waves/drop/SingleWaveDropVoteSlider.test.tsx (1)

32-38: LGTM! Tests updated to reflect API change and tooltip formatting.

The tests now correctly:

  1. Use label: string prop instead of creditType enum
  2. Expect tooltip text in title case format (e.g., "50 Rep") instead of uppercase (e.g., "50 REP")

These changes align with the component's updated API and display logic.

Also applies to: 44-62, 64-71, 111-118, 120-127, 162-169, 171-179

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

@ragnep ragnep merged commit cbe94a3 into main Dec 18, 2025
8 checks passed
@ragnep ragnep deleted the seize-sentry-error-fixes branch December 18, 2025 11:19
This was referenced Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants