Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRewires outcome calculation by removing the legacy useDropOutcomes hook and Wave prop propagation, replacing per-drop outcomes with useWaveRankReward totals (nicTotal, repTotal, manualOutcomes). Updates winner/drop components and outcome type discriminants to use ApiWaveOutcome* constants and adjusts layout/classNames. Changes
Sequence Diagram(s)(Skipped — changes are refactor/data-source swaps without a new multi-component sequential flow that benefits from a diagram.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @components/waves/drop/MemesSingleWaveDropInfoPanel.tsx:
- Line 48: Remove the debug console.log in the MemesSingleWaveDropInfoPanel
component: delete the line that logs { nicTotal, repTotal, manualOutcomes } (or
replace it with a proper logger that is disabled in production), ensuring the
component no longer emits console output in production builds.
🧹 Nitpick comments (1)
components/waves/winners/WaveWinnersSmallOutcome.tsx (1)
46-94: Consider conditionally rendering NIC and Rep sections in the tooltip.The NIC and Rep sections are always rendered in the tooltip content, but the button icons are conditionally rendered based on
!!nicTotaland!!repTotal. This could display "NIC: 0" or "Rep: 0" in the tooltip when those outcome types don't exist for this rank.🔎 Proposed fix to conditionally render tooltip sections
<div className="tw-space-y-2"> + {!!nicTotal && ( <div className="tw-flex tw-items-center tw-justify-between tw-rounded-lg tw-bg-iron-800/40 tw-p-2"> <div className="tw-flex tw-items-center tw-gap-2"> <svg className="tw-size-4 tw-flex-shrink-0 tw-text-[#A4C2DB]" viewBox="0 0 24 24" aria-hidden="true" fill="none" > <path d="M9 6.75H15M9 12H15M9 17.25H12M3.75 19.5H20.25C21.0784 19.5 21.75 18.8284 21.75 18V6C21.75 5.17157 21.0784 4.5 20.25 4.5H3.75C2.92157 4.5 2.25 5.17157 2.25 6V18C2.25 18.8284 2.92157 19.5 3.75 19.5Z" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" /> </svg> <span className="tw-text-sm tw-font-medium tw-text-iron-200"> NIC </span> </div> <span className="tw-text-sm tw-font-semibold tw-text-[#A4C2DB]"> {formatNumberWithCommas(nicTotal)} </span> </div> + )} + {!!repTotal && ( <div className="tw-flex tw-flex-col tw-gap-y-1 tw-rounded-lg tw-bg-iron-800/40 tw-p-2"> <div className="tw-flex tw-items-center tw-justify-between"> <div className="tw-flex tw-items-center tw-gap-2"> <svg className="tw-size-4 tw-flex-shrink-0 tw-text-[#C3B5D9]" viewBox="0 0 24 24" aria-hidden="true" fill="none" > <path d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" stroke="currentColor" strokeWidth="1.5" /> </svg> <span className="tw-text-sm tw-font-medium tw-text-iron-200"> Rep </span> </div> <span className="tw-text-sm tw-font-semibold tw-text-[#C3B5D9]"> {formatNumberWithCommas(repTotal)} </span> </div> </div> + )}
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
components/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/WaveWinnerItemSmall.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsxcomponents/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxhooks/drops/useDropOutcomes.tsxhooks/waves/useWaveRankReward.ts
💤 Files with no reviewable changes (2)
- hooks/drops/useDropOutcomes.tsx
- components/waves/winners/WaveWinnerItemSmall.tsx
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{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}: Remove unnecessary Effects. If the Effect's only job is to derive or sync internal state, calculate during render or useuseMemoinstead.
UseuseEffectEventfor non-reactive logic inside Effects to read the latest props/state without turning them into dependencies or causing unnecessary re-runs.
Use explicit caching with"use cache"directive at the top of Server Components, routes, or functions. ConfigurecacheComponents: trueinnext.config.tsas needed.
**/*.{ts,tsx,js,jsx}: Remove unnecessary Effects; if the Effect only derives state, compute during render instead
UseuseEffectEventwhen listening to external events but needing the latest props/state without re-running the Effect
Move data fetching from client Effects to Server Components; mutations go through Server Actions ('use server')
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxhooks/waves/useWaveRankReward.tscomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.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 addreadonlybefore props in React components
**/*.{tsx,jsx}: Use internal links via<Link>component from Next.js instead of<a>tags
Replace<img>elements with<Image />fromnext/image
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxcomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
Run
npm run lintto ensure code satisfies ESLint (Next's Core Web Vitals + React Hooks). Code must pass linting before completing any task.
**/*.{js,ts,jsx,tsx}: Code must satisfy ESLint with Next's Core Web Vitals and React Hooks rules by runningnpm run lint
Do not addeslint-disablecomments unless explicitly instructed; prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxhooks/waves/useWaveRankReward.tscomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
**/*.{jsx,tsx}: Replace<img>elements with<Image />fromnext/imageto comply with Next.js ESLint rule@next/next/no-img-element.
Use<Link href="/path">from Next.js for internal navigation instead of raw<a>tags to comply with@next/next/no-html-link-for-pages.
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxcomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (GEMINI.md)
Use TypeScript with React functional components and hooks. Follow existing code style and naming conventions.
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxhooks/waves/useWaveRankReward.tscomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript with React functional components and hooks
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxhooks/waves/useWaveRankReward.tscomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{tsx,ts,jsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
Prefer direct named imports from React (
useMemo,useRef,FC) overReact.namespace usage
Files:
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/winners/MemesWaveWinnerDropSmall.tsxcomponents/waves/winners/podium/WavePodiumItemContentOutcomes.tsxcomponents/waves/winners/DefaultWaveWinnerDropSmall.tsxhooks/waves/useWaveRankReward.tscomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsxcomponents/waves/winners/WaveWinnersSmallOutcome.tsx
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
When parsing Seize URLs or similar, fail fast if base origin is unavailable instead of falling back to placeholder origins
Files:
hooks/waves/useWaveRankReward.ts
🧠 Learnings (2)
📚 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/waves/winners/drops/header/WaveWinnersDropOutcome.tsxcomponents/waves/drop/MemesSingleWaveDropInfoPanel.tsx
📚 Learning: 2025-12-30T14:32:37.293Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: __tests__/AGENTS.md:0-0
Timestamp: 2025-12-30T14:32:37.293Z
Learning: Applies to __tests__/**/*.{ts,tsx,js},!**/__tests__/**,!**/__mocks__/**,!**/*.d.ts : Use `Array.at()` method for negative indexing instead of `array[array.length - n]`
Applied to files:
hooks/waves/useWaveRankReward.ts
🧬 Code graph analysis (2)
components/waves/winners/DefaultWaveWinnerDropSmall.tsx (1)
components/waves/winners/WaveWinnersSmallOutcome.tsx (1)
WaveWinnersSmallOutcome(13-200)
components/waves/winners/WaveWinnersSmallOutcome.tsx (3)
helpers/waves/drop.helpers.ts (1)
ExtendedDrop(16-20)hooks/waves/useWaveRankReward.ts (1)
useWaveRankReward(18-96)helpers/Helpers.ts (1)
formatNumberWithCommas(131-148)
⏰ 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 (9)
components/waves/winners/drops/header/WaveWinnersDropOutcome.tsx (1)
17-49: LGTM!The migration from local
OutcomeTypeenum toApiWaveOutcomeCreditandApiWaveOutcomeTypeconstants is clean. Using API-generated types ensures consistency with the backend contract and eliminates potential enum drift.components/waves/winners/podium/WavePodiumItemContentOutcomes.tsx (1)
41-67: LGTM!The type discriminant migration to
ApiWaveOutcomeCreditandApiWaveOutcomeTypeis consistent with the PR's refactoring approach. TheuseMemocorrectly memoizes the award transformation.components/waves/winners/MemesWaveWinnerDropSmall.tsx (2)
22-23: LGTM!The removal of the
waveprop from the component signature aligns with the PR's refactoring to derive outcome data fromdrop.wave.idvia theuseWaveRankRewardhook instead.
158-160: LGTM!The
WaveWinnersSmallOutcomecomponent now correctly receives only thedropprop, which contains the necessarywave.idandrankfor the internaluseWaveRankRewardhook.components/waves/drop/MemesSingleWaveDropInfoPanel.tsx (1)
42-46: LGTM!The integration of
useWaveRankRewardcorrectly derives outcome totals from the drop's wave ID and rank, replacing the previous manual calculation approach.components/waves/winners/DefaultWaveWinnerDropSmall.tsx (2)
22-23: LGTM!The removal of the
waveprop is consistent with the refactoring pattern applied across the winner components in this PR.
158-159: LGTM!The
WaveWinnersSmallOutcomecomponent usage is correctly updated to pass only thedropprop.components/waves/winners/WaveWinnersSmallOutcome.tsx (1)
30-33: LGTM!The hook integration correctly derives outcome data from the drop's embedded wave information, eliminating the need for a separate wave prop.
hooks/waves/useWaveRankReward.ts (1)
72-88: Verify the API index contract for distribution items.The index comparison changed from
d.index === targetIndextod.index - 1 === targetIndex. This shift changes the expected API index semantics from 0-based to 1-based: the code now matches items whered.index === rankinstead ofd.index === rank - 1. Confirm this aligns with the backend API's actual index semantics, as this is a breaking behavioral change if incorrect.
|


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