Commit graph

4 commits

Author SHA1 Message Date
Claude
adb04d2e43
debug(obsidian): add logging to diagnose nested folder display issue
- 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.
2025-11-14 04:50:05 +00:00
Claude
154145a518
feat(obsidian): persist FMG-to-note association with fmg-id in frontmatter
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.
2025-11-14 04:22:24 +00:00
Claude
28cf8db82d
feat(obsidian): add text search and browse features for note finding
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.
2025-11-14 04:18:20 +00:00
Claude
769d3a31bb
feat: add Obsidian vault integration for modern Markdown notes
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
2025-11-14 02:57:07 +00:00