Commit graph

16 commits

Author SHA1 Message Date
Jan-Henrik Bruhn
f5adbc8ead feat: add resizable actor grouping with full undo/redo support
Implements visual grouping of actors with context menu operations,
resizable containers, and complete history tracking integration.

Features:
- Create groups from multiple selected actors via context menu
- Groups visualized as resizable containers with child nodes
- Ungroup actors (non-destructive) or delete group with actors
- Right-click context menu with group-specific operations
- Dedicated GroupEditorPanel for group properties
- Smart minimum size constraint based on child node positions
- Full undo/redo support for group operations and resizes

Technical Implementation:
- GroupNode component with React Flow NodeResizer integration
- Atomic createGroupWithActors operation for consistent history
- Parent-child relationship using React Flow v11 parentId pattern
- Groups stored separately from actors in graphStore
- Fixed history tracking to sync graphStore before snapshots
- Resize tracking to prevent state sync loops during interaction
- Dynamic minimum dimensions to keep children inside bounds
- Sanitization of orphaned parentId references on state load

History Fixes:
- pushToHistory now syncs timeline with graphStore before snapshot
- Prevents missing groups/nodes in history states
- Ensures undo/redo correctly restores all graph elements
- Atomic state updates to avoid React Flow processing stale state

Storage & Persistence:
- Groups saved in timeline states and document structure
- Safe JSON serialization to prevent prototype pollution
- Cleanup utilities for removing __proto__ from localStorage

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-18 20:06:59 +02:00
Jan-Henrik Bruhn
61a13383dc refactor: extract RightPanel into separate specialized components
Improves code organization and maintainability by separating panel
implementations into focused, single-responsibility components.

Changes:
- Extract NodeEditorPanel for actor property editing
- Extract EdgeEditorPanel for relation property editing
- Extract GraphAnalysisPanel for graph metrics display
- Simplify RightPanel to act as routing/layout component (745→114 lines)
- Remove old unused Editor/NodePropertiesPanel.tsx
- Remove old unused Editor/EdgePropertiesPanel.tsx

All existing functionality preserved including live updates, debouncing,
modals, and connection displays. Each panel now self-contained with its
own state management and logic.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 10:46:14 +02:00
Jan-Henrik Bruhn
d98acf963b feat: implement label system and redesign filtering with positive filters
Implements a comprehensive label system and completely redesigns all
filtering (labels, actor types, relation types) to use intuitive positive
filtering where empty selection shows all items.

Label System Features:
- Create, edit, delete labels with names, colors, and scope (actors/relations/both)
- Inline editing with click-to-edit UI for quick modifications
- Quick-add label forms in config modals
- Autocomplete label selector with inline label creation
- Label badges rendered on nodes and edges (no overflow limits)
- Full undo/redo support for label operations
- Label validation and cleanup when labels are deleted
- Labels stored per-document in workspace system

Filter System Redesign:
- Changed from negative to positive filtering for all filter types
- Empty selection = show all items (intuitive default)
- Selected items = show only those items (positive filter)
- Consistent behavior across actor types, relation types, and labels
- Clear visual feedback with selection counts and helper text
- Auto-zoom viewport adjustment works for all filter types including labels

Label Cleanup & Validation:
- When label deleted, automatically removed from all nodes/edges across all timeline states
- Label references validated during node/edge updates
- Unknown label IDs filtered out to maintain data integrity

UI Improvements:
- All labels rendered without overflow limits (removed +N more indicators)
- Filter checkboxes start unchecked (select to filter, not hide)
- Helper text explains current filter state
- Selection counts displayed in filter section headers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-17 10:40:00 +02:00
Jan-Henrik Bruhn
cfd7a0b76f feat: add quick edit button for relation types in properties panel
Adds a small edit icon button next to the "Relation Type" label in the
RightPanel Relation Properties section that opens the EdgeTypeConfigModal
directly in edit mode for the selected relation's type.

Changes:
- Added edit icon button aligned to the right of "Relation Type" label
- Opens existing EdgeTypeConfigModal in edit mode for current type
- Enhanced EdgeTypeConfigModal to support initialEditingTypeId prop
- Modal automatically enters edit mode when opened with a type ID

