Skip to content

Replace Localized Notification Banners with a Global Toast System #254

Description

@arpit2006

Type

UX & Architecture

Severity

Medium

Location

frontend/src/app/pages/dashboard.tsx (around lines 114–130)

Description

The ExportReportButton component implements success and error notifications using locally rendered elements positioned absolutely relative to the button. These notifications are tightly coupled to the component instead of being managed through a centralized, application-wide toast provider.

Because the notification is rendered within the component's layout hierarchy, it is susceptible to clipping, stacking context (z-index) conflicts, and overflow: hidden containers. This makes notification visibility dependent on where the component is rendered.

A centralized toast system provides a more reliable, reusable, and consistent notification experience across the application.


User Impact

  • Success or error messages may be partially or completely hidden.
  • Notifications can be clipped by parent containers with overflow: hidden.
  • Inconsistent notification behavior across different layouts.
  • Reduced visibility of important user feedback.

Steps to Reproduce

  1. Render the ExportReportButton inside a container with overflow: hidden or a restrictive stacking context.
  2. Trigger a success or error notification.
  3. Observe that the notification may be clipped, partially visible, or hidden behind other UI elements.

Expected Behavior

Notifications should appear consistently above the application's UI regardless of where the triggering component is rendered.


Current Behavior

  • Notifications are rendered locally within the component.
  • Positioning depends on the parent layout.
  • Visibility can be affected by container overflow and stacking contexts.

Recommended Fix

Replace the localized notification implementation with a centralized toast notification system.

Possible improvements include:

  • Integrate a global toast library such as Sonner or React Hot Toast.
  • Render notifications through a single top-level provider.
  • Standardize success, error, warning, and informational toast styles across the application.
  • Keep notification logic separate from component layout.

Acceptance Criteria

  • Local notification markup is removed from ExportReportButton.
  • A global toast provider is used for success and error notifications.
  • Toasts appear above all application content regardless of layout.
  • Notifications are not clipped by parent containers.
  • Existing notification behavior is preserved.
  • Notification styling remains consistent throughout the application.

Definition of Done

  • Global toast library integrated.
  • ExportReportButton migrated to the global toast API.
  • Notification behavior verified across multiple layouts.
  • No clipping or z-index issues observed.
  • Regression testing completed.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions