Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Simplify BaseNode: SVG Icon Integration with Processing State System
Problem Statement
The current BaseNode component is significantly over-engineered with unnecessary complexity that doesn't align with core requirements. It contains premature optimizations from unimplemented Issue #28 (navigation system) and unused props that bloat the component.
Architecture Overview
Essential Props (Simplified to 5 core properties)
export let nodeType: NodeType = 'text';
export let nodeId: string = '';
export let content: string = '';
export let hasChildren: boolean = false;
export let className: string = '';
// SVG Icon System
export let iconName?: IconName;
// Processing State System
export let isProcessing: boolean = false;
export let processingAnimation?: 'blink' | 'pulse' | 'spin' | 'fade';
export let processingIcon?: IconName;Core Features to Implement
1. SVG Icon Integration
- Icon Override System: When
iconNameprovided, render<Icon name={iconName} size={16} /> - Circle Fallback: When no
iconName, use existing circle indicator (10px solid, 16px background for parents) - Consistent Sizing: 16px fixed sizing for both SVG icons and circle fallbacks
- Theme Integration: Icons use
currentColor, circles use shadcn-svelte design tokens
2. Processing State System
- Default Processing: Blinking animation for SVG icons, pulsing for circles when
isProcessing={true} - Plugin Customization: Plugins can provide
processingAnimationtype andprocessingIconoverride - Use Cases: Save operations, AI processing, data loading, etc.
- CSS Animations: Smooth, non-intrusive feedback
3. Parent/Child Visual System
- Parent Indication: Ring/background effect for nodes with
hasChildren={true} - Works for Both: SVG icons and circle indicators show parent state consistently
- Theme Compatible: Follows shadcn-svelte color system
Remove Over-Engineering
Props to Remove
-
title- Not core BaseNode functionality -
selected- Use focus state comparison instead -
subtitle- Unused complexity -
showActions- Premature feature -
draggable- Not implemented properly -
loading- Replaced byisProcessing -
disabled- Unused -
clickable- Assumed default
Systems to Remove
-
NodeNavigationMethodsinterface (from unimplemented Issue Pluggable Node Navigation System - Entry/Exit Methods #28) - Complex event system - simplify to essential click events only
- Individual drag/drop state management
- Premature focus/selection handling
Technical Implementation
Integration with Existing Systems
- Icon System: Uses existing
Icon.sveltecomponent andIconNametypes - Design Tokens: Leverages shadcn-svelte variables for theming
- Plugin Architecture: Ready for node type plugins to provide custom indicators
CSS Animation Classes
/* Default processing animations */
.ns-icon.processing { animation: processing-blink 1s ease-in-out infinite; }
.ns-circle-indicator.processing { animation: processing-pulse 1s ease-in-out infinite; }
/* Plugin override examples */
.ns-icon--task.processing { animation: processing-spin 1s linear infinite; }Plugin Integration Examples
- TextNode: Provides
iconName="text", custom processing fade animation - TaskNode: Provides
iconName="task", spinner processing animation - AIChatNode: Provides
iconName="ai-chat", typing dots processing animation
Acceptance Criteria
Visual Requirements
- SVG icon rendering when
iconNameprovided - Circle indicator fallback when no
iconNamespecified - 16px consistent sizing for both icon types
- Parent indication (ring effect) for nodes with
hasChildren - Processing animations work for both SVG and circle indicators
- Theme switching compatible (light/dark modes)
- Clean tree hierarchy display with proper indentation
Code Quality Requirements
- Component reduced from ~400 lines to ~120-150 lines
- Only essential 5 props + processing state props
- Simplified event system (essential click events only)
- No TypeScript warnings or compilation errors
- Clean, maintainable component structure
- Ready for plugin architecture integration
Processing State Requirements
-
isProcessing={true}triggers default animations - Plugin customization through
processingAnimationandprocessingIcon - Smooth, accessible animation feedback
- Animation stops cleanly when
isProcessing={false}
Dependencies
- Existing SVG Icon system (
Icon.svelte,IconNametypes) - Current shadcn-svelte design token system
- Issues Enhanced BaseNode with Hierarchical Circle Indicators + TextNode Implementation #4, Implement Layered Circle Indicator System #15 (circle indicator foundation - already implemented)
Files to Modify
src/lib/design/components/BaseNode.svelte(primary refactoring)- Update any components using removed props
Priority
HIGH - This simplification is critical for clean development and blocks other improvements
This issue focuses on creating a clean, focused BaseNode that provides essential functionality while being extensible for future plugin architecture and processing state feedback.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
Simplify BaseNode component from ~400 lines to ~120-150 lines (closes #…
Simplify BaseNode Component (Issue #30) (#32)
Simplify BaseNode Component (Issue #30) (#32)