Skip to content

fix: honor disableKillCount in playback UI (#87)#405

Merged
fank merged 1 commit into
mainfrom
fix/disable-kill-count
Apr 30, 2026
Merged

fix: honor disableKillCount in playback UI (#87)#405
fank merged 1 commit into
mainfrom
fix/disable-kill-count

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Apr 30, 2026

Summary

  • The disableKillCount customize setting was exposed via /api/v1/customize but never consumed by the SolidJS frontend, so it had no visible effect.
  • Hides per-player kill counts in the units list, unit detail card, and stats leaderboard while keeping per-side totals, matching the v2.0 behavior requested in the issue.
  • Honors disableKillCount even when customize.enabled is false, since it's a privacy toggle rather than a branding option (branding fields still require enabled).

Fixes OCAP2/OCAP#87

Test plan

  • npx vitest run src/hooks/__tests__/useCustomize.test.tsx (added new test for the enabled:false + disableKillCount:true path)
  • npx vitest run src/pages/recording-playback/ (313 tests pass)
  • npx tsc --noEmit
  • Manual: with customize.disableKillCount: true, verify unit row kill chips, detail card KILLS/DEATHS pills, and the leaderboard are hidden, while per-side totals in the Stats tab remain visible.

The disableKillCount customize setting was exposed via the API but never
consumed by the SolidJS frontend. Hide per-player kill counts in the
units list, unit detail card, and stats leaderboard while keeping the
per-side totals, matching v2.0 behavior.

Also honor disableKillCount even when customize.enabled is false, since
it is a privacy toggle rather than a branding option.
@github-actions
Copy link
Copy Markdown

Coverage Report for ui

Status Category Percentage Covered / Total
🔵 Lines 98.99%
🟰 ±0%
4848 / 4897
🔵 Statements 98.4%
⬆️ +0.01%
6836 / 6947
🔵 Functions 98.02%
⬆️ +0.01%
1885 / 1923
🔵 Branches 89.18%
⬆️ +0.05%
2234 / 2505
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
ui/src/hooks/useCustomize.tsx 100%
🟰 ±0%
91.66%
⬆️ +1.66%
100%
🟰 ±0%
100%
🟰 ±0%
ui/src/pages/recording-playback/components/StatsTab.tsx 100%
🟰 ±0%
95.65%
⬆️ +0.20%
100%
🟰 ±0%
100%
🟰 ±0%
ui/src/pages/recording-playback/components/UnitsTab.tsx 97.17%
⬆️ +0.15%
91.42%
⬆️ +0.80%
97.8%
⬆️ +0.19%
100%
🟰 ±0%
136-144, 219-220
Generated in workflow #553 for commit b7e4d09 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 introduces a privacy toggle to hide kill counts and leaderboards, ensuring the disableKillCount setting is honored even when general customization is disabled. Changes include updates to the useCustomize hook, corresponding unit tests, and conditional rendering logic in the StatsTab and UnitsTab components. Feedback was provided regarding the UnitsTab.tsx file, noting that the SolidJS <Show> component requires a single child element and suggesting the use of fragments and classList for better style management.

Comment thread ui/src/pages/recording-playback/components/UnitsTab.tsx
@fank fank merged commit 66bb5ac into main Apr 30, 2026
3 checks passed
@fank fank deleted the fix/disable-kill-count branch April 30, 2026 11:56
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.

Web - Disable Kill Count does nothing

1 participant