feat: add undo/redo/reset editor tools with keyboard shortcuts

- Add history extension to CodeMirror for undo/redo support
- Ctrl+Z for undo, Ctrl+Shift+Z for redo now work
- Add toolbar buttons: ↶ Undo, ↷ Redo, ⟲ Reset
- Reset button restores editor to initial lesson code
- Add .btn-icon and .editor-tools CSS styles
This commit is contained in:
2025-12-23 23:14:32 +01:00
parent 2ef2bc59f5
commit 34659a1c85
4 changed files with 75 additions and 2 deletions

View File

@@ -712,6 +712,27 @@ code, kbd {
font-size: 0.8rem;
}
.btn-icon {
padding: 4px 8px;
font-size: 1rem;
min-width: 32px;
background: transparent;
color: var(--light-text);
border: 1px solid var(--border-color);
}
.btn-icon:hover {
background: var(--bg-color);
color: var(--text-color);
border-color: var(--primary-color);
}
.editor-tools {
display: flex;
gap: 4px;
margin-right: var(--spacing-sm);
}
.btn-ghost {
background: transparent;
color: var(--light-text);