M4: tokens, labels, statuses and lists #71
Notifications
Due Date
No due date set.
Blocks
Depends on
#72 M4: drag own tokens with prediction and rollback
SirStone/FFF_vtt_frozen
#68 M4: name prompt, connection badge, reconnect and resync
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#71
Reference in New Issue
Block a user
Part of #63
Goal
Pooled token rendering,
BitmapTextlabels, statuses, player character list and encountered list, GM sees all.Acceptance criteria
BitmapFontgm_onlytokensdevbox run testgreen on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at".User stories covered
Proven at
token renderer, lists panel, reducer token slice
Notes
Implemented and pushed as
429f023onmain(ref #71).What landed
client/src/slices/tokens.ts:tokenupsert /token_gone/helloreset; status names only (sourcenever stored); GM-only fields kept for the GM view.client/src/slices/characters.ts+client/src/slices/encountered.ts: own characters (ownCharactersOf, player = all received, GM filtered by owner) and the encountered list (full replace, set/del diff,grey); the GM's per-player copies are ignored.client/src/render/tokenBoard.ts(pure) +client/src/render/modules/tokens.ts: pooled nodes on thetokenslayer in world coordinates (composes with #69's camera), one shared unit-circleGraphicsContextper kind,BitmapTextlabels from one pre-installedBitmapFontassigned only on a name change,stuck/squeezedbadges, and a mount-time seed so an asyncapp.initcannot miss the resync.client/src/panels/lists.ts+client/src/render/modules/lists.ts:#listsunder the existing#panelshost (My characters,Encountered),textContentonly, greyed rows carrydata-grey+.grey+ an "out of sight" label. Mounted by a render module, so no shared bootstrap edit.data-tokens,data-token-entered|updated|left,data-token-labels,data-token-ids,data-token-statuses.Proof (all green on the rebased tree)
devbox run test— 157/157.devbox run client-test— 92/92 (test/tokens.test.ts,test/lists.test.ts,test/token-board.test.ts).devbox run e2e— 10/10, incl.client/e2e/tokens.test.mjsagainst the real server: player renders own + in-sight tokens and never thegm_onlyone, stuck badge, both lists,token_gone+ grey flip, one changed token = one updated entity with labels unchanged, GM renders all three.Shared file edit:
client/src/style.css(lists block appended; rebased over #74 and kept both). No reducer/stage/main/protocol changes.