Skip to content

fix(game): colour bots by team, and make the mode picker clickable#32

Merged
ralyodio merged 1 commit into
mainfrom
fix/teams-and-picker
Jul 26, 2026
Merged

fix(game): colour bots by team, and make the mode picker clickable#32
ralyodio merged 1 commit into
mainfrom
fix/teams-and-picker

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Two bugs found on the live build.

The mode picker was inert

#ui sets pointer-events: none so the HUD never eats a click meant for the canvas, and re-enables it for exactly three selectors — button, a, [data-interactive]. The picker is built from <label>, which is none of those, so every click passed straight through. It rendered correctly, highlighted nothing, and responded to nothing — which reads as two disabled options.

My own verification missed it because the Playwright click used force: true, which skips precisely the actionability check that would have caught it. Re-verified without it: pointerEvents: auto, URL moves to ?mode=range, radio checked.

hud.test.ts now guards the opt-in and the global selector list it depends on, so changing that list fails loudly instead of silently disabling controls.

Both teams looked identical, because they were

Opponents never applied any material pass. Friendlies and enemies were the same model with the same materials, differing only in which weapon they held — invisible from the front and at any range that matters. A previous commit message of mine referred to figures being legible "before the team tint on its marker resolves"; there was no tint. That was wrong, and this adds it.

brightenCharacter now takes a palette, split on two axes rather than one — a single hue on a small webbing band is not readable at this yard's engagement ranges:

Cloth (silhouette at 40 m) Band (confirms up close)
Nightcell cool grey-green signal cyan — what the HUD already uses for "yours"
Directorate warm khaki red — matching the yard's containers and hazard paint

The clone cache is deliberately per-call: the source material is shared by every character instance, so hoisting it would hand the second team the first team's colours.

Verification

Typecheck, lint, 249 tests (4 new) and the build pass. Picker verified with a real click; bots render visibly cool vs warm where they were uniformly dark before.

🤖 Generated with Claude Code

Two bugs the user hit on the live build.

**The mode picker was inert.** `#ui` sets `pointer-events: none` so the HUD
never eats a click meant for the canvas, and re-enables it for exactly three
selectors: `button`, `a` and `[data-interactive]`. The picker is built from
`<label>`, which is none of those, so every click passed straight through. It
rendered correctly, highlighted nothing and responded to nothing — which reads
as two disabled options.

My own verification missed it because the Playwright click used `force: true`,
which skips the actionability check that would have caught it. The fix opts in
via the attribute the codebase already uses for this, plus an explicit CSS rule,
and `hud.test.ts` now guards both along with the global selector list they
depend on.

**Both teams looked identical, because they were.** `Opponents` never applied
any material pass at all: friendlies and enemies were the same model with the
same materials, differing only in which weapon they held — invisible from the
front and at any range that matters. A previous commit message of mine claimed
figures were legible "before the team tint on its marker resolves"; there was no
tint. That was wrong and this adds it.

`brightenCharacter` now takes a palette, and the split is on two axes rather
than one. A single hue on a small webbing band is not readable at the ranges
this yard plays at, so the cloth carries a warm/cool split that works as a
silhouette at 40 m and the band carries the saturated hue that confirms it up
close. Nightcell is cool grey-green with signal cyan — the colour the HUD
already uses for "yours" — and the Directorate warm khaki with red, matching the
yard's own containers and hazard paint.

The clone cache in `brightenCharacter` is deliberately per-call: the source
material is shared by every character instance, so hoisting it would hand the
second team the first team's colours.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 90f5980 into main Jul 26, 2026
6 checks passed
@ralyodio
ralyodio deleted the fix/teams-and-picker branch July 26, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant