Skip to content

feat: add projectile labels toggle to hide labels while keeping icons - #533

Merged
fank merged 1 commit into
mainfrom
feat/projectile-labels-toggle
Aug 1, 2026
Merged

feat: add projectile labels toggle to hide labels while keeping icons#533
fank merged 1 commit into
mainfrom
feat/projectile-labels-toggle

Conversation

@fank

@fank fank commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

Addresses OCAP2/OCAP#95.

Currently projectiles always show their shooter/projectile name label, with no way to keep the icons but hide the labels. This PR adds a "Projectile labels" checkbox in the View Settings Map layers panel.

  • Defaults to on (current behaviour preserved: icons + labels).
  • Unchecking it hides projectile name labels while keeping the icons visible.
  • Hiding projectiles entirely was already possible via the existing Projectiles layer toggle.

Changes

  • ui/src/renderers/renderer.interface.ts — add projectileLabelsVisible() / setProjectileLabelsVisible() to MapRenderer.
  • ui/src/renderers/leaflet/leafletRenderer.ts (DOM renderer) — signal-backed state + popup open/close; projectile label gating now independent from the briefing markerDisplayMode.
  • ui/src/renderers/leaflet/entityCanvasLayer.ts + canvasLeafletRenderer.ts (default canvas renderer) — skip drawing the label text when disabled, while still drawing the icon.
  • ui/src/renderers/mockRenderer.ts — mirror accessor/setter.
  • ui/src/pages/recording-playback/components/ViewSettings.tsx — checkbox UI.
  • ui/src/i18n/locales.tslayer_projectile_labels in all 8 languages.
  • Tests: ViewSettings.test.tsx, entityCanvasLayer.test.ts.

Verification

  • tsc --noEmit clean
  • vitest run — 1623 tests pass (75 files)
  • eslint clean on changed files
  • vite build succeeds

Adds a 'Projectile labels' checkbox in the View Settings map layers panel
that turns off projectile name labels (shooter/projectile) independently
while keeping the icons visible. Hiding projectiles entirely was already
available via the existing layer toggle.

Implements projectileLabelsVisible on the renderer interface, wired through
both the DOM (Leaflet) and default canvas renderers, plus i18n and tests.

Refs OCAP2/OCAP#95
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Coverage Report for ui

Status Category Percentage Covered / Total
🔵 Lines 98.96%
🟰 ±0%
5538 / 5596
🔵 Statements 98.31%
🟰 ±0%
7822 / 7956
🔵 Functions 97.8%
🟰 ±0%
2231 / 2281
🔵 Branches 89.59%
⬆️ +0.01%
2471 / 2758
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
ui/src/i18n/locales.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
ui/src/pages/recording-playback/components/ViewSettings.tsx 99.4%
⬆️ +0.05%
88.46%
🟰 ±0%
100%
🟰 ±0%
99.1%
⬆️ +0.08%
81
ui/src/renderers/mockRenderer.ts 100%
🟰 ±0%
100%
🟰 ±0%
91.42%
⬆️ +0.52%
100%
🟰 ±0%
ui/src/renderers/leaflet/entityCanvasLayer.ts 99.14%
🟰 ±0%
91.41%
⬆️ +0.11%
95.83%
🟰 ±0%
99.09%
🟰 ±0%
452-455
Generated in workflow #783 for commit 03bcb09 by the Vitest Coverage Report Action

@fank
fank merged commit 6b0ff05 into main Aug 1, 2026
3 checks passed
@fank
fank deleted the feat/projectile-labels-toggle branch August 1, 2026 09:59
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