forked from HeyPuter/puter
-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Labels
featureAuto-created labelAuto-created label
Description
Description
Currently, alert boxes only display warning-type dialogs. The system needs support for different alert types (info, success, error, question) with appropriate icons and styling, plus the ability to create custom popups with configurable buttons.
Current Behavior
- Alert boxes only show warning type
- Limited to default warning icon and styling
- Fixed button configuration
Expected Behavior
Alert system should support:
- Multiple alert types: Info, Success, Warning, Error, Question
- Type-specific icons: Each type displays an appropriate icon
- Custom popups: Ability to define custom UI and button configurations
- Flexible button options: Configurable number and labels of buttons
Use Cases
- Info alerts: Display informational messages (e.g., "File uploaded successfully")
- Success alerts: Confirm completed actions
- Error alerts: Show error messages with appropriate severity
- Question alerts: Prompt user decisions (e.g., "Save changes?")
- Custom dialogs: Build specialized popups for unique workflows
Proposed Solution
Implement an enhanced alert API that accepts:
type
parameter: 'info' | 'success' | 'warning' | 'error' | 'question'icon
parameter: Custom icon overridebuttons
parameter: Array of button configurationscustomUI
parameter: Optional custom content/layout
Example Usage
// Basic typed alert
puter.ui.alert({
type: 'success',
message: 'File uploaded successfully'
});
// Custom buttons
puter.ui.alert({
type: 'question',
message: 'Save changes before closing?',
buttons: ['Save', 'Don\'t Save', 'Cancel']
});
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Metadata
Metadata
Assignees
Labels
featureAuto-created labelAuto-created label