Fix issue #98: Sync notes from dragonroll to foundry
All checks were successful
Test / test (push) Successful in 2s

This commit is contained in:
Gitea OpenCode Agent
2026-10-15 23:19:43 +00:00
parent c9ee16f2f2
commit 07dcf08616
11 changed files with 780 additions and 4 deletions

View File

@@ -105,6 +105,17 @@ else (Syndria98/dragonroll#67):
the whole world directory and can tell which synced rows it has let go of. Deleting a synced item in
Dragonroll removes its Foundry world copy on the next reconcile.
### Notes
The campaign's notes read like the campaign's journal in the world (Syndria98/dragonroll#98): every
note stands as a page of one JournalEntry named **Dragonroll**. The module creates that journal — or
adopts one the GM already made under that name, marking it as the notes' journal — and renders each
note's markdown into page HTML with Foundry's own renderer. Notes are written in Dragonroll, so this
copy runs one way: a note made or edited in the campaign rewrites its page on the next reconcile, and
a note deleted there takes its page with it. Pages the campaign does not own — the GM's own pages in
that journal — are left alone, and nothing written in the journal travels back. Autosync off stops it
too, like the rest of the sync.
The module calls these Dragonroll routes with the campaign sync token (no Dragonroll login):
| Route | Use |
@@ -114,12 +125,16 @@ The module calls these Dragonroll routes with the campaign sync token (no Dragon
| `POST /api/foundry/sync/item-delete` | A world item was deleted |
| `GET /api/foundry/sync/characters` | Characters to apply back in Foundry |
| `GET /api/foundry/sync/items` | Items, and the item folders with their Dragonroll colours, to apply back in Foundry |
| `GET /api/foundry/sync/notes` | The campaign's notes, markdown and all, and the journal page each stands as |
| `POST /api/foundry/sync/map-note` | Store a note's journal page id after creating that page |
| `GET /api/foundry/sync/status` | The campaign this world's token belongs to, for the module's pairing status |
| `POST /api/foundry/sync/map` / `map-item` | Store an id mapping after creating a document |
| `POST /api/foundry/sync/delete` | An actor was deleted |
Foundry documents keep the Dragonroll id in the `dragonroll-foundry.actorId` / `dragonroll-foundry.itemId`
flag, and world items are marked with `dragonroll-foundry.syncMutation` while Dragonroll writes them so
flag, and a journal page the module made for a note keeps its note's id in the `dragonroll-foundry.noteId`
flag, so the notes reconcile recognises its own pages. World items are marked with
`dragonroll-foundry.syncMutation` while Dragonroll writes them so
the write is not echoed back. A folder colour is written with that folder held in the client's set of
folders being synced, for the same reason.