Plugin API Gaps (Historical) #
Note: This document is historical. Current truth lives in the executable compatibility/build/test gates rather than a broad coverage document.
This document tracked API gaps discovered while implementing built-in plugins (Issue #22). Most gaps have been resolved.
View Registration (Critical) #
Gap: Plugin.registerView() stores views in a private Map but nothing renders them.
Current State:
Pluginclass hasregisterView(type: string, viewCreator: ViewCreator)- Views are stored in
this.viewsMap - Nothing reads from this Map or renders the views
Impact: Plugins cannot register custom sidebar views.
Workaround: For FileTreePlugin, we control the existing FileTree component through callbacks passed to the plugin. The plugin doesn't own the view rendering.
Recommended Fix: Implement a ViewRegistry in App that:
- Accepts view registrations from plugins
- Provides a way for layout components to query available views
- Renders views in designated areas (sidebar, right panel, etc.)
Priority: High - needed for any plugin that wants to add custom views
Vault Events for Search Indexing (Deferred) #
Gap: BackgroundIndexer uses schedule-based reindexing rather than reactive Vault events.
Current State:
- Vault emits create/modify/delete events with TFile objects
- TFile has path-based identity but no AutomergeUrl
- BackgroundIndexer works with AutomergeUrl-based identity
- There's no public API to look up AutomergeUrl from TFile path
Impact: Search index updates are periodic rather than instant on file changes.
Status: Intentionally deferred. The schedule-based approach is sufficient for the current use case. Reactive indexing via Vault events would require either:
- Adding
url: AutomergeUrlto TAbstractFile (breaking API change) - Exposing
Vault.getUrlForPath(path: string): AutomergeUrl | null
Priority: Low - current behavior is acceptable
Wikilink Plugin Implementation (Completed - Issue #23) #
Status: Implemented
Components Added:
WikilinkPlugin(src/plugins/wikilink/): Plugin class orchestrating wikilink featuresWikilinkAutocompletePlugin(src/editor/plugins/): Lexical plugin for [[ autocomplete in WYSIWYG modeWikilinkClickPlugin(src/editor/plugins/): Click-to-navigate on wikilinks via data-target attributeBacklinksPanel(src/layout/): Right sidebar component showing backlinks with contextVault.getMarkdownFiles(): List all markdown files in vaultVault.getUrlForPath(): Get Automerge URL for a file pathSearchService.findBacklinks(): Find documents linking to a targetWikilinkNode.setLinkResolver(): Static method for unresolved link detection
Architecture:
- Autocomplete only in WYSIWYG mode (source mode uses existing TextMatchTransformer)
- Backlinks computed on-demand via content scanning (no separate index)
- WikilinkNode uses existing
data-targetattribute for click handling - Unresolved links highlighted via
data-unresolvedattribute + CSS - Callback-based integration with AppShell (same pattern as FileTreePlugin/QuickSearchPlugin)
- WikilinkHandlers interface passed from AppShell to editor components