8000 feat: migrate Alert component from MUI to shadcn by blink-so[bot] · Pull Request #18412 · coder/coder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: migrate Alert component from MUI to shadcn #18412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

blink-so[bot]
Copy link
Contributor
@blink-so blink-so bot commented Jun 17, 2025

Summary

This PR migrates the Alert component from MUI to shadcn implementation while maintaining full backward compatibility with the existing API.

Changes

Core Alert Component

  • Replaced MUI Alert with shadcn-based implementation using class-variance-authority
  • Maintained backward compatibility with all existing props:
    • severity (info, success, warning, error)
    • dismissible for showing dismiss button
    • actions for custom action buttons
    • onDismiss callback
  • Added proper Tailwind CSS styling with dark mode support
  • Preserved accessibility features with role="alert"
  • Kept smooth animations using MUI Collapse for consistency

Updated Imports

Updated 6 files that were importing AlertTitle from MUI to use our new implementation:

  • ChangeWorkspaceVersionDialog.tsx
  • ProvisionerAlert.tsx
  • GitDeviceAuth.tsx
  • OverviewPageView.tsx
  • Workspace.tsx
  • SetupPageView.tsx

Benefits

  • Zero breaking changes - all existing usage works without modification
  • Modern styling with Tailwind CSS instead of MUI styling system
  • Better customization through shadcn design system
  • Consistent with other shadcn components in the codebase
  • Improved maintainability with cleaner component structure

Testing

The component maintains the exact same API as before, so all existing tests should continue to pass. The styling has been updated to use Tailwind classes with proper color variants for each severity level.

Files Changed

  • site/src/components/Alert/Alert.tsx - Main Alert component migration
  • site/src/components/Alert/ErrorAlert.tsx - Updated import
  • 6 other files - Updated AlertTitle imports

This migration aligns with the project's move towards shadcn components and provides a more maintainable and customizable Alert system.

- Replace MUI Alert with shadcn-based implementation using class-variance-authority
- Maintain backward compatibility with existing Alert API (severity, dismissible, actions, onDismiss)
- Update AlertTitle imports across codebase to use new implementation
- Add proper Tailwind CSS styling with dark mode support
- Preserve accessibility features and smooth animations
- Support all existing severity levels: info, success, warning, error

Co-authored-by: jaaydenh <1858163+jaaydenh@users.noreply.github.com>
@jaaydenh jaaydenh self-assigned this Jun 18, 2025
@jaaydenh jaaydenh marked this pull request as draft June 18, 2025 13:27
blink-so bot and others added 2 commits June 18, 2025 16:44
Co-authored-by: jaaydenh <1858163+jaaydenh@users.noreply.github.com>
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.

1 participant
0