Skip to content

fix: improve snackbar visibility and add color-aware message types#390

Open
markadelnawar wants to merge 1 commit intogoogle:mainfrom
markadelnawar:fix/snackbar-visibility-and-types
Open

fix: improve snackbar visibility and add color-aware message types#390
markadelnawar wants to merge 1 commit intogoogle:mainfrom
markadelnawar:fix/snackbar-visibility-and-types

Conversation

@markadelnawar
Copy link
Copy Markdown

@markadelnawar markadelnawar commented Feb 23, 2026

Summary

Fixes #389

This PR improves snackbar visibility and adds color-aware message types to help users quickly
identify the severity of notifications.

Problem

Before:
Screenshot 2026-02-23 at 2 23 08 AM

Issues:

  1. Snackbar button text was not visible in dark mode due to poor contrast
  2. All message types (error, success, warning, info) appeared identical
  3. Users couldn't quickly identify message severity at a glance

Solution

After:

Screenshot 2026-02-23 at 2 16 06 AM Screenshot 2026-02-23 at 2 13 42 AM Screenshot 2026-02-23 at 2 21 04 AM

Changes:

  1. Custom snackbar styling (src/styles.scss)

    • Added theme-aware CSS variables for proper contrast
    • Fixed button text visibility in both light and dark modes
    • Added color-specific styles for each message type
  2. Shared constants (src/app/core/constants/snackbar.constants.ts)

    • Created SnackbarType enum with ERROR, SUCCESS, WARNING, INFO
    • Made reusable across all components
    • Provides type safety and autocomplete
  3. Updated chat component (src/app/components/chat/chat.component.ts)

    • Updated openSnackBar() signature to accept SnackbarType
    • Categorized all 13+ snackbar calls with appropriate types:
      • Errors: stream errors, loading failures, parsing errors
      • Success: "Session imported", "Eval case updated/deleted"
      • Warning: BIDI streaming restart warnings
      • Info: default fallback

Testing

Tested in both light and dark modes , browsers ( safari , chrome) :

  • Error messages show red background with white text
  • Success messages show green background with white text
  • Warning messages show orange background with theme text
  • Info messages show default theme background
  • Button text is visible in all themes
  • All existing snackbar calls work correctly

Files Changed

  • src/styles.scss - Custom snackbar styles with color types
  • src/app/core/constants/snackbar.constants.ts - New shared constants
  • src/app/components/chat/chat.component.ts - Updated method and all calls

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.

Fix snackbar visibility and add color-aware message types

1 participant