**Problem 1: Validation footer covers mobile menu** - Fixed bottom validation panel (z-index 1000) overlapped mobile nav - Solution: Removed bottom panel, added inline validation in config panel header **Problem 2: Alert dialogs for save success** - alert() blocks UI and requires OK click for every save - Solution: Toast notifications (auto-close after 3s, non-blocking) **Problem 3: Validation shows only counts, not details** - Footer showed "1 Error, 2 Warnings" without details - Solution: Inline display shows all error/warning messages with click-to-navigate **New Components:** - Toast.jsx: Auto-closing notifications (success/error/warning/info) - ConfirmDialog.jsx: Modal confirmation dialogs (for future save-on-close) **Changes:** - WorkflowEditorPage: Inline validation in config panel, toast state - Removed fixed bottom .validation-panel (no mobile overlap) - Toast for save success instead of alert() **Still TODO (separate commit):** - Save confirmation when closing/switching nodes with unsaved changes - Dirty state tracking Part 3: Inline Prompts - UX polish (validation + notifications)
107 lines
2.4 KiB
React
107 lines
2.4 KiB
React
/**
|
|
* ConfirmDialog Component
|
|
*
|
|
* Modal confirmation dialog
|
|
*
|
|
* Props:
|
|
* - message: string
|
|
* - onConfirm: callback when confirmed
|
|
* - onCancel: callback when cancelled
|
|
* - confirmText: string (default: 'OK')
|
|
* - cancelText: string (default: 'Abbrechen')
|
|
* - type: 'warning' | 'danger' | 'info' (default: 'warning')
|
|
*/
|
|
export function ConfirmDialog({
|
|
message,
|
|
onConfirm,
|
|
onCancel,
|
|
confirmText = 'OK',
|
|
cancelText = 'Abbrechen',
|
|
type = 'warning'
|
|
}) {
|
|
const colors = {
|
|
warning: '#FFC107',
|
|
danger: 'var(--danger)',
|
|
info: 'var(--accent)'
|
|
}
|
|
|
|
return (
|
|
<div
|
|
style={{
|
|
position: 'fixed',
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
background: 'rgba(0,0,0,0.5)',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
zIndex: 20000
|
|
}}
|
|
onClick={onCancel}
|
|
>
|
|
<div
|
|
style={{
|
|
background: 'var(--surface)',
|
|
borderRadius: '12px',
|
|
padding: '24px',
|
|
maxWidth: '500px',
|
|
width: '90%',
|
|
boxShadow: '0 8px 24px rgba(0,0,0,0.3)'
|
|
}}
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
<div
|
|
style={{
|
|
fontSize: '16px',
|
|
marginBottom: '24px',
|
|
color: 'var(--text1)',
|
|
lineHeight: '1.5'
|
|
}}
|
|
>
|
|
{message}
|
|
</div>
|
|
|
|
<div
|
|
style={{
|
|
display: 'flex',
|
|
gap: '12px',
|
|
justifyContent: 'flex-end'
|
|
}}
|
|
>
|
|
<button
|
|
onClick={onCancel}
|
|
style={{
|
|
padding: '8px 16px',
|
|
border: '1px solid var(--border)',
|
|
borderRadius: '6px',
|
|
background: 'var(--surface2)',
|
|
color: 'var(--text1)',
|
|
cursor: 'pointer',
|
|
fontSize: '14px'
|
|
}}
|
|
>
|
|
{cancelText}
|
|
</button>
|
|
<button
|
|
onClick={onConfirm}
|
|
style={{
|
|
padding: '8px 16px',
|
|
border: 'none',
|
|
borderRadius: '6px',
|
|
background: colors[type],
|
|
color: type === 'warning' ? '#000' : 'white',
|
|
cursor: 'pointer',
|
|
fontSize: '14px',
|
|
fontWeight: 500
|
|
}}
|
|
>
|
|
{confirmText}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|