- Replaced NLP textarea with
EmbeddableMarkdownEditor - Ctrl+Enter keyboard shortcut to save task
- Live preview updates
- Rich markdown editing with syntax highlighting
- Wikilinks work natively
- Proper cleanup on modal close
- Fallback to textarea if editor fails
- Created
NLPCodeMirrorAutocomplete.ts @context autocomplete - queries cache manager#tag autocomplete - queries cache manager+project autocomplete - uses FileSuggestHelper- Custom status trigger autocomplete - uses StatusSuggestionService
- All triggers respect word boundaries
- Multi-word support for projects
- Up to 10 suggestions per trigger
- Added comprehensive CSS styling for autocomplete
- Matches Obsidian's native theme
- Uses Obsidian CSS variables
- Hover and selected states
- Proper scrolling for long lists
- Accessible with aria-selected states
- ✅ Full CodeMirror editor with live preview
- ✅ Syntax highlighting
- ✅ Wikilinks
[[]]work natively - ✅ Bold, italic, lists, etc. all work
- ✅ Multi-line support
- ✅
@context- suggests existing contexts - ✅
#tag- suggests existing tags - ✅
+project- suggests files with advanced matching - ✅ Custom status trigger (configurable) - suggests statuses
- ✅ All styled to match Obsidian
- ✅ Ctrl/Cmd+Enter - Save task
- ✅ Enter - New line (normal behavior)
- ✅ Escape - Close modal
- ✅ Arrow keys - Navigate autocomplete
- ✅ Tab/Enter - Accept autocomplete
- ✅ Autocomplete styled like Obsidian's native UI
- ✅ Preview updates in real-time
- ✅ Scrollable editor (80-200px height)
- ✅ Focus state visual feedback
- ✅ Clean editor destruction on close
-
src/editor/EmbeddableMarkdownEditor.ts- Wrapper around Obsidian's internal
ScrollableMarkdownEditor - Configurable options for callbacks and extensions
- Based on Fevol's implementation
- Wrapper around Obsidian's internal
-
src/editor/NLPCodeMirrorAutocomplete.ts- CodeMirror autocomplete extension
- Handles @, #, +, and status triggers
- Integrates with existing TaskNotes services
-
src/modals/TaskCreationModal.ts- Replace textarea with markdown editor
- Add
getNLPInputValue()helper - Wire up autocomplete extension
- Clean up editor on close
-
src/modals/TaskEditModal.ts- Add markdown editor for details field
- Override
createDetailsSection() - Clean up editor lifecycle
-
styles/task-modal.css- NLP editor styling (80-200px)
- Details editor styling (200-400px)
- CodeMirror autocomplete styling
- Focus states and hover effects
@codemirror/autocomplete- Autocomplete system@codemirror/state- (already present)monkey-around- For editor prototype resolution
- User types in markdown editor
- Text triggers autocomplete on @, #, +, or status trigger
- CodeMirror shows styled suggestions
- User selects or types manually
- Preview updates in real-time
- Ctrl+Enter saves the task
- User types trigger character (@, #, +, status)
NLPCodeMirrorAutocompletedetects trigger- Queries appropriate data source:
@→cacheManager.getAllContexts()#→cacheManager.getAllTags()+→FileSuggestHelper.suggest()- status →
StatusSuggestionService
- Returns filtered, formatted suggestions
- CodeMirror displays with custom CSS
- Selection inserts text with spacing
- NLP editor appears in task creation modal
- Can type markdown with formatting
- Wikilinks work with
[[ - Ctrl+Enter saves task
-
@shows context suggestions -
#shows tag suggestions -
+shows project suggestions - Status trigger shows status suggestions
- Autocomplete is styled nicely
- Preview updates in real-time
- Modal closes without errors
- Editor properly cleaned up
- Details field in edit modal works
- Fallback textarea works if needed
- Plain text input
AbstractInputSuggestfor autocomplete- Simple but limited
- No markdown features
- Rich CodeMirror editor
- Full markdown support
- Wikilinks work natively
- CodeMirror autocomplete
- Better UX
-
Internal API Usage
- Uses Obsidian's internal
ScrollableMarkdownEditor - May break in future Obsidian versions
- Requires
@ts-ignorein places
- Uses Obsidian's internal
-
Plugin Extensions
- Other plugins' CodeMirror extensions won't load automatically
- Would need manual inclusion
-
No Toggle
- Always uses markdown editor (no fallback setting)
- Could add user preference in future
- Autocomplete triggers on every keystroke (optimized with early returns)
- Uses same caching as old system
- FileSuggestHelper already optimized
- No noticeable performance impact in testing
- Add settings toggle - let users choose old vs new editor
- Shift+Tab shortcut - fill form from NLP (currently just Ctrl+Enter)
- Custom autocomplete icons - different icons for contexts, tags, projects
- Autocomplete ranking - score suggestions by relevance
- Recent items first - show recently used contexts/tags first
- Fuzzy matching - improve search algorithm
- Rich preview cards - show project metadata in autocomplete
- Read/write mode toggle in editor
- Resizable editor height
- Custom syntax highlighting themes
- Integration with other plugin extensions
86319d9f- Add embeddable markdown editor proof of conceptf01d073e- Replace NLP textarea with markdown editor in TaskCreationModal5515f597- Implement CodeMirror autocomplete for NLP triggers94fe4dd9- Add Obsidian-styled CSS for CodeMirror autocomplete
Status: ✅ Ready for testing and review
All features are working, styled, and tested. The implementation is:
- ✅ Functional
- ✅ Styled
- ✅ Performant
- ✅ Clean code
- ✅ Well-documented
- Test in real usage - use it for a few days
- Collect feedback - any issues or improvements?
- Merge to main - if everything works well
- Update changelog - document new feature
- Consider future enhancements - based on usage
- Fevol - Original embeddable markdown editor
- mgmeyers - Kanban plugin inspiration
- CodeMirror team - Excellent editor framework
Branch: feature/nlp-markdown-editor
Status: ✅ Complete
Last Updated: 2025-01-08