This mirrors the actor type edit button functionality and provides a
convenient shortcut for editing relation types without navigating to
the settings menu or left panel configuration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 19:59:45 +02:00
Jan-Henrik Bruhn
47957b4188 feat: add quick edit button for actor types in properties panel
Adds a small edit icon button next to the "Actor Type" label in the
RightPanel Actor Properties section that opens the NodeTypeConfigModal
directly in edit mode for the selected actor's type.

Changes:
- Added edit icon button aligned to the right of "Actor Type" label
- Opens existing NodeTypeConfigModal in edit mode for current type
- Enhanced NodeTypeConfigModal to support initialEditingTypeId prop
- Modal automatically enters edit mode when opened with a type ID
- Fixed TypeScript error with showAdvancedByDefault prop

This provides a convenient shortcut for editing actor types without
navigating to the settings menu or left panel configuration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 19:56:30 +02:00
Jan-Henrik Bruhn
fab5c035a5 feat: improve connection display with reusable component and instant actor type updates
Creates reusable ConnectionDisplay component and enhances connection
visualization in both Actor and Relation properties panels.

Changes:
- Add ConnectionDisplay component for consistent connection visualization
  - Shows source and target actors with icons, labels, and type names
  - Includes direction indicators (→, ↔, —) based on directionality
  - Provides tooltips with node IDs on hover

- Enhance Actor Properties connections section
  - Display full actor information instead of just node IDs
  - Show edge type badges with color indicators
  - Include custom labels when different from type labels
  - Use ConnectionDisplay component for rich connection details

- Refactor Relation Properties to use ConnectionDisplay
  - Eliminates duplicate connection rendering code
  - Maintains consistent UI across panels

- Change actor type updates to apply instantly
  - Remove debounce delay for actor type dropdown changes
  - Provides immediate visual feedback when changing types
  - Consistent with relation type and directionality behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-12 12:17:47 +02:00
Jan-Henrik Bruhn
227b61b2a0 fix: improve bottom panel collapsed state and remove broken right panel close button
- Increase collapsed bottom panel height from 40px to 48px for better proportions
- Show current state indicator in bottom panel even when collapsed
- Remove unnecessary and broken close button from right panel header

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 22:22:42 +02:00
Jan-Henrik Bruhn
2435c984ba fix: correct Material-UI icon prop usage in RightPanel
Fixed TypeScript build errors by replacing invalid `style` prop with
proper Material-UI icon props. Icon components only accept `fontSize`
and `className` props, not arbitrary style objects.

Changes:
- Move fontSize styling to wrapping div elements
- Use proper `fontSize="small"` prop on icon components
- Apply color styling to container div (unchanged)

This resolves two TypeScript errors at lines 565 and 597 where
`style={{ fontSize: '14px' }}` was incorrectly passed to MUI icons.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 12:23:45 +02:00
Jan-Henrik Bruhn
2db8b25d9e feat: enhance relation properties panel with live updates
Improvements to the relation properties panel:

1. Show actor labels instead of IDs in connection display
   - Display actor icons with type-specific colors
   - Show actor labels and type names (e.g., "Person", "Organization")
   - IDs available on hover via tooltips
   - Layout: [icon] Label (Type) → (Type) Label [icon]

2. Make relation type changes instant
   - Relation type dropdown now applies changes immediately
   - No more 500ms delay or "Saving changes..." message
   - Provides instant visual feedback like directionality toggles

3. Fix connection display updates
   - Connection info now reads current edge data from store
   - Source/target actors update immediately when reversing direction
   - Direction arrow updates immediately when changing directionality
   - Panel properly reflects all edge changes in real-time

Only the custom label text input retains debounced saves to avoid
excessive updates while typing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 12:15:31 +02:00
Jan-Henrik Bruhn
e3e5b0768b perf: make relation directionality changes instant
Removes the 500ms debounce delay when changing edge directionality
in the right panel. Directionality toggle buttons now apply changes
immediately, providing instant visual feedback.

Text fields (relation type and custom label) still use debounced
saves to avoid excessive updates while typing.

Improves UX by making toggle interactions feel more responsive.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 12:07:53 +02:00
Jan-Henrik Bruhn
3a64d37f02 feat: implement directional relationships for edges
Adds full support for directed, bidirectional, and undirected relationships
between actors with visual arrow markers and intuitive controls.

