Phase 7: Undo/Redo

- History tracking with 50-state limit in useDesignEditor hook
- Undo: Ctrl/Cmd + Z keyboard shortcut
- Redo: Ctrl/Cmd + Shift + Z or Ctrl/Cmd + Y
- Undo/Redo buttons in canvas header
- History saves state after add, update, delete, reorder operations
- Disabled button states when history is exhausted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Khalid A
2026-04-21 01:27:51 -05:00
parent 72495fec3e
commit 537cfd572d
3 changed files with 178 additions and 15 deletions

View File

@@ -102,16 +102,57 @@ input, textarea, select {
.app-title {
font-size: 1.5rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
margin: 0 0 0.25rem 0;
color: var(--text-primary);
}
.app-subtitle {
color: var(--text-secondary);
margin: 0 0 1.5rem 0;
margin: 0;
font-size: 0.875rem;
}
.canvas-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 1rem;
width: 100%;
max-width: 400px;
}
.undo-redo-buttons {
display: flex;
gap: 0.5rem;
}
.icon-btn {
padding: 0.5rem 0.75rem;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-size: 0.75rem;
cursor: pointer;
transition: all 0.2s;
color: var(--text-secondary);
}
.icon-btn:hover:not(:disabled) {
background: var(--accent);
border-color: var(--accent);
color: white;
}
.icon-btn.disabled {
opacity: 0.4;
cursor: not-allowed;
}
.icon-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.canvas-wrapper {
margin-bottom: 1rem;
}