diff --git a/frontend/src/components/simulator/ComponentPropertyDialog.css b/frontend/src/components/simulator/ComponentPropertyDialog.css index a0a0f2bc..bb40c739 100644 --- a/frontend/src/components/simulator/ComponentPropertyDialog.css +++ b/frontend/src/components/simulator/ComponentPropertyDialog.css @@ -272,6 +272,20 @@ display: flex; gap: 8px; margin-top: 8px; + align-items: center; + flex-wrap: wrap; +} + +/* Inline confirm prompt that replaces the Rotate / Delete pair while a + delete is armed. The label takes the full width above the two action + buttons on narrow widths so nothing gets cut off. */ +.property-confirm-label { + flex-basis: 100%; + font-size: 12px; + color: #f5b342; + font-weight: 500; + text-align: center; + padding: 2px 0 4px; } .property-action-button { diff --git a/frontend/src/components/simulator/ComponentPropertyDialog.tsx b/frontend/src/components/simulator/ComponentPropertyDialog.tsx index 273d3fce..20aab4f3 100644 --- a/frontend/src/components/simulator/ComponentPropertyDialog.tsx +++ b/frontend/src/components/simulator/ComponentPropertyDialog.tsx @@ -55,6 +55,10 @@ export const ComponentPropertyDialog: React.FC = ( }) => { const dialogRef = useRef(null); const [dialogPosition, setDialogPosition] = useState({ x: 0, y: 0 }); + // Two-step delete: first click arms the action (footer flips to a + // "Delete X?" confirm prompt), second click commits. Replaces the old + // window.confirm() call which was visually jarring on mobile. + const [confirmingDelete, setConfirmingDelete] = useState(false); // Calculate dialog position on mount — clamp within canvas viewport useEffect(() => { @@ -238,26 +242,49 @@ export const ComponentPropertyDialog: React.FC = ( {/* /component-property-body */} - {/* Action Buttons */} + {/* Action Buttons — flips into a confirm-delete prompt when armed. */}
- - + {confirmingDelete ? ( + <> + + Delete {componentMetadata.name}? + + + + + ) : ( + <> + + + + )}
);