Commit graph

124 commits

Author SHA1 Message Date
Jan-Henrik Bruhn
d7d91798f1 feat: add crispy PNG/SVG graph export with tight cropping 🔥
Implemented image export functionality using html-to-image that actually
slaps. No more bloated screenshots with miles of blank space - this baby
wraps your graph tighter than shrink wrap on a fresh deck.

Features:
- PNG export with proper 300 DPI quality (4x pixelRatio)
- SVG vector export for infinite scaling
- Smart bounds calculation that hugs your nodes
- Configurable padding (default: 10px of breathing room)
- Accessible via File menu

Technical highlights:
- Direct transform calculation instead of getViewportForBounds bloat
- Proper pixelRatio handling (not that 16x scaling nonsense)
- Based on React Flow's official pattern but actually optimized
- Uses html-to-image@1.11.11 (newer versions are broken)

Export quality goes hard. Print-ready PNGs. Crisp. Clean. Chef's kiss.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 23:01:33 +02:00
Jan-Henrik Bruhn
e778b29b56 feat: centralize keyboard shortcuts through shortcut manager
All keyboard shortcut labels in the MenuBar now come from the
centralized keyboard shortcut manager via the new useShortcutLabels
hook, eliminating hardcoded duplicates.

Changes:
- Add useShortcutLabels hook for retrieving formatted shortcut labels
- Update MenuBar to use dynamic shortcut labels from manager
- Platform-aware display (Cmd on Mac, Ctrl elsewhere)
- Shortcuts automatically update if changed in manager
- Fix MUI icon fontSize prop issue in LeftPanel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:38:28 +02:00
Jan-Henrik Bruhn
cd1a93f88f feat: display actor type icons in left panel add buttons
Replace generic circle icons with the actual node type icons in the
left panel's "Add Actors" section. Icons now match the visual
representation of actors in the graph, making it more intuitive to
identify actor types. Falls back to circle if no icon is defined.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:31:56 +02:00
Jan-Henrik Bruhn
38cae3cdd9 fix: whoopsie doopsie accident - correct onAddNodeRequest type signature
Fixed TypeScript error where onAddNodeRequest callback parameter type
was incorrectly defined. The prop expects a function that receives a
callback, not the node type ID directly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:29:45 +02:00
Jan-Henrik Bruhn
f308edbfa6 fix: replace any types with explicit function signatures
Replace TypeScript 'any' types with explicit function signatures to fix ESLint errors. This improves type safety for the onAddNodeRequest callback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:20:47 +02:00
Jan-Henrik Bruhn
d6f5938c9c refactor: remove edit properties from context menus
Removed the "Edit Properties" option from both node and edge context menus,
leaving only the "Delete" option. Users can simply click on nodes/edges to
select them and edit properties in the right panel, making the context menu
option redundant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:17:23 +02:00
Jan-Henrik Bruhn
ae334efd34 refactor: move undo/redo to toolbar, simplify left panel
Reorganized the UI to improve clarity and reduce duplication:
- Reintroduced Toolbar component below document tabs
- Moved undo/redo controls from left panel to toolbar
- Simplified toolbar to show only undo/redo (removed actor/relation controls)
- Removed History section from left panel
- Left panel now focuses on content management (actors, relations, etc.)

The toolbar now provides a consistent, always-visible location for history
controls across the top of the editor, while the left panel is dedicated to
adding and managing graph content.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:16:05 +02:00
Jan-Henrik Bruhn
5aeb187efe fix: ensure only newly created items are selected
Fixed selection state inconsistency when adding nodes or edges. Previously,
both the new item and previously selected items would remain selected due to
a race condition between Zustand store updates and ReactFlow state syncing.

Changes:
- Added pendingSelectionRef to track items that should be selected after
  Zustand sync completes
- Modified useEffect sync logic to preserve selection state normally, but
  apply pending selection when new items are added
- Unified node creation logic between context menu and left panel to ensure
  consistent behavior
- When adding nodes/edges, all other items are now properly deselected

The fix ensures selection state lives only in ReactFlow (not Zustand) and
is properly coordinated during store updates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 22:12:12 +02:00
Jan-Henrik Bruhn
8d8ff2d200 fix: dont show anything in pane if more than one item is selected 2025-10-10 19:43:54 +02:00
Jan-Henrik Bruhn
79edc902c5 fix: remove unused variables 2025-10-10 18:14:05 +02:00
Jan-Henrik Bruhn
e7ff53dcd7 feat: side panels for properties and tools 2025-10-10 18:13:18 +02:00
Jan-Henrik Bruhn
09b62c69bd fix: clear graph editor when no document is active
Fixes an issue where nodes from a previous document would persist when
creating a new document after closing all documents.

The problem occurred because:
1. When all documents were closed (activeDocumentId becomes null), the
   graph store wasn't being cleared
2. When a new document was created, stale data from the old document
   could contaminate the new document through race conditions

Changes:
- Clear nodes and edges from graph store when activeDocumentId is null
- Add safeguard to prevent saving stale graph data to newly created
  documents before they've been fully loaded
- Maintain proper state tracking to prevent cross-document contamination

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 16:54:40 +02:00
Jan-Henrik Bruhn
99ab514c0c fix: prevent cross-document state contamination in useActiveDocument
Added lastSyncedStateRef to track the graph state that was last loaded/synced
for each document. This prevents stale comparisons when switching between
documents by ensuring dirty checks only run against the correct document's
state.

Changes:
- Track last synced state (nodes, edges, nodeTypes, edgeTypes) per document
- Skip dirty check if graph state belongs to a different document
- Compare current graph state against last synced state instead of active document
- Update last synced state reference when loading or saving changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 16:50:26 +02:00
Jan-Henrik Bruhn
ac252dc5ed fix: show keyboard shortcut help should be used with ctrl 2025-10-10 12:40:09 +02:00
Jan-Henrik Bruhn
df95a7c84c fix: fit view to content shortcut overrides typing the F letter everywhere 2025-10-10 12:39:37 +02:00
Jan-Henrik Bruhn
ce0ee71193 fix: logo path 2025-10-10 12:03:54 +02:00
Jan-Henrik Bruhn
236d394276 fix: change folder location base path for imports to deploy 2025-10-10 12:02:09 +02:00
Jan-Henrik Bruhn
4e335a8fde fix: refactor keyboard shortcut context 2025-10-10 11:54:51 +02:00
Jan-Henrik Bruhn
75cb26a991 fix: resolve effect dependencies 2025-10-10 11:40:14 +02:00
Jan-Henrik Bruhn
79bfd525dd fix: remove unused variable 2025-10-10 11:35:57 +02:00
Jan-Henrik Bruhn
0bd9a94337 feat: add github action to deploy to github pages 2025-10-10 11:27:51 +02:00
Jan-Henrik Bruhn
fd13213ff4 Add license 2025-10-10 11:24:47 +02:00
Jan-Henrik Bruhn
de57fd758b Add vibe warning 2025-10-10 11:23:36 +02:00
Jan-Henrik Bruhn
f56f928dcf Initial commit 2025-10-10 11:15:51 +02:00