Dragonroll frontend: item modifications #35
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Now let me look at the tests, the locale files, and the Server service:
I now have the full picture. Let me implement. Starting with the backend:
Now the item routes —
imagein the partial update and an upload endpoint mirroringactor/upload-image:Now the Foundry module: send embedded item icons as absolute URLs, and push the Dragonroll-chosen icon back into the linked world:
Now the frontend. Register the window:
Now wire the sidebar click to the new window:
That edit went wrong — let me check and fix:
Sidebar is fixed. Now the i18n strings — all three locales:
Now the tests. The repo convention is dependency-free
node --testfiles — behavior tests for pure backend services plus source scans for wiring:Run the test suite:
All 80 tests pass. Let me confirm my new tests ran and do a final review of the diff:
Final review of the backend and module diffs:
Done — full suite green (80/80, including the 9 new tests). Here's a summary of the change for issue #35:
Frontend — item window & icon picker
ContentSidebar.vue: clicking an item (or Enter/Space on its row) now opens a window instead of expanding details inline.openItemSheet()mirrorsopenCharacterSheet()(single instance, replace-on-reopen); the oldtoggleEntryDetails/expandedEntryIdsinline expansion is removed. Right-click Edit/Delete menu is untouched.ItemSheetWindow.vue(new) +WindowDefinitions.js(item_sheetentry): shows the item's info — icon, name, category, rarity, synced badge, quantity, weight, properties, description — and follows background Foundry sync updates viacampaign-entry-updated, like the character sheet does.POST /item/upload-image?item=<id>(same flow as the character sheet's photo), plus a remove button.windows.item-sheet,campaigns.item.sheet.*); styled withvar(--color-…)only.Backend
models/Item.js: newimage(upload filename or URL) andfoundryImage(icon Foundry last sent) fields.services/item-foundry.js: maps Foundry'simgintoimage, like the actor mapper already does.routes/foundry-link.js:saveFoundryItemalways refreshesfoundryImage, so Foundry's icon survives the fullSync preserve-edits rule and user overrides.routes/item.js:/updateacceptsimage; newPOST /upload-image(multipart, ownership-checked) mirroring the actor route.Foundry module (
dragonroll-foundry/scripts/api.js)serializeFoundryItem, so their icons are sent as absolute URLs (Dragonroll renders them outside Foundry) — same rule already applied to actor portraits.imgon item create/update), and an empty icon leaves the world's choice alone instead of erasing it.Tests
tests/item-sheet-window.test.js(new, dependency-freenode --test): behavior tests for the Foundry→item icon mapping plus wiring checks (model fields, sync keep, upload/update routes, window registration, sidebar click, module serialization) and locale coverage.npm test: 80 pass, 0 fail.Implementation is ready for review: #39