Skip to content

feat: keep AI vehicle labels visible in 'players' name mode#404

Merged
fank merged 2 commits into
mainfrom
feat/vehicle-type-labels
Apr 30, 2026
Merged

feat: keep AI vehicle labels visible in 'players' name mode#404
fank merged 2 commits into
mainfrom
feat/vehicle-type-labels

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Apr 30, 2026

Summary

User feedback:

It would be nice if AI's vehicle types would be visible at all times without having to have all AI's names (which cause clutter) visible. Very rarely you really care about individual AI's names, but you do care about type of vehicle they're driving.

In players mode the map now shows vehicle labels (e.g. "T-72 (3)") regardless of crew, while AI infantry names stay hidden. The none mode still hides everything, so the existing "hide all labels" escape hatch is preserved.

Behaviour matrix

nameMode Player infantry AI infantry Player vehicle AI vehicle
all shown shown shown shown
players shown hidden shown shown (was hidden)
none hidden hidden hidden hidden

Applies to both the canvas renderer (default) and the DOM Leaflet renderer (?renderer=dom fallback).

Test plan

  • npm test (1497 tests, includes 2 new ones for the players-mode vehicle case and the none suppression case)
  • tsc --noEmit clean
  • Manually verify on a recording with mixed AI/player crews that AI vehicle labels appear in players mode and disappear in none mode

Vehicle types are useful identifiers (T-72, BTR, etc.) even when you do
not care about individual AI infantry names. In "players" mode the
vehicle label is now shown for all vehicles regardless of crew, while
infantry AI names stay hidden. "none" still hides everything.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Coverage Report for ui

Status Category Percentage Covered / Total
🔵 Lines 98.99%
🟰 ±0%
4839 / 4888
🔵 Statements 98.39%
🟰 ±0%
6817 / 6928
🔵 Functions 98.01%
🟰 ±0%
1876 / 1914
🔵 Branches 89.13%
🟰 ±0%
2224 / 2495
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
ui/src/renderers/leaflet/entityCanvasLayer.ts 99.14%
🟰 ±0%
91.3%
🟰 ±0%
95.83%
🟰 ±0%
99.09%
🟰 ±0%
452-455
Generated in workflow #551 for commit 81e1ac9 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Leaflet renderer to keep vehicle type labels and popups visible when the name display mode is set to 'players', including for AI-controlled vehicles. This allows for vehicle identification without showing names for all AI infantry. The changes include updates to the label drawing logic, the InternalMarkerHandle interface, and popup visibility checks, along with new unit tests. A review comment suggests refactoring a long object initialization for better readability.

Comment thread ui/src/renderers/leaflet/leafletRenderer.ts Outdated
@fank fank merged commit 6025634 into main Apr 30, 2026
3 checks passed
@fank fank deleted the feat/vehicle-type-labels branch April 30, 2026 09:10
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