fix(client): make colonist roster card clicks 100% reliable (fixes #16) #17
No reviewers
Labels
No labels
agent/claude
agent/gemini
agent/kimi
area/assets
area/client
area/server
area/sim-core
priority/high
priority/low
priority/medium
status/blocked
status/needs-review
type/bug
type/chore
type/docs
type/feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
game-dev/RicosWorld!17
Loading…
Reference in a new issue
No description provided.
Delete branch "gemini/16-colonist-click-reliability"
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?
Fixes #16
Root Cause
renderColonistRoster()was executingbar.innerHTML = ''and regenerating all DOM elements (.colonist-pill) on every tick/delta (10 Hz).mousedownhit elementA.Awith new elementB.mouseuphit elementB.clickevent because the start and end target nodes were different instances.Solution
renderColonistRoster()now updates existing DOM nodes in-place without clearingbar.innerHTML. Elements are only created once per pawn and pruned when removed.#colonist-roster-barusing.closest('.colonist-pill')anddata-pawn-id.user-select: none;on.colonist-pillto prevent accidental text highlight during quick consecutive clicks.