## Overview Create dedicated HeaderNode component (h1-h6) with textarea-based editing. **Parent Issue:** #274 (Textarea migration) ## Behavior ### Auto-Detection Pattern When TextNode content starts with `# ` (1-6 hashtags + space): - Automatically convert TextNode → HeaderNode - Store hashtags in content: `## Hello` stored as-is - Node type: `header` ### Header Levels - `# Hello` → h1 - `## Hello` → h2 - `### Hello` → h3 - ... up to h6 User changes level by adding/removing hashtags in real-time. ### Real-Time Styling CSS applied to entire node based on hashtag count: - Larger font size for h1-h6 - Bold weight - Appropriate spacing - Applied during edit mode (textarea visible with `## ` syntax) ### Inline Formatting HeaderNode supports inline markdown: `## Hello **bold** world` - Edit mode: Syntax visible (`**bold**`) - Blur mode: Syntax hidden, formatted (**bold**) ### Single-Line Behavior - No multiline support (auto-wrap text) - Enter key creates new HeaderNode below (inherits header level) ### Conversion Back to TextNode When user removes all hashtags: `## Hello` → `Hello` = HeaderNode → TextNode ## Acceptance Criteria - [x] Auto-detect `# ` pattern and convert node type - [x] Support h1-h6 levels based on hashtag count - [x] Real-time CSS styling during edit mode - [x] Inline formatting rendered on blur only - [x] Single-line enforced (auto-wrap) - [x] Enter creates new HeaderNode below (inherits level) - [x] Removing hashtags converts back to TextNode - [x] Store hashtags in database content - [x] Register HeaderNode in plugin system - [x] Tests cover all header levels and conversions - [x] Backend accepts header node type (ALLOWED_NODE_TYPES) ## Design Reference See `docs/design-system/components.html` for header styling specs.
Activity
feat: Implement unified pattern detection system for node type conver…
feat(wip): Unified pattern detection system for HeaderNode (issue #275)
feat: Add comprehensive HeaderNode tests and fix h1 flash bug (issue #…
fix: Restore cursor focus after HeaderNode type conversion (issue #275)
wip: Implement cursor preservation infrastructure for node type conve…
feat: Complete HeaderNode implementation with cursor preservation and…
fix: Add 'header' to ALLOWED_NODE_TYPES and comprehensive test covera…
Implement HeaderNode component with textarea (#284)
docs: Add comprehensive guide for creating new node types
Implement HeaderNode component with textarea (#284)
docs: Add comprehensive guide for creating new node types
Implement HeaderNode component with textarea (#284)
docs: Add comprehensive guide for creating new node types
Implement HeaderNode component with textarea (#284)