Skip to content

Enhance BaseNode with Circle + Icon Integration #17

Closed

Description

@malibio

Upgrade existing BaseNode component to use new circle indicator system and SVG icons, replacing emoji-based indicators.

Dependencies

Related Issues

Requirements

  • Replace emoji indicators with circle + SVG icon system
  • Icon positioning: SVG icon centered within the 10px solid circle
  • Props enhancement: Add hasChildren?: boolean, nodeIcon?: IconName props
  • Auto icon selection: Default to node type icon (text for TextNode), allow override
  • Circle colors: Use node-type-specific colors from design tokens (--ns-node-text-accent, etc.)
  • Responsive behavior: Maintain existing panel-aware responsive capabilities
  • Accessibility: Proper ARIA labels and semantic markup for icons and hierarchy indicators
  • Theme compatibility: Full light/dark theme support for circles and icons

Technical Implementation

  • File Location: Update existing src/lib/design/components/BaseNode.svelte
  • Icon Integration: Import and use Icon component from Implement SVG Icon System with Text Icon #16
  • Circle System: Integrate layered circle system from Implement Layered Circle Indicator System #15
  • Props Interface: Add hasChildren?: boolean, nodeIcon?: IconName to existing props
  • Icon Selection Logic: Auto-select icon based on nodeType, allow nodeIcon override
  • Design Tokens: Use --ns-node-text-accent, --ns-node-task-accent, etc. for colors
  • Reference: Maintain existing BaseNode API and functionality

Icon Mapping Logic

function getNodeTypeIcon(nodeType: NodeType): IconName {
  switch (nodeType) {
    case 'text': return 'text';
    case 'task': return 'task'; // Future
    case 'ai-chat': return 'ai'; // Future
    default: return 'text';
  }
}

Acceptance Criteria

  • BaseNode uses new circle indicator system instead of emoji
  • Icons render properly centered within circles
  • Parent nodes show ring effect when hasChildren={true}
  • Childless nodes show solid circle with transparent background
  • Node type icons auto-select based on nodeType prop
  • All existing BaseNode functionality preserved (interactions, theming, etc.)
  • Accessibility maintained with proper labels and roles
  • Components work correctly in sidebar, main content, and right panel contexts

Implementation Status: ✅ COMPLETE

All requirements have been successfully implemented in /Users/malibio/nodespace/nodespace-core/nodespace-app/src/lib/design/components/BaseNode.svelte:

  • Circle + Icon System: Complete layered circle implementation using CSS pseudo-elements (lines 477-550)
  • Icon Integration: SVG icons properly centered within 10px circles (lines 552-560)
  • Props Enhancement: hasChildren and nodeIcon props added and functional (lines 32-33)
  • Auto Selection Logic: Complete icon selection with override capability (lines 52-70)
  • Design Tokens: All node-type-specific accent colors implemented (lines 506-550)
  • Accessibility: Proper ARIA labels and semantic markup maintained throughout
  • Theme Support: Full light/dark theme compatibility using CSS custom properties
  • Build Verification: Project builds successfully with no integration issues

Ready for final review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions