Fix/toast notifications - #225
Conversation
|
@ayushchaudhari562 is attempting to deploy a commit to the shauryasanyal3's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
Welcome to E-VARA! 🚀 Thank you for your first pull request! We deeply appreciate your contribution to identity intelligence. A maintainer will review your code soon. |
|
Warning Review limit reached
More reviews will be available in 45 minutes and 23 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds tooltip UI to ChangesFrontend UI changes
Config, dependency, and data updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 (3)
src/components/DigitalFootprintMap.tsx (1)
74-92: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider removing the redundant TooltipProvider.
A
TooltipProvideralready exists at the app root level (inApp.tsx), so wrapping these tooltips in another provider is unnecessary. Radix tooltips will work correctly using the existing app-level provider.♻️ Proposed simplification
- <TooltipProvider> - {platformNodes.map((node) => ( - <Tooltip key={node.id}> + {platformNodes.map((node) => ( + <Tooltip key={node.id}> + <TooltipTrigger asChild> <button - type="button" - onClick={() => setSelectedNode(node)} - className={`node-platform absolute -translate-x-1/2 -translate-y-1/2 rounded-full border border-white/10 bg-surface/90 px-3 py-1 text-[9px] font-mono text-foreground hover:border-primary/50 transition-all ${selectedNode.id === node.id ? "border-primary/60 security-orange-glow" : ""}`} - style={{ left: `${node.x}%`, top: `${node.y}%` }} + type="button" + onClick={() => setSelectedNode(node)} + className={`node-platform absolute -translate-x-1/2 -translate-y-1/2 rounded-full border border-white/10 bg-surface/90 px-3 py-1 text-[9px] font-mono text-foreground hover:border-primary/50 transition-all ${selectedNode.id === node.id ? "border-primary/60 security-orange-glow" : ""}`} + style={{ left: `${node.x}%`, top: `${node.y}%` }} > - {node.label} - </button> - </TooltipTrigger> - <TooltipContent className="bg-popover border border-border text-[9px] font-mono py-1 px-2 text-foreground"> - <p>Node ID: {node.id}</p> - </TooltipContent> - </Tooltip> - ))} - </TooltipProvider> + {node.label} + </button> + </TooltipTrigger> + <TooltipContent className="bg-popover border border-border text-[9px] font-mono py-1 px-2 text-foreground"> + <p>Node ID: {node.id}</p> + </TooltipContent> + </Tooltip> + ))}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/DigitalFootprintMap.tsx` around lines 74 - 92, Remove the redundant TooltipProvider wrapper since the app already has a TooltipProvider at the root level in App.tsx. Delete the opening TooltipProvider tag and the closing TooltipProvider tag that wrap the platformNodes.map call, but keep the Tooltip component and its children (TooltipTrigger and TooltipContent) intact. The tooltip functionality will continue to work correctly using the existing app-level provider.src/pages/BookDemo.tsx (1)
19-19: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winImport toast from the project wrapper for consistency.
The project has a wrapper at
@/components/ui/sonnerthat re-exportstoastwith configured defaults. Importing directly fromsonnerbypasses this abstraction and makes the code inconsistent with the project's pattern.♻️ Proposed fix
-import { toast } from "sonner"; +import { toast } from "`@/components/ui/sonner`";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/BookDemo.tsx` at line 19, The toast import in the BookDemo.tsx file is importing directly from the 'sonner' package instead of using the project's wrapper module. Change the import statement to import toast from '`@/components/ui/sonner`' instead of 'sonner'. This ensures the import uses the project's abstraction layer that provides configured defaults for consistency across the codebase.package.json (1)
75-77: 🧹 Nitpick | 🔵 TrivialUpdate
forwardRefusage to align with React 19 API changes.React 19 deprecates
forwardRefin favor of passingrefas a regular component prop. WhileforwardRefremains functional for backward compatibility, the codebase extensively uses this deprecated pattern across ~60 UI components (src/components/ui/).The TypeScript types have been correctly updated to
@types/react@^19.2.17and@types/react-dom@^19.2.3, and the JSX transform is properly configured via Vite's React plugin. However, to fully align with React 19 conventions and eliminate deprecation warnings, run:npx codemod@latest react/19/migration-recipeAdditionally, replace the single
React.FCinstance insrc/providers/SimulationProvider.tsxwith a regular function component, asReact.FCis also deprecated in React 19.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 75 - 77, Update the codebase to align with React 19 API changes by running the React 19 migration codemod which will automatically convert the ~60 UI components in src/components/ui/ from using deprecated forwardRef pattern to accepting ref as a regular component prop. Additionally, manually replace the React.FC type annotation in SimulationProvider.tsx with a regular function component declaration, as React.FC is also deprecated in React 19.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/BookDemo.tsx`:
- Around line 60-64: In the catch block of the error handling in BookDemo.tsx,
replace the `any` type with `unknown` for the error parameter. Change `catch
(error: any)` to `catch (error: unknown)`. The `unknown` type provides better
type safety while maintaining the same functionality since the error is only
being passed to the log function which accepts Record<string, unknown>.
---
Nitpick comments:
In `@package.json`:
- Around line 75-77: Update the codebase to align with React 19 API changes by
running the React 19 migration codemod which will automatically convert the ~60
UI components in src/components/ui/ from using deprecated forwardRef pattern to
accepting ref as a regular component prop. Additionally, manually replace the
React.FC type annotation in SimulationProvider.tsx with a regular function
component declaration, as React.FC is also deprecated in React 19.
In `@src/components/DigitalFootprintMap.tsx`:
- Around line 74-92: Remove the redundant TooltipProvider wrapper since the app
already has a TooltipProvider at the root level in App.tsx. Delete the opening
TooltipProvider tag and the closing TooltipProvider tag that wrap the
platformNodes.map call, but keep the Tooltip component and its children
(TooltipTrigger and TooltipContent) intact. The tooltip functionality will
continue to work correctly using the existing app-level provider.
In `@src/pages/BookDemo.tsx`:
- Line 19: The toast import in the BookDemo.tsx file is importing directly from
the 'sonner' package instead of using the project's wrapper module. Change the
import statement to import toast from '`@/components/ui/sonner`' instead of
'sonner'. This ensures the import uses the project's abstraction layer that
provides configured defaults for consistency across the codebase.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cc684127-6722-417f-bb90-53e67167406e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
.github/workflows/commitlint.ymlpackage.jsonsrc/components/DigitalFootprintMap.tsxsrc/data/contributors.jsonsrc/pages/BookDemo.tsx
💤 Files with no reviewable changes (1)
- .github/workflows/commitlint.yml
c03fa5a to
e607e6d
Compare
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
I have replaced the standard browser alert() popups with Sonner toast notifications in BookDemo.tsx. Note: I only updated BookDemo.tsx because the admin/SOC portal (AnalystConsole.tsx) was already using Sonner toasts, making BookDemo.tsx the only file in the codebase still using standard JS alert() calls. Let me know if you run into any issues during review! |
|
This PR has been quiet for a while and is marked as stale. Please let us know if it is still ready for review! It will be closed in 7 days if there is no activity. |
Summary of Changes
This pull request addresses issue #200 by replacing standard browser-default
alert()calls with styled, non-blocking toast notifications.Details
sonner) in BookDemo.tsx.alert()calls withtoast.error()notifications for handling data transmission errors and network connection errors when booking a briefing.Verification
npm run build): Compiles successfully without errors.npm run test): All 13 unit tests passed successfully.Summary by CodeRabbit
New Features
Improvements
Chores