Skip to content

Simplify BaseNode: SVG Icon Integration with Processing State System #30

Closed

Description

@malibio

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 iconName provided, 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 processingAnimation type and processingIcon override
  • 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 by isProcessing
  • disabled - Unused
  • clickable - Assumed default

Systems to Remove

Technical Implementation

Integration with Existing Systems

  • Icon System: Uses existing Icon.svelte component and IconName types
  • 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 iconName provided
  • Circle indicator fallback when no iconName specified
  • 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 processingAnimation and processingIcon
  • Smooth, accessible animation feedback
  • Animation stops cleanly when isProcessing={false}

Dependencies

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.

Activity

  1. added
    enhancement
    on Aug 10, 2025
  2. assigned and unassigned on Aug 10, 2025
  3. added a commit that references this issue on Aug 10, 2025
    af8ccc3
  4. added a commit that references this issue on Feb 4, 2026
  5. added a commit that references this issue on Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions