Double click token #84
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?
Make that when double clicking a token on the map, it opens that actor's character sheet
The map pane already has an
openActorSheethelper used by the token context menu. Let me check how the sidebar opens sheets and what the tests cover.Now the docs wording:
Run the test suite:
All 301 tests pass. Let me confirm the new test ran and review the final diff:
Done. Double-clicking a token on a map now opens that actor's character sheet.
What I changed
frontend/app/components/viewer/map/MapViewerPane.vue— added anopenTokenSheet(token)handler that resolves the actor behind the token and opens it through the existingopenActorSheethelper (the same one-window-per-sheet flow used by the sidebar, top search bar, and the token's own context menu, which is untouched). Wired it to@dblclickon the token button, plusEnteron a focused token as the keyboard equivalent, since a focused token already answers to arrow keys and Delete. A single click deliberately stays unbound: the click that ends a token drag lands on the token too, so single-click would open the sheet on every move. Works in both the anchored map pane and the detached map window, since they share this component. If the actor behind a token isn't in the campaign (e.g. deleted), nothing happens — same as the context menu.frontend/app/content/docs/02-using-dragonroll/03-maps.md— the docs already claimed "Clicking a token opens the sheet", which was never implemented; corrected to "Double-clicking … and Enter on a focused token".tests/map-tokens.test.js— new wiring test asserting the@dblclickbinding, that the handler opens the sheet through the token's actor (and only when known), that no single-click binding was added, and theEnterkey equivalent.Verification: ran
npm testfrom the repo root — 301/301 tests pass, including the new one. No i18n keys were needed (the sheet-opening stringcampaigns.map.tokens.openalready exists; no new UI text was added).Implementation is ready for review: #87