- Extract shared result processing logic into processPublishResults utility
- Add ProcessedPublishResults interface for type safety
- Create helper functions for error handling and event logging
- Reduce publishing handler code from ~200 to ~50 lines each
- Maintain all existing functionality while improving maintainability
Both handlePublishArticle and handlePublishScatteredNotes now use:
- processPublishResults() for consistent result processing
- createErrorResult() for standardized error handling
- logEventSummary() for centralized debug logging
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Events now publish successfully but don't appear in feed yet. Fixed the
"Failed to execute 'postMessage' on 'Window'" error by ensuring all
event data is properly serialized before passing between components.
Changes:
- Remove non-serializable tree property from exported events
- Convert all NDKEvent properties to primitives in eventToPublishableObject
- Add JSON deep cloning in handlePublish to ensure full serializability
- Add debug logging to track event structure and serialization issues
Status: Publishing works (events are sent to relays) but feed display
needs investigation for relay read/write configuration mismatch.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create positioned overlay for visual hierarchy indicators
- Set up scroll synchronization with textarea
- Add state management for gutter indicators
- Implement line position calculation system
- Foundation for Phase 2 visual hierarchy features
Verified: Overlay doesn't interfere with editing functionality
Ready for: Checkpoint 2.2 line detection and event mapping
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Use tag.value consistently instead of reconstructing tag.type-tag.label
- Fix auto-disable to work for ALL tag types (hashtags, authors, event refs, titles, summaries)
- Each tag type now maintains separate initialization state
- Update parsedSections to use metadata.eventStructure for accurate hierarchy
- Add helper function findEventByDTag for event lookup
- Now supports proper 30040 vs 30041 event type distinction
- Enhanced preview logging with eventStructure information
✅ Verified: Hierarchical parser generates proper 30040/30041 events
✅ Test: Level 3 parsing shows 7 events (1 index + 2 chapter indices + 4 content)
✅ Core: Event structure metadata available for advanced preview features
Ready for: Export functionality verification
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Switch import from publication_tree_factory to asciidoc_publication_parser
- Update MAX_PARSE_LEVEL from 6 to 5 for new hierarchy limits
- No functional changes yet - foundation for hierarchical parsing
✅ Verified: App compiles, ZettelEditor loads, parse levels 2-5 available
Ready for: Function call update in next checkpoint
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Successfully implemented proper Asciidoctor tree processor extension for NKBIP-01
hierarchical parsing with comprehensive test coverage and future integration plan.
Features:
- Real Asciidoctor tree processor extension using registry.treeProcessor()
- NKBIP-01 compliant hierarchical structure (30040 index + 30041 content events)
- Parse levels 2-5 with different event granularities:
* Level 2: One 30041 per level 2 section (contains all nested content)
* Level 3+: Mix of 30040 (sections with children) + 30041 (content sections)
- Content preserved as original AsciiDoc markup
- Comprehensive test suite validating all parse levels and event structures
Implementation:
- src/lib/utils/publication_tree_processor.ts: Core tree processor extension
- src/lib/utils/asciidoc_publication_parser.ts: Unified parser interface
- tests/unit/publication_tree_processor.test.ts: Complete test coverage
- HIERARCHY_VISUALIZATION_PLAN.md: Next phase integration plan
Next: Integrate into ZettelEditor with visual hierarchy indicators
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>