removed filters and added drop navigation#2328
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request removes media filtering functionality from community curations components, deletes the associated helper utilities, and introduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
🧹 Nitpick comments (1)
hooks/useNavigateToDropWave.ts (1)
8-35: Reduce contract drift by reusing the shared drop type.The local nested
DropWaveNavigationTargetduplicates the generated drop structure and is likely to drift. Prefer deriving it from the shared API model to keep this hook aligned with upstream shape changes.♻️ Proposed refactor
+import type { ApiDrop } from "@/generated/models/ApiDrop"; import { getWaveRoute } from "@/helpers/navigation.helpers"; import { useRouter } from "next/navigation"; import { useCallback } from "react"; import useDeviceInfo from "./useDeviceInfo"; -type DropWaveNavigationTarget = { - readonly wave?: - | { - readonly id?: string | null | undefined; - readonly chat?: - | { - readonly scope?: - | { - readonly group?: - | { - readonly is_direct_message?: - | boolean - | null - | undefined; - } - | null - | undefined; - } - | null - | undefined; - } - | null - | undefined; - } - | null - | undefined; - readonly serial_no: number | string; -}; +type DropWaveNavigationTarget = Pick<ApiDrop, "wave" | "serial_no">;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hooks/useNavigateToDropWave.ts` around lines 8 - 35, The local DropWaveNavigationTarget type duplicates the generated drop shape and should be replaced with the shared API model to avoid contract drift; update the hook to import and reuse the generated drop type (for example the shared Drop or DropWave type from your API models) and compose it with the serial_no field if needed (e.g. type DropWaveNavigationTarget = SharedDropType & { serial_no: number | string } or use Pick/Partial to match nullable fields), then remove the local nested declaration and update any references to DropWaveNavigationTarget accordingly (look for the type name DropWaveNavigationTarget and the hook/function that consumes it).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hooks/useNavigateToDropWave.ts`:
- Around line 50-53: The navigation currently builds a route with getWaveRoute
using waveId and drop.serial_no even when serial_no may be empty; update the
guard in useNavigateToDropWave so it checks both waveId and a valid non-empty
drop.serial_no (e.g., truthy string or numeric check) before calling
getWaveRoute and router.push, and bail out early (no navigation) if serial_no is
missing/invalid to avoid pushing malformed routes.
---
Nitpick comments:
In `@hooks/useNavigateToDropWave.ts`:
- Around line 8-35: The local DropWaveNavigationTarget type duplicates the
generated drop shape and should be replaced with the shared API model to avoid
contract drift; update the hook to import and reuse the generated drop type (for
example the shared Drop or DropWave type from your API models) and compose it
with the serial_no field if needed (e.g. type DropWaveNavigationTarget =
SharedDropType & { serial_no: number | string } or use Pick/Partial to match
nullable fields), then remove the local nested declaration and update any
references to DropWaveNavigationTarget accordingly (look for the type name
DropWaveNavigationTarget and the hook/function that consumes it).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 79c19d6e-40c0-4a67-a310-ca66b700e0de
📒 Files selected for processing (6)
components/community-curations/CommunityCurations.tsxcomponents/community-curations/CommunityCurationsMasonry.tsxcomponents/community-curations/communityCurations.helpers.tscomponents/user/waves/UserPageProfileWaveMasonry.tsxhooks/useCommunityCurationsDrops.tshooks/useNavigateToDropWave.ts
💤 Files with no reviewable changes (1)
- components/community-curations/communityCurations.helpers.ts
|



Summary by CodeRabbit
Changed Features
Bug Fixes