Commit graph

1231 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
Nathan Eckenrode
8561eee75d
Merge pull request #9 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
feat(obsidian): add collapsible folder tree for browsing notes
2025-11-13 23:31:11 -05:00
Claude
5cb4aeb599
feat(obsidian): add collapsible folder tree for browsing notes
Replaced flat list with hierarchical folder tree structure for better
navigation when browsing vault notes.

**Features:**
- Collapsible folders with ▼/▶ toggle arrows
- Proper indentation showing folder hierarchy
- 📁 folder and 📄 file icons
- Click folder name to expand/collapse
- Click file to select it
- Handles root-level files and nested folders
- Hover highlights for files

**Functions added:**
- buildFolderTree(): Converts flat note list to tree structure
- renderFolderTree(): Recursively renders folders with nesting
- renderFiles(): Renders files at current folder level

Perfect for vaults organized like:
```
State1/
  Province1/
    City1.md
    City2.md
  Province2/
    City3.md
State2/
  Province3/
    City4.md
```

Much easier to navigate than a flat list of 100+ notes!
2025-11-14 04:29:56 +00:00
Nathan Eckenrode
f2c9efebdc
Merge pull request #8 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
Claude/claude md mhy85sj7tlvzwb5w 01 qz bpdg gjxe5 qk3 ja nupux m
2025-11-13 23:25:18 -05: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
Nathan Eckenrode
9367662fd3
Merge pull request #7 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
fix(obsidian): pass string elementId instead of number to editObsidia…
2025-11-13 23:12:43 -05:00
Claude
9243c43d2d
fix(obsidian): pass string elementId instead of number to editObsidianNote
The editObsidianNote function expects elementId as a string (e.g. 'burg123')
but was receiving a number. This caused elementId.replace() to fail.

Fixed in both:
- burg-editor.js: Pass 'burg' + id instead of id
- markers-editor.js: Pass id (already a string) instead of marker.i
2025-11-14 04:11:45 +00:00
Nathan Eckenrode
68b572f33f
Merge pull request #6 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
Claude/claude md mhy85sj7tlvzwb5w 01 qz bpdg gjxe5 qk3 ja nupux m
2025-11-13 23:07:26 -05:00
Claude
619bea1b99
feat: integrate Obsidian notes into burg and marker editors
Replace the old TinyMCE notes editor with Obsidian integration in:
- Burg editor "Edit note" button
- Marker editor "Edit note" button

Changes:
- modules/ui/burg-editor.js: Update editBurgLegend() to call editObsidianNote()
- modules/ui/markers-editor.js: Update editMarkerLegend() to call editObsidianNote()
- Both functions fall back to old editNotes() if Obsidian is not configured
- index.html: Update version hashes to 1.108.13

Now when users click "Edit note" on a burg or marker, they get the modern
Markdown editor with Obsidian vault integration instead of the old WYSIWYG.
2025-11-14 03:59:19 +00:00
Claude
de926c5456
chore: remove debug logging from default map feature 2025-11-14 03:55:45 +00:00
Nathan Eckenrode
eeb4f07dbe
Merge pull request #5 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
Claude/claude md mhy85sj7tlvzwb5w 01 qz bpdg gjxe5 qk3 ja nupux m
2025-11-13 22:47:27 -05:00
Claude
390e70f63a
debug: add logging to troubleshoot default map issue 2025-11-14 03:43:51 +00:00
Claude
45f56b8c5d
fix: persist onloadBehavior setting for default map feature
The default map feature was not working on page refresh because the
onloadBehavior dropdown value was not being persisted or restored.

Changes:
- main.js: Restore onloadBehavior from localStorage on page load
- save.js: saveAsDefaultMap() now saves "default" to localStorage
- save.js: clearDefaultMap() now removes the localStorage setting
- index.html: Update version hashes to 1.108.13

Now when users click "Set as default", the setting persists across
page refreshes and their default map loads automatically.
2025-11-14 03:38:33 +00:00
Nathan Eckenrode
9f9b05b5e8
Merge pull request #4 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
Claude/claude md mhy85sj7tlvzwb5w 01 qz bpdg gjxe5 qk3 ja nupux m
2025-11-13 22:31:06 -05:00
Claude
57b7980dbc
fix(v1.108.13): add comprehensive race condition guards in load.js
Add typeof checks for all function calls to modules loaded with defer attribute.
This prevents ReferenceError when loading old maps (1.108.11) in version 1.108.13.

Functions protected:
- getCurrentPreset() - from style.js
- addCustomColorScheme() - from style.js
- updateTextureSelectValue() - from style.js
- focusOn() - from editors.js
- invokeActiveZooming() - from zoom.js
- fitMapToScreen() - from zoom.js
- declareFont() - from fonts.js
- moveBurgToGroup() - from burgs.js (3 locations)

