Repository navigation
Description
Epic: ContentEditable Text Editing with Smart Markdown Conversion
Overview
This epic implements a ContentEditable-based text editing system that replaces CodeMirror with smart markdown-to-node conversion, solving cursor positioning issues while providing intuitive markdown typing and AI integration.
Problem Statement
The current CodeMirror-based hybrid markdown implementation (#26) has fundamental cursor positioning issues and architectural complexity that fights against web standards. After extensive research and user feedback, we need a simpler, more reliable approach.
Solution: ContentEditable + Smart Node Conversion
Key Innovation: Markdown Syntax → Physical Node Hierarchy
Instead of competing hierarchy systems, convert markdown syntax into NodeSpace's existing physical node relationships:
- Research tasks→ Removes-, creates child node relationship- Soft newline + markdown → Creates appropriate new nodes intelligently
- Physical nodes serve as the "list structure" - no visual bullets needed
Architecture Decision Record
📋 Full technical details: ADR: ContentEditable Pivot
📋 Complete architecture: ContentEditable Text Editing Documentation
Benefits
Technical Benefits
- ✅ Eliminates cursor positioning issues (ContentEditable handles naturally)
- ✅ Simpler architecture (standard web patterns vs complex hybrid rendering)
- ✅ Better performance (native browser optimizations)
- ✅ Smaller bundle (~19% reduction, removes CodeMirror dependency)
User Experience Benefits
- ✅ Fast markdown typing (
# Header,- bulletsyntax) - ✅ Intelligent hierarchy building (bullets → actual parent/child nodes)
- ✅ No competing mental models (one hierarchy system)
- ✅ Perfect AI integration (seamless ChatGPT/Claude markdown import)
Architectural Benefits
- ✅ Preserves existing keyboard system (Tab/Shift-Tab indenting)
- ✅ Enhances node capabilities (each "bullet" becomes full-featured node)
- ✅ Consistent with NodeSpace design system and patterns
Parallel Development Strategy
🚀 Optimized for Team Collaboration
This epic has been structured to enable parallel development across multiple engineers, reducing development time while maintaining quality:
Work Stream 1: Foundation Layer
- ContentEditable Foundation - Replace CodeMirror with ContentEditable in TextNode #55: ContentEditable Foundation (blocking foundation - must complete first)
- Basic Markdown Pattern Detection (4 block types + 3 inline types) #56: Pattern Detection (starts after ContentEditable Foundation - Replace CodeMirror with ContentEditable in TextNode #55)
Work Stream 2: Visual Processing (Parallel to Stream 1)
- WYSIWYG Processing (hide syntax, show formatting) #57: WYSIWYG Processing (can start with mocked pattern detection from Basic Markdown Pattern Detection (4 block types + 3 inline types) #56)
Work Stream 3: Smart Conversion (Parallel development)
- Smart Bullet-to-Node Conversion (- item → child node) #58: Bullet-to-Node Conversion (parallel to Soft Newline + Markdown Detection (Shift-Enter intelligence) #59 after Basic Markdown Pattern Detection (4 block types + 3 inline types) #56)
- Soft Newline + Markdown Detection (Shift-Enter intelligence) #59: Soft Newline Detection (parallel to Smart Bullet-to-Node Conversion (- item → child node) #58, shared pattern detection)
Work Stream 4: Advanced Features (Early start capability)
- Markdown Import/Export for AI Integration #61: Import/Export (can start early with mocked conversion APIs)
- Multi-line Block Behavior (quotes, code blocks) #60: Multi-line Blocks (integrates Smart Bullet-to-Node Conversion (- item → child node) #58 + Soft Newline + Markdown Detection (Shift-Enter intelligence) #59 work)
Work Stream 5: Integration
- Integration Testing with Existing Keyboard Handlers #62: Integration Testing (final coordination phase)
Coordination Points
Shared Interface Contracts
- Pattern Detection APIs: Basic Markdown Pattern Detection (4 block types + 3 inline types) #56 provides interfaces used by WYSIWYG Processing (hide syntax, show formatting) #57, Smart Bullet-to-Node Conversion (- item → child node) #58, Soft Newline + Markdown Detection (Shift-Enter intelligence) #59, Markdown Import/Export for AI Integration #61
- Node Conversion APIs: Shared between Smart Bullet-to-Node Conversion (- item → child node) #58, Soft Newline + Markdown Detection (Shift-Enter intelligence) #59 for consistent behavior
- WYSIWYG Integration: WYSIWYG Processing (hide syntax, show formatting) #57 provides formatting for all node types
Mock Development Strategy
- Features can start with mocked dependencies to enable parallel work
- Well-defined interfaces allow seamless integration later
- Comprehensive testing with both mocked and real implementations
Key Integration Milestones
- After ContentEditable Foundation - Replace CodeMirror with ContentEditable in TextNode #55: Establish ContentEditable foundation contracts
- After Basic Markdown Pattern Detection (4 block types + 3 inline types) #56: Provide pattern detection interfaces for parallel development
- Integration Phase: Coordinate Smart Bullet-to-Node Conversion (- item → child node) #58 + Soft Newline + Markdown Detection (Shift-Enter intelligence) #59 for Multi-line Block Behavior (quotes, code blocks) #60 multi-line blocks
- Final Integration: Integration Testing with Existing Keyboard Handlers #62 brings everything together
Implementation Sub-Issues
Phase 1: Foundation
- ContentEditable Foundation - Replace CodeMirror with ContentEditable in TextNode #55 - ContentEditable Foundation (blocking foundation)
- Basic Markdown Pattern Detection (4 block types + 3 inline types) #56 - Basic Markdown Pattern Detection (enables parallel work)
- WYSIWYG Processing (hide syntax, show formatting) #57 - WYSIWYG Processing (parallel with Basic Markdown Pattern Detection (4 block types + 3 inline types) #56 using mocks)
Phase 2: Smart Conversion (Parallel Development)
- Smart Bullet-to-Node Conversion (- item → child node) #58 - Smart Bullet-to-Node Conversion (parallel to Soft Newline + Markdown Detection (Shift-Enter intelligence) #59)
- Soft Newline + Markdown Detection (Shift-Enter intelligence) #59 - Soft Newline + Markdown Detection (parallel to Smart Bullet-to-Node Conversion (- item → child node) #58)
- Multi-line Block Behavior (quotes, code blocks) #60 - Multi-line Block Behavior (integrates Smart Bullet-to-Node Conversion (- item → child node) #58 + Soft Newline + Markdown Detection (Shift-Enter intelligence) #59)
Phase 3: AI Integration (Early Start + Final Integration)
- Markdown Import/Export for AI Integration #61 - Markdown Import/Export for AI Integration (can start early)
- Integration Testing with Existing Keyboard Handlers #62 - Integration Testing with Existing Keyboard Handlers (final phase)
Migration Strategy
- Preserve existing work: Keep
feature/issue-26-hybrid-markdownbranch as reference - Start fresh: Create new
feature/contenteditable-text-editingfrom main - Cherry-pick valuable components: Performance improvements, documentation, design system integration
- Maintain compatibility: All existing keyboard shortcuts and node relationships preserved
Acceptance Criteria
- Users can type markdown (
# Header,- item) with instant visual formatting - Bullet points (
- item) automatically create child node relationships - Soft newlines (Shift-Enter) with markdown detection create appropriate nodes
- Perfect cursor positioning without complex coordinate mapping
- Seamless AI content import/export (ChatGPT, Claude markdown)
- Bundle size reduced by ~19% (CodeMirror removal)
- All existing keyboard shortcuts preserved (Tab/Shift-Tab, etc.)
- Cross-browser compatibility (Chrome, Firefox, Safari)
Research References
- Logseq Analysis: UX research showing clear edit/display mode patterns
- mldoc Investigation: Markdown parsing and rendering patterns
- CodeMirror Issues: Cursor positioning and hybrid rendering challenges
- Performance Analysis: Bundle size and rendering performance improvements
Related Work
- Replaces: Hybrid Markdown Rendering System - Live Preview with Syntax Visibility #26
- Builds on: Enhanced BaseNode with Hierarchical Circle Indicators + TextNode Implementation #4, Set up Tauri + Svelte project structure #1
- Enables: Inline Widgets and Notion-Style Editor Canvas #27, AI integration features
This epic represents a pivot from fighting against web standards to leveraging them, resulting in a more reliable, performant, and user-friendly text editing experience that enhances NodeSpace's sophisticated node hierarchy system. The parallel development strategy enables efficient team collaboration while maintaining architectural integrity.
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
Activity
Implement comprehensive markdown pattern detection system (addresses #56
Complete ContentEditable Text Editing Epic (addresses #54)
malibio commentedon Aug 12, 2025
✅ Epic #54 Successfully Completed
All 8 sub-issues (#55-62) have been implemented and merged:
Achievements
Next Steps
The architectural pivot from CodeMirror to ContentEditable has delivered a more reliable, performant, and user-friendly text editing experience. 🎉