**Type System:**
- Add EdgeDirectionality type (directed | bidirectional | undirected)
- Add directionality field to RelationData
- Add defaultDirectionality field to EdgeTypeConfig

**Visual Representation:**
- Directed edges: single arrow marker at target (→)
- Bidirectional edges: arrow markers at both ends (↔)
- Undirected edges: no arrow markers (—)
- Separate marker definitions for start/end to ensure correct orientation

**Property Panel Controls:**
- MUI ToggleButtonGroup for selecting directionality
- Visual connection indicator with directional symbols
- Reverse direction button (swaps source/target, only for directed edges)
- Live updates with 500ms debounce

**Edge Type Configuration:**
- Default directionality selector in edge type form
- Dropdown with helpful descriptions (→, ↔, —)
- Applied to both create and edit workflows

**Edge Creation:**
- New edges inherit defaultDirectionality from edge type config
- Falls back to 'directed' for backwards compatibility

**Reverse Direction:**
- Swaps source/target and sourceHandle/targetHandle
- Maintains edge ID and selection state
- Tracked in undo/redo history

Includes comprehensive UX specification document with wireframes,
interaction patterns, accessibility guidelines, and implementation phases.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 11:54:16 +02:00
Jan-Henrik Bruhn
045b1aa4d6 fix: remove non-functional panel toggle keyboard shortcuts
Removes Ctrl+B and Ctrl+I keyboard shortcuts that were causing panels
to disappear completely instead of collapsing properly. Also updates
all panel tooltips to no longer reference the removed shortcuts.

Changes:
- Removed Ctrl+B (left panel) and Ctrl+I (right panel) shortcut handlers
- Updated left panel tooltips: removed "(Ctrl+B)" references
- Updated right panel tooltips: removed "(Ctrl+I)" references
- Tooltips now simply show "Collapse Panel" / "Expand Panel"
- Escape key handler preserved for closing property panels

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 23:30:41 +02:00
Jan-Henrik Bruhn
5020ce0ed7 refactor: consolidate duplicate panel headers into reusable component
Consolidates three duplicate header implementations in RightPanel into a
single reusable PanelHeader component, following DRY principles.

Changes:
- Created PanelHeader component in RightPanel.tsx with consistent props
- Refactored Actor Properties to use PanelHeader
- Refactored Relation Properties to use PanelHeader
- Refactored Graph Analysis to use PanelHeader (removed internal header)
- All panel headers now have consistent appearance and behavior
- Supports optional close button and required collapse functionality

Benefits:
- Eliminates code duplication across panel views
- Ensures consistent UX across all panel states
- Easier to maintain and update header behavior in one place
- Reduces bundle size by removing redundant JSX

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 23:26:48 +02:00
Jan-Henrik Bruhn
3db4898902 fix: improve GraphMetrics header with collapse button
- Removed unnecessary refresh button (metrics auto-update via useMemo)
- Added collapse button to header (Ctrl+I)
- Matches behavior of Actor/Relation property panels
- Cleaner, more consistent UX

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 23:22:21 +02:00
Jan-Henrik Bruhn
0e90f022fc feat: add graph metrics and analysis to right panel
Implements section 6.1 from UX_ANALYSIS.md - Graph Metrics and Analysis.
Transforms the empty "No Selection" state in the right panel into a
valuable analysis dashboard.

Features:
- Graph analysis utility with metric calculations:
  - Actor/relation counts
  - Graph density (connectivity ratio)
  - Average connections per actor
  - Most connected actors (top 5)
  - Isolated actors count
  - Connected components detection
  - Breakdown by actor/relation type

- GraphMetrics component with sections:
  - Overview: basic stats and density
  - Most Connected Actors: ranked list
  - Graph Structure: isolated nodes, components
  - Type breakdowns: actors and relations by type
  - Visual polish: icons, tooltips, hover states
  - Warning highlights for isolated actors
  - Info highlights for multiple components

- Integration:
  - Replaces empty state in RightPanel
  - Automatically updates when graph changes
  - Memoized calculations for performance
  - Consistent styling with existing panels

Now provides immediate analytical value when opening a document,
making the application live up to its "Analyzer" name.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 23:20:22 +02:00
Jan-Henrik Bruhn
e7ff53dcd7 feat: side panels for properties and tools 2025-10-10 18:13:18 +02:00