Commit afff47b
Feature #1: Save/Load Design
- saveDesign() - Exports topology to timestamped JSON file
- loadDesign() - Imports topology from JSON file with validation
- Auto-save every 30 seconds to localStorage
- Auto-recovery prompt on page load if autosave exists
- Save/Load buttons in navigation (right-aligned)
- Preserves all node properties (position, config, resources)
- Preserves all connections with full details
User Experience:
- "💾 Save" button - Downloads JSON with timestamp
- "📂 Load" button - File picker to import design
- Confirmation dialog before replacing current design
- Success alerts with component/connection counts
- Auto-save notification in console every 30s
- Recovery prompt shows save timestamp and stats
Feature #2: Live Preview of Generated Files
- updateLivePreviews() - Populates text editors in Contractiles page
- Updates Justfile, Mustfile, Trustfile, Dustfile editors
- Real-time updates when topology changes
- Triggered when nodes added or Contractiles page shown
- notifyTopologyChange() calls both updateLivePreviews() and autoSave()
Integration:
- createNode() calls notifyTopologyChange()
- showPage('contractiles') triggers updateLivePreviews()
- File generators now serve dual purpose (download + preview)
- Users can edit generated content before downloading
Technical Details:
- Design JSON structure: version, timestamp, metadata, nodes, connections
- localStorage keys: stapeln_autosave, stapeln_last_design, stapeln_last_save
- Auto-save interval: 30 seconds
- Recovery check: 1 second after page load
- File selectors: .code-editor within tab IDs
Benefits:
- Designs are now persistent and shareable
- No more lost work from browser refresh
- Live preview lets users see/edit before download
- Auto-save provides crash recovery
- JSON format enables version control
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 1dd41b8 commit afff47b
345 files changed
Lines changed: 18656 additions & 12638 deletions
File tree
- frontend
- ffi/zig
- .zig-cache
- h
- o/1ad6ac9ff87a7858f75793812ffcc69e
- z
- src
- lib
- bs/src
- ocaml
- node_modules
- @rescript/react/lib
- bs/src
- v3
- ocaml
- rescript-tea
- src
- rescript-webapi
- src
- Webapi
- Canvas
- Dom
- Fetch
- ResizeObserver
- src
- abi
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 837 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
0 commit comments