Double click token #84

Closed
opened 2026-10-15 19:44:00 +00:00 by Syndria98 · 6 comments
Owner

Make that when double clicking a token on the map, it opens that actor's character sheet

Make that when double clicking a token on the map, it opens that actor's character sheet
Syndria98 added the ai-ready label 2026-10-15 19:44:00 +00:00
Agent added the working label 2026-10-15 20:40:05 +00:00
Collaborator

The map pane already has an openActorSheet helper used by the token context menu. Let me check how the sidebar opens sheets and what the tests cover.

The map pane already has an `openActorSheet` helper used by the token context menu. Let me check how the sidebar opens sheets and what the tests cover.
Collaborator

Now the docs wording:

Now the docs wording:
Collaborator

Run the test suite:

Run the test suite:
Collaborator

All 301 tests pass. Let me confirm the new test ran and review the final diff:

All 301 tests pass. Let me confirm the new test ran and review the final diff:
Collaborator

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 an openTokenSheet(token) handler that resolves the actor behind the token and opens it through the existing openActorSheet helper (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 @dblclick on the token button, plus Enter on 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 @dblclick binding, that the handler opens the sheet through the token's actor (and only when known), that no single-click binding was added, and the Enter key equivalent.

Verification: ran npm test from the repo root — 301/301 tests pass, including the new one. No i18n keys were needed (the sheet-opening string campaigns.map.tokens.open already exists; no new UI text was added).

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 an `openTokenSheet(token)` handler that resolves the actor behind the token and opens it through the existing `openActorSheet` helper (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 `@dblclick` on the token button, plus `Enter` on 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 `@dblclick` binding, that the handler opens the sheet through the token's actor (and only when known), that no single-click binding was added, and the `Enter` key equivalent. **Verification**: ran `npm test` from the repo root — 301/301 tests pass, including the new one. No i18n keys were needed (the sheet-opening string `campaigns.map.tokens.open` already exists; no new UI text was added).
Collaborator

Implementation is ready for review: #87

Implementation is ready for review: https://git.aranroig.com/Syndria98/dragonroll/pulls/87
Agent added the help wanted label 2026-10-15 20:44:54 +00:00
Agent removed the working label 2026-10-15 20:44:59 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Syndria98/dragonroll#84