Fantasy-Map-Generator/modules/io
Claude f575631e30
feat(obsidian): add FMG ID index for instant note lookups
Problem: Every time you click on a burg/marker, it had to scan through
all 13,496 vault files looking for a matching fmg-id. This was extremely
slow and made the feature unusable for large vaults.

Solution: Implement a smart index that maps fmg-id to file paths.

How it works:
- Index stored in memory (fmgIdIndex object)
- Persisted to localStorage (survives page reloads)
- Loaded on init, saved on changes
- When looking up by fmg-id:
  1. Check index first (instant!)
  2. If found, verify file still exists and ID matches
  3. If not in index, search vault and add to index
- Automatically updates when notes are created/saved through FMG
- Handles stale entries (file deleted/modified)

Performance improvement:
- Before: O(n) - scan all 13k files (very slow)
- After: O(1) - instant lookup from index
- First click on burg: May need to search (builds index)
- Second click on same burg: Instant! Opens note directly

This makes the Obsidian integration actually usable. Create a note once
for a burg, and every time you click that burg again, it opens instantly.
2025-11-14 05:29:36 +00:00
..
cloud.js chore: parse DEBUG setting as an object 2024-10-22 14:45:25 +02:00
export.js fix(v1.108.11): add external icons to export in base64 format 2025-07-18 02:31:10 +02:00
load.js fix(v1.108.13): add comprehensive race condition guards in load.js 2025-11-14 03:30:12 +00:00
obsidian-bridge.js feat(obsidian): add FMG ID index for instant note lookups 2025-11-14 05:29:36 +00:00
save.js chore: remove debug logging from default map feature 2025-11-14 03:55:45 +00:00