feat(flowchart): undo/redo toolbar buttons + history counter (C3)

The flowchart editor had Ctrl+Z / Ctrl+Shift+Z keyboard shortcuts
but no discoverable buttons. New History section in the side panel:
  - Undo / Redo buttons wired to _store.undo() / _store.redo()
  - Counter chip showing ↶/↷ availability
  - Buttons auto-disable when stacks are empty (via _store.canUndo()
    + canRedo() evaluated on every store subscription)

The store already exposed undo/redo/canUndo/canRedo — this commit
only adds the UI surface.

Amit Haridas
This commit is contained in:
Amit Haridas
2026-09-30 21:27:11 +05:30
parent 0bb1091c47
commit 4228ab78d8
2 changed files with 51 additions and 0 deletions
+19
View File
@@ -217,6 +217,18 @@
flex-wrap: wrap;
margin-bottom: 12px;
}
.fc-history-row {
display: flex;
gap: 8px;
align-items: center;
margin-bottom: 12px;
}
.fc-history-count {
margin-left: auto;
font-size: 11px;
color: var(--fc-border);
font-variant-numeric: tabular-nums;
}
.fc-ul {
list-style: none;
padding: 0;
@@ -323,6 +335,13 @@
Save to File button alongside Insert at Cursor.
-->
<div id="fc-nodelist" class="fc-nodelist">
<h3 class="fc-section-title">History</h3>
<div class="fc-history-row">
<button class="fc-btn" id="fc-btn-undo" title="Undo (Ctrl+Z)">↶ Undo</button>
<button class="fc-btn" id="fc-btn-redo" title="Redo (Ctrl+Shift+Z)">↷ Redo</button>
<span class="fc-history-count" id="fc-history-count" aria-live="polite">0</span>
</div>
<h3 class="fc-section-title">Add Node</h3>
<div class="fc-add-row">
<button class="fc-btn" data-add="process">+ Process</button>