Skip to content

Fix/toast notifications - #225

Open
ayushchaudhari562 wants to merge 6 commits into
SHAURYASANYAL3:mainfrom
ayushchaudhari562:fix/toast-notifications
Open

Fix/toast notifications#225
ayushchaudhari562 wants to merge 6 commits into
SHAURYASANYAL3:mainfrom
ayushchaudhari562:fix/toast-notifications

Conversation

@ayushchaudhari562

@ayushchaudhari562 ayushchaudhari562 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request addresses issue #200 by replacing standard browser-default alert() calls with styled, non-blocking toast notifications.

Details

  • Imported the project's standard custom toast library (sonner) in BookDemo.tsx.
  • Replaced the native browser-popup alert() calls with toast.error() notifications for handling data transmission errors and network connection errors when booking a briefing.

Verification

  • Build Verification (npm run build): Compiles successfully without errors.
  • Unit Tests (npm run test): All 13 unit tests passed successfully.

Summary by CodeRabbit

  • New Features

    • Added tooltips to platform nodes in the Digital Footprint Map displaying node information.
  • Improvements

    • Enhanced error notifications in the booking form—error messages now appear as non-blocking notifications instead of blocking alerts.
  • Chores

    • Updated multiple dependencies for stability and performance improvements.

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

@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-tools

ecc-tools Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added Area: Github Actions 🤖 Workflows, Automations Area: Config ⚙️ Package.json, Vite, Tailwind Area: Frontend 🎨 UI, Components, Pages labels Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ayushchaudhari562, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27e78cda-7969-4c89-a42f-95a750f74bc0

📥 Commits

Reviewing files that changed from the base of the PR and between c03fa5a and d2403a5.

📒 Files selected for processing (1)
  • src/pages/BookDemo.tsx
📝 Walkthrough

Walkthrough

Adds tooltip UI to DigitalFootprintMap platform nodes, switches BookDemo form error reporting from alert() to toast.error(), bumps multiple runtime and dev dependencies with an esbuild override, removes the commitlint titlePattern regex, and reformats contributors.json badge arrays to single-line form.

Changes

Frontend UI changes

Layer / File(s) Summary
DigitalFootprintMap node tooltips
src/components/DigitalFootprintMap.tsx
Imports Tooltip, TooltipContent, TooltipProvider, and TooltipTrigger from @/components/ui/tooltip and wraps each platform node button in tooltip infrastructure displaying the node id.
BookDemo toast error notifications
src/pages/BookDemo.tsx
Adds toast import from sonner and replaces both alert() calls in handleSubmit (Supabase insertion error and network catch) with toast.error() calls.

Config, dependency, and data updates

Layer / File(s) Summary
Dependency version bumps and esbuild override
package.json
Updates version pins for @radix-ui/*, @sentry/*, jspdf, posthog-*, react, react-hook-form, @types/node, lint-staged, postcss, typescript, typescript-eslint, and vite; adds a top-level overrides block pinning esbuild to 0.28.1.
Remove commitlint titlePattern override
.github/workflows/commitlint.yml
Removes the explicit titlePattern regex from the PR title linting workflow, leaving only the types list to govern validation.
Reformat contributors.json badge arrays
src/data/contributors.json
Collapses multi-line badges arrays to single-line form for ten contributor entries and adjusts the closing bracket formatting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • SHAURYASANYAL3/E-vara#223: Updates the same package.json dependency version pins and introduces the identical overrides entry forcing esbuild to 0.28.1.

Suggested labels

Area: Github Actions 🤖, Area: Config ⚙️, Area: Frontend 🎨

🐇 A tooltip here, a toast right there,
Alerts turned gentle, floating in air!
Dependencies bumped with a hoppy cheer,
Badges now tidy — the JSON is clear.
The commitlint loosened, patterns set free —
What a delightful spring patch from me! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Fix/toast notifications' is partially related to the changeset but overly broad and vague, failing to clearly summarize the main change. Consider using a more specific title like 'Replace alert dialogs with toast notifications in BookDemo' to clearly convey the primary change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/components/DigitalFootprintMap.tsx (1)

74-92: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider removing the redundant TooltipProvider.

A TooltipProvider already exists at the app root level (in App.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 win

Import toast from the project wrapper for consistency.

The project has a wrapper at @/components/ui/sonner that re-exports toast with configured defaults. Importing directly from sonner bypasses 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 | 🔵 Trivial

Update forwardRef usage to align with React 19 API changes.

React 19 deprecates forwardRef in favor of passing ref as a regular component prop. While forwardRef remains 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.17 and @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-recipe

Additionally, replace the single React.FC instance in src/providers/SimulationProvider.tsx with a regular function component, as React.FC is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 41b0a1e and c03fa5a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/commitlint.yml
  • package.json
  • src/components/DigitalFootprintMap.tsx
  • src/data/contributors.json
  • src/pages/BookDemo.tsx
💤 Files with no reviewable changes (1)
  • .github/workflows/commitlint.yml

Comment thread src/pages/BookDemo.tsx Outdated
@ayushchaudhari562
ayushchaudhari562 force-pushed the fix/toast-notifications branch from c03fa5a to e607e6d Compare June 21, 2026 20:26
@ecc-tools

ecc-tools Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@ecc-tools

ecc-tools Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@ayushchaudhari562

Copy link
Copy Markdown
Contributor Author

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!

@github-actions

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Config ⚙️ Package.json, Vite, Tailwind Area: Frontend 🎨 UI, Components, Pages Area: Github Actions 🤖 Workflows, Automations stale 🕒

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants