Skip to content

Implement Error Toasts#357

Open
PauloMFJ wants to merge 31 commits into
datacommonsorg:mainfrom
madebypxlp:paulo/error-toasts
Open

Implement Error Toasts#357
PauloMFJ wants to merge 31 commits into
datacommonsorg:mainfrom
madebypxlp:paulo/error-toasts

Conversation

@PauloMFJ

@PauloMFJ PauloMFJ commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds a lightweight in-house toaster (foundations/toaster) based on Sonner.

  • Stacked toasts that collapse into a scaled pile and fan out on hover/focus, with enter/exit animations and pause-on-interaction
  • Click anywhere to dismiss (keyboard-accessible) + auto-dismiss timer
  • a11y: labelled aria-live region, per-toast dismiss labels, focus-aware expand/pause
  • Reduced motion: identical behaviour, just without durations
  • Adds toaster-* color tokens, a type-headline mixin, and a $z-index-toaster token
  • Fixes the card export / view-chart actions (onclick → onClick) that silently never fired

Screenshots

image image

@PauloMFJ PauloMFJ self-assigned this Jun 8, 2026
@PauloMFJ PauloMFJ marked this pull request as draft June 8, 2026 12:13

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a stacked Toaster notification system, adds zoom and tool Controls to the Atlas editor, updates the Button component to support multiple sizes, and introduces several new icons and color tokens. Feedback on these changes highlights critical issues: in toaster.tsx, the container height calculation when collapsed creates an invisible pointer-blocking area, and the heights state suffers from a memory leak as dismissed toast heights are never cleaned up. Additionally, in atlas.tsx, a CSS variable is incorrectly used for canvas rendering where static RGB values are required, and in button.tsx, making the new size prop required introduces a breaking change that should be resolved by making it optional with a default value.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread dataweaver/apps/web/src/components/foundations/toaster.tsx
Comment thread dataweaver/apps/web/src/components/scopes/atlas/atlas.tsx Outdated
Comment thread dataweaver/apps/web/src/components/foundations/toaster.tsx
Comment thread dataweaver/apps/web/src/components/elements/button.tsx
Comment thread dataweaver/apps/web/src/components/elements/button.tsx
@PauloMFJ PauloMFJ force-pushed the paulo/error-toasts branch from b1b8ab3 to 936ad05 Compare June 9, 2026 09:13
@PauloMFJ PauloMFJ marked this pull request as ready for review June 9, 2026 09:13

@nick-nlb nick-nlb 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.

We can discuss the bigger comment and keep it for another PR, but otherwise the one smaller behavioral comment.

Do you mind also taking some screenshots and including them in the description here, and then pinging miss-o-soup to have a look (in case this is completely new UI/UX). Alternatively, since we're meeting tomorrow anyway, you could give it a demo then.

Comment thread dataweaver/apps/web/src/components/foundations/toaster/toaster.tsx
}

/** Singleton store instance used to manage toasts across the app. */
export const TOAST_STORE = new ToastStore();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

While this currently looks safe as it is because it only ever gets used on the client side, it feels fragile to rely on module state. If toast is ever called accidentally during a server-side render, we could get cross-request contamination.

There's no case of that now, but thinking forward both in terms of this app, but also in terms of reuse of the toast library later (where it might be more of an issue).

What do you think of moving the toast functionality to a React context and completely decoupling it from the server? (This would be a fairly big refactor and so could be a separate PR). In the meantime we could put a guard that prevents toasts from being added if window isn't present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered using a React context but actually ended up choosing this path to match closer to Sonner's implementation + general DX improvements over needing hook. Happy to put in a guard to prevent toasts being added if window isn't present in the meantime.

Happy to review / move towards context later if it becomes an issue?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants