In-mission SELECTED portrait: pick by unit sprite, not by side fallback (sub-issue 22-2) #25

Closed
opened 2026-10-04 21:31:33 +00:00 by Mark · 1 comment
Owner

Parent-Issue: #22

Sub-issue 22-2 — selected-panel portrait is missing for non-squad

web/js/ui.js updateUI() line 644 selects PORTRAIT[u.sprite] only when the
sprite is in PORTRAIT. For non-squad enemies inspected via LMB, the renderer
falls back to assets/portraits/<vex|ganger>.png — wrong portrait for the
inspected unit. Concrete symptom: SABLE (an enemy) shows VEX's face when
inspected because VEX is the first squad sprite in the PORTRAIT map.

Fix

The fallback on line 644 should not pick a squad portrait. Options:

  1. Use a neutral silhouette image (assets/portraits/silhouette.png) when the
    inspected unit's sprite is not in PORTRAIT.
  2. Add portraits for all enemy sprites so the lookup always hits.
  3. Skip the portrait <img> and render a placeholder element when no
    portrait exists for the inspected unit.

Pick the smallest change that satisfies the acceptance below.

File(s)

  • web/js/ui.js line 644 (one-line change)

Acceptance

  • LMB on a visible hostile shows that hostile's portrait (or a neutral
    silhouette); no squad portrait leaks into the enemy inspect path
  • make ci passes

Refs

  • Parent: #22 (battle UI contract, sub-issue B)
  • web/js/ui.js:644
**Parent-Issue:** #22 ## Sub-issue 22-2 — selected-panel portrait is missing for non-squad `web/js/ui.js` `updateUI()` line 644 selects `PORTRAIT[u.sprite]` only when the sprite is in `PORTRAIT`. For non-squad enemies inspected via LMB, the renderer falls back to `assets/portraits/<vex|ganger>.png` — wrong portrait for the inspected unit. Concrete symptom: SABLE (an enemy) shows VEX's face when inspected because VEX is the first squad sprite in the `PORTRAIT` map. ## Fix The fallback on line 644 should not pick a squad portrait. Options: 1. Use a neutral silhouette image (`assets/portraits/silhouette.png`) when the inspected unit's sprite is not in `PORTRAIT`. 2. Add portraits for all enemy sprites so the lookup always hits. 3. Skip the portrait `<img>` and render a placeholder element when no portrait exists for the inspected unit. Pick the smallest change that satisfies the acceptance below. ## File(s) - `web/js/ui.js` line 644 (one-line change) ## Acceptance - [ ] LMB on a visible hostile shows that hostile's portrait (or a neutral silhouette); no squad portrait leaks into the enemy inspect path - [ ] `make ci` passes ## Refs - Parent: #22 (battle UI contract, sub-issue B) - `web/js/ui.js:644`
Author
Owner

Fixed in commit 18ced82 on origin/main.

The web/js/ui.js updateUI() line 676 fallback (which used vex.png for squad / ganger.png for non-squad when a sprite id is not in PORTRAIT) now renders a neutral striped <div class="selport selport-miss"> placeholder instead.

  • No squad portrait can leak into a non-squad inspect path
  • All 11 in-map portraits still resolve correctly
  • CSS: #sel .selport-miss { background: repeating-linear-gradient(45deg, #05070b 0 6px, #0e1218 6px 12px); }
  • make ci (lint + godot import + playwright smoke) all pass
Fixed in commit 18ced82 on origin/main. The `web/js/ui.js updateUI()` line 676 fallback (which used `vex.png` for squad / `ganger.png` for non-squad when a sprite id is not in `PORTRAIT`) now renders a neutral striped `<div class="selport selport-miss">` placeholder instead. - No squad portrait can leak into a non-squad inspect path - All 11 in-map portraits still resolve correctly - CSS: `#sel .selport-miss { background: repeating-linear-gradient(45deg, #05070b 0 6px, #0e1218 6px 12px); }` - `make ci` (lint + godot import + playwright smoke) all pass
Mark closed this issue 2026-10-05 21:05:04 +00:00
Sign in to join this conversation.
No description provided.