Skip to content

feat: replace alert() with toast notifications#150

Open
EricGrill wants to merge 1 commit intopbogre:mainfrom
EricGrill:feat/toast-notifications-final
Open

feat: replace alert() with toast notifications#150
EricGrill wants to merge 1 commit intopbogre:mainfrom
EricGrill:feat/toast-notifications-final

Conversation

@EricGrill
Copy link

Summary

  • Replaces all intrusive JavaScript alert() calls with toast notifications
  • Toasts appear in bottom-right corner and auto-dismiss after 5 seconds
  • Added success toasts for completed operations (compute connections, fetch airlines)
  • Supports error, success, and info toast types with appropriate styling

Changes

  • Created new Toast.tsx component with React Context for state management
  • Added global showToast() function for non-component code (api.ts)
  • Added CSS slide-in animation for toast appearance
  • Wrapped app in ToastProvider component

Closes #3

Test plan

  • Build succeeds with no TypeScript errors
  • Trigger API errors to verify error toasts appear
  • Run "Compute flight connections" to verify success toasts
  • Run "Fetch missing airlines" to verify success toasts
  • Verify toasts auto-dismiss after ~5 seconds
  • Verify toasts can be manually dismissed with X button

🤖 Generated with Claude Code

Replace intrusive JavaScript alert() calls with non-blocking toast
notifications that appear in the bottom-right corner and auto-dismiss
after 5 seconds.

Changes:
- Add Toast component with ToastProvider context
- Replace error alerts in api.ts with error toasts
- Replace success alerts in Settings.tsx with success toasts
- Replace error alerts in FetchConnection.tsx with error toasts
- Add slide-in animation for toast appearance

Fixes pbogre#3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pbogre
Copy link
Owner

pbogre commented Jan 14, 2026

Hey, thanks a lot for submitting these PRs! I will take a look as soon as I can, but be aware that I have final exams coming in the next couple weeks so I unfortunately wont have time to do this until after I finished them.

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.

Improve client-side handling of api errors

2 participants