Hold-to-read works on occupied squares — creatures and wizards included

The press-and-hold card peek lived only on the floor rects, and any
creature or wizard token sitting there swallowed the pointer events —
so the democratic monster, whose plain tap selects it for commands,
had no path to its card at all. The hold gesture now lives on the
tokens too (a fired hold swallows the tap so nothing double-fires),
and the board suppresses the mobile long-press callout so the gesture
stays clean on phones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-16 10:49:59 -04:00
co-authored by Claude Fable 5
parent 6e6691c6c0
commit d34173df9f
+12 -2
View File
@@ -373,7 +373,10 @@
{@const cy = p.position.y * CELL + CELL * 0.36} {@const cy = p.position.y * CELL + CELL * 0.36}
<g <g
role="button" tabindex="-1" role="button" tabindex="-1"
onclick={(ev) => { ev.stopPropagation(); onPlayerClick?.(p.id); }} onclick={(ev) => { ev.stopPropagation(); if (peekFired) { peekFired = false; return; } onPlayerClick?.(p.id); }}
onpointerdown={() => pressCell(p.position)}
onpointerup={releasePress}
onpointerleave={releasePress}
onkeydown={() => {}} onkeydown={() => {}}
class="wizard" class="wizard"
> >
@@ -412,7 +415,10 @@
{@const ccy = c.position.y * CELL + CELL * 0.7} {@const ccy = c.position.y * CELL + CELL * 0.7}
<g <g
role="button" tabindex="-1" class="creature" role="button" tabindex="-1" class="creature"
onclick={(ev) => { ev.stopPropagation(); onCreatureClick?.(c.id); }} onclick={(ev) => { ev.stopPropagation(); if (peekFired) { peekFired = false; return; } onCreatureClick?.(c.id); }}
onpointerdown={() => pressCell(c.position)}
onpointerup={releasePress}
onpointerleave={releasePress}
onkeydown={() => {}} onkeydown={() => {}}
> >
{#if USE_TOKEN_ART && CREATURE_ART[c.kind]} {#if USE_TOKEN_ART && CREATURE_ART[c.kind]}
@@ -473,6 +479,10 @@
<style> <style>
.board { .board {
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
touch-action: manipulation;
width: 100%; width: 100%;
max-width: 680px; max-width: 680px;
background: #e3dcc7; background: #e3dcc7;