-
Notifications
You must be signed in to change notification settings - Fork 1.1k
web: cleanup rpc and enable prefetch #1339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRenames organization deletion to "soft delete" through frontend, backend RPC, service, and domain schema; also enables Next.js Link prefetch on several navbar components. No functional behavior changes beyond RPC/name updates and Link prefetch toggles. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Frontend UI
participant RPC as Organisations RPC
participant Svc as Organisations Service
participant DB as Database
rect rgba(200,230,255,0.3)
UI->>RPC: call OrganisationSoftDelete({ id })
note right of RPC #D0F0C0: RPC handler maps to service
end
RPC->>Svc: service.softDelete(id)
Svc->>DB: softDelete(orgId) -- mark tombstone / set deleted flag
DB-->>Svc: success / error
Svc-->>RPC: result / error (wrapped)
RPC-->>UI: response (success or InternalError{type: "database"})
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ 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.
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)
apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx (2)
326-331: Consider conditionally applying prefetch based on href validity.The
prefetch={true}is now applied to all menu items, including those that usehref="#"as a fallback (e.g., "Chat Support", "Download App", "Sign Out", "Upgrade to Pro"). While Next.js should handle this gracefully, it's wasteful to prefetch placeholder links that don't perform actual navigation.Apply this diff to make prefetch conditional:
<Link className="flex gap-2 items-center w-full" href={href ?? "#"} - prefetch={true} + prefetch={href !== undefined && href !== "#"} onClick={onClick} >Alternatively, update the MenuItem interface to accept an optional
prefetchprop so callers can control it explicitly based on whether the item has a real navigation href.
187-246: Optional: Update useMemo dependencies to includeuser.isPro.The
useMemohook has an empty dependency array but referencesuser.isPro(line 205). If the user upgrades to Pro during their session, the menu items won't update to hide the "Upgrade to Pro" option.Apply this diff to fix the dependency array:
], - []); + [user.isPro]);Note:
buildEnv.NEXT_PUBLIC_IS_CAPis likely a constant and doesn't need to be included in dependencies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by runningpnpm format.
Files:
apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g.,user-menu.tsx).
Use PascalCase for React/Solid components.
Files:
apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
apps/web/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
On the client, always use
useEffectQueryoruseEffectMutationfrom@/lib/EffectRuntime; never callEffectRuntime.run*directly in components.
Files:
apps/web/app/(org)/dashboard/_components/Navbar/Top.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). (3)
- GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
- GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
- GitHub Check: Analyze (rust)
Summary by CodeRabbit