fix(game): colour bots by team, and make the mode picker clickable#32
Merged
Conversation
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>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs found on the live build.
The mode picker was inert
#uisetspointer-events: noneso 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.tsnow 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
Opponentsnever 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.brightenCharacternow 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: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