fix: Replace unsafe .toFixed() calls with safeFixed() in analytics views

- AnalyticsView: avg_players, uptime_percentage
- WipeAnalyticsView: success_rate, population curve, durations, CSV export
- PlayerRetentionView: retention percentages, session duration, tooltip
- MapAnalyticsView: rotation effectiveness, performance metrics, table

All analytics views now use safe formatter utilities with optional chaining
to prevent null/undefined runtime errors when displaying numeric data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell
2026-02-15 21:56:04 -05:00
parent daa9c3035f
commit 26e717ac96
18 changed files with 111 additions and 53 deletions

View File

@@ -2,6 +2,7 @@
import { onMounted } from 'vue'
import { useWipeStore } from '@/stores/wipe'
import { History, RefreshCw } from 'lucide-vue-next'
import { safeDate } from '@/utils/formatters'
const wipeStore = useWipeStore()
@@ -85,7 +86,7 @@ onMounted(() => {
</span>
</td>
<td class="px-4 py-3 text-sm text-neutral-400">
{{ wipe.started_at ? new Date(wipe.started_at).toLocaleString() : '\u2014' }}
{{ safeDate(wipe.started_at, '\u2014') }}
</td>
<td class="px-4 py-3 text-sm text-neutral-400 font-mono">
{{ duration(wipe.started_at, wipe.completed_at) }}