The previous implementation read ALL file contents to get frontmatter
when browsing notes, which caused massive slowdown for large vaults
(13k+ files = 13k+ HTTP requests).
Changes:
- Add listAllNotePaths() function that only gets file paths (fast)
- Build folder tree from paths only, no content reading
- Lazy load file content only when user clicks on a file
- Change message from "Loading all notes" to "Loading file list"
- Add logging to show file count being displayed
Performance improvement:
- Before: O(n) HTTP requests where n = number of files
- After: O(1) - just the recursive directory scan
- File content loaded on-demand (1 request per clicked file)
This makes the folder tree instant even for vaults with 10k+ files.
The Obsidian Local REST API /vault/ endpoint returns folder entries with
trailing slashes (e.g., "01 Projects/"). The previous code filtered these
out, only keeping .md files, which meant nested files were never discovered.
Changes:
- Add scanDirectory() function to recursively scan folders
- Detect folders by trailing "/" character
- Recursively query each folder with /vault/{foldername}/
- Build full paths as we traverse (e.g., "State/Province/City.md")
- Remove search endpoint attempt (not needed)
- Add timing logs to measure performance
This now correctly discovers ALL markdown files in the vault, regardless
of how deeply nested they are in folders.
Fixes nested folder display issue.
- Try /search/ endpoint first to get all .md files recursively
- Fall back to /vault/ endpoint if search doesn't work
- Add warning when using /vault/ that nested folders may not be visible
- Handle multiple response formats from search endpoint
- Add debug logging to getVaultFiles() to show file counts
- Add logging to listAllNotes() to show processing details
- Add logging to buildFolderTree() to trace folder creation
- Filter .md files in getVaultFiles() for better performance
- Log sample file paths to help diagnose API response format
This will help identify why nested folders aren't appearing in the
folder tree browser.
When a user selects or creates a note for a burg/marker, the system now
automatically links them together by adding/updating the note's frontmatter.
**How it works:**
1. **When saving a note**:
- Adds `fmg-id: burg123` to frontmatter
- Updates `x:` and `y:` coordinates
- Preserves existing frontmatter fields
2. **When creating a new note**:
- Template includes fmg-id from the start
- Uses the proper elementId (e.g., "burg123")
3. **Next time you edit**:
- System finds note instantly by fmg-id
- No need to search by coordinates again
- Permanent two-way link established
**Changes:**
- obsidian-notes-editor.js:
- Pass elementId and coordinates to showMarkdownEditor()
- updateFrontmatterWithFmgData() injects fmg-id on save
- Automatically updates coordinates to keep in sync
- obsidian-bridge.js:
- generateNoteTemplate() accepts elementId parameter
- Uses elementId for fmg-id instead of element.id
Users no longer need to manually match notes - once linked, the
association is permanent in the note's frontmatter.
Enhanced the Obsidian note finding system with:
**ObsidianBridge:**
- searchNotes(query): Search vault by filename
- listAllNotes(): Browse all notes in vault
**Obsidian Notes Editor:**
- Text search box with auto-populated state/province
- "Browse All Notes" button to see full vault
- Display burg's state and province in dialog
- Pre-fill search with state name for easier finding
- Enter key triggers search
- Click any result to load that note
**getElementData enhancement:**
- Extract and include state/province names for burgs
- Extract state/province from cell data for markers
Now users can:
1. See which state/province the burg belongs to
2. Search by state name (pre-filled)
3. Search by any text in filename
4. Browse all notes manually
5. Click to select matching note
This addresses the user's organization structure where notes are
stored in State/Province folders matching the map structure.
Add comprehensive Obsidian integration as intermediate step toward
PostgreSQL migration, enabling modern Markdown-based note editing:
**Features:**
- Obsidian Local REST API integration for vault access
- Coordinate-based note matching (searches vault YAML frontmatter)
- Shows top 5-8 closest matches when clicking burgs/markers
- Modern Markdown editor with live preview
- [[Wikilink]] support for connecting notes
- "Open in Obsidian" button to jump to native app
- Configuration UI for API setup and testing
**Technical Implementation:**
- modules/io/obsidian-bridge.js - Core API integration layer
- modules/ui/obsidian-notes-editor.js - Markdown editor UI
- modules/ui/obsidian-config.js - Configuration panel
- OBSIDIAN_INTEGRATION.md - Complete setup/usage guide
**Coordinate Matching:**
- Parses YAML frontmatter for x/y coordinates
- Calculates distance to clicked element
- Supports nested (coordinates.x) and flat (x:) formats
- Handles missing FMG IDs (common with PostgreSQL imports)
**User Workflow:**
1. Configure Obsidian REST API connection
2. Click burg/marker in FMG
3. System finds matching notes by coordinates
4. Select note or create new one
5. Edit in modern Markdown editor
6. Save syncs to Obsidian vault instantly
This replaces the "Win95-style TinyMCE" editor with a clean,
modern Markdown experience while maintaining compatibility with
the eventual PostgreSQL backend migration. Users can edit notes
in either FMG or Obsidian - both stay in sync via file system.
Version: 1.108.13