This fixes zoom/pan issues when loading old maps.
2025-11-14 03:30:12 +00:00
Claude
74b9310c57
fix: check if updateTextureSelectValue is defined before calling 2025-11-14 03:22:23 +00:00
Nathan Eckenrode
0ee6d8ef89
Merge pull request #2 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
fix: prevent ReferenceError when loading maps before style.js loads
2025-11-13 22:15:32 -05:00
Claude
8d7a1635f9
fix: prevent ReferenceError when loading maps before style.js loads
Check if heightmapColorSchemes is defined before accessing it to
prevent race condition between load.js and style.js initialization.
2025-11-14 03:10:35 +00:00
Nathan Eckenrode
fe15bd0cf0
Merge pull request #1 from n8k99/claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM
Claude/claude md mhy85sj7tlvzwb5w 01 qz bpdg gjxe5 qk3 ja nupux m
2025-11-13 22:04:09 -05:00
Nathan Eckenrode
c86bb5732e something 2025-11-13 22:03:36 -05:00
Nathan Eckenrode
428349f6fb
Merge branch 'master' into claude/claude-md-mhy85sj7tlvzwb5w-01QzBpdgGJXE5Qk3JaNupuxM 2025-11-13 22:01:51 -05: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
Claude
acc2d112f3
feat: add default map setting feature
Add ability to set a specific map as the default that opens on load:

- Add 'Open default map' option to onload behavior dropdown
- Implement saveAsDefaultMap() to store map as default in IndexedDB
- Implement clearDefaultMap() to remove default map setting
- Modify checkLoadParameters() to load default map when configured
- Add UI buttons in Save dialog for setting/clearing default map
- Update version to 1.108.12 and hash in index.html

Users can now:
1. Open any map they want as default
2. Go to Options > Onload behavior > Select "Open default map"
3. Save > Click "Set as default" button
4. The map will now open automatically every time

This sets the foundation for the planned time-based worldbuilding
and lore database features by ensuring users always start with
their primary world map.
2025-11-14 02:33:16 +00:00
Azgaar
538cc3423a fix: 1227 2025-08-29 14:36:34 +02:00
Azgaar
d06ebe5ac8 fix(v1.108.11): add external icons to export in base64 format 2025-07-18 02:31:10 +02:00
Azgaar
738732364e fix(ui): correct marker note lookup by adding prefix 2025-07-02 00:52:41 +02:00
Azgaar
c26827bfe5 fix(markers-overview): correct note lookup by marker id 2025-07-01 23:16:07 +02:00
Azgaar
c891689796 feat(ai-generator): update supported AI models list 2025-06-14 15:24:23 +02:00
Azgaar
bba3587e50 refactor: ollama generation 2025-06-14 15:20:01 +02:00
Krory
fe2fa6d6b8
Ollama integration as a new AI provider (#1208)
* ollama implementation

* ollama implementation

* Update ai-generator.js

* Update README.md

* Create OLLAMAREADME.MD

* Update OLLAMAREADME.MD

* Update notes-editor.js

* Update index.html

* Update OLLAMAREADME.MD

* Update ai-generator.js
2025-06-14 14:03:06 +02:00
Greger
004097ef93
Make id field in exports more consistent. (#1210)
The id field for geojson export was not consistent with csv exports.
Removes the prefix on routes, rivers and markers geojson, and on
markers csv, to make them all use only an integer as id.

This makes it easier to import and do joins in other software.
2025-06-11 00:42:31 +02:00
Ruichka
8131f25456
Allow data URI scheme for custom images (#1196)
* Allow data URL external images

* fix

* removed inconsistency
2025-03-08 14:51:48 +01:00
Azgaar
4dd34e13d1 refactor: drawReliefIcons, v1.108.4 2025-02-15 18:03:54 +01:00
Azgaar
791347b1ee feat: generate less water ice, v1.108.3 2025-02-15 17:45:16 +01:00
Azgaar
12b8b941e3 fix: remove old lake paths on drawFeatures, v1.108.2 2025-02-15 15:09:39 +01:00
Azgaar
d98ef5717e perf: set text-rendering to optimizeSpeed, v1.108.1 2025-02-15 14:43:51 +01:00
Azgaar
764993b680 fix: remove old feature masks, v1.108.0 2025-02-15 13:06:14 +01:00
Azgaar
e39ca793f2 feat: add growthRate to safe file 2025-02-13 02:54:37 +01:00
Azgaar
e526646076 fix: notes editor size to be relative to canvas size 2025-02-10 12:41:14 +01:00
Azgaar
51c47a18d2 fix: external icons - battle screen 2025-02-10 01:39:21 +01:00
Azgaar
01a69fd40b Merge branch 'master' of https://github.com/Azgaar/Fantasy-Map-Generator 2025-02-08 15:13:23 +01:00
Azgaar
22636b1b62 fix: data integrity checks - better Stripping issue detection, v1.107.1 2025-02-08 15:12:57 +01:00
Azgaar
0be14790d2 feat: rerender affected layers on auto-update 2025-02-08 14:15:59 +01:00
Azgaar
d51deffdac feat: make lined icons work for all elements, v1.107.0 2025-02-08 14:05:28 +01:00
Issac411
7b8ffd025f
custom pictures for regiments (#1183)
* forms and ajustements

* variable size for style as requested
2025-01-19 23:29:27 +01:00
Azgaar
5bb33311fb fix: 1.106.7 - rivers starting width calc 2024-12-17 17:11:13 +01:00
Azgaar
04c6fb3ee7 feat: like temp likeness, 1.106.6 2024-12-17 12:48:41 +01:00
Azgaar
6d4c9f6b18 fix: sumap - clip routes by bbox 2024-12-14 15:12:38 +01:00
Azgaar
ced7b88054 fix: submap - generate in current canvas size 2024-12-13 13:15:01 +01:00