From b77450b6eb4b6c6d5795b8dadafb3b9ff8ffd6ef Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 12 Apr 2026 18:31:06 +0200 Subject: [PATCH] =?UTF-8?q?fix(v2):=20comprehensive=20bug=20fix=20round=20?= =?UTF-8?q?=E2=80=94=20all=20reported=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Server stats: now shows player count, latency (rounded), uptime hours 2. Rares/Kills counters: fixed API response fields (all_time/total) 3. Chat send: wired socket.send with v1 envelope { player_name, command } 4. Stats button: opens Grafana iframe grid (4 panels, time range selector) 5. Char button: opens character window with attributes/skills/vitals from /character-stats/{name} API, structured display with sections 6. Inventory button: full inventory window with equipment table (material, set, imbue, AL, dmg, work, tink) + pack contents pill grid + filter 7. Radar button: opens radar window, sends start/stop commands via socket 8. Sidebar links: added Inventory Search, Suitbuilder, Player Debug 9. Color palette: expanded from 30 to 60 distinct colors matching v1 10. Window types properly routed: stats- prefix → Grafana, char- → character data, inv- → inventory, radar- → radar with socket commands Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/api/endpoints.ts | 13 +- frontend/src/components/map/MapLayout.tsx | 2 +- frontend/src/components/map/Sidebar.tsx | 15 ++- frontend/src/components/sidebar/PlayerRow.tsx | 2 +- .../components/windows/CharacterWindow.tsx | 116 ++++++++++------- .../src/components/windows/ChatWindow.tsx | 15 ++- .../components/windows/InventoryWindow.tsx | 110 ++++++++++++---- .../src/components/windows/RadarWindow.tsx | 58 +++++++++ .../src/components/windows/StatsWindow.tsx | 54 ++++++++ .../src/components/windows/WindowRenderer.tsx | 25 +++- frontend/src/hooks/useLiveData.ts | 9 +- frontend/src/hooks/usePlayerColors.ts | 24 +++- frontend/src/hooks/useWebSocket.ts | 4 +- frontend/src/styles/map-layout.css | 59 +++++++++ static/v2/assets/index-B55o-nLL.css | 1 - static/v2/assets/index-BkJV_2F3.js | 120 ------------------ static/v2/assets/index-Cr_LEFjh.js | 120 ++++++++++++++++++ static/v2/assets/index-DrsM2PEe.css | 1 + static/v2/index.html | 4 +- 19 files changed, 529 insertions(+), 223 deletions(-) create mode 100644 frontend/src/components/windows/RadarWindow.tsx create mode 100644 frontend/src/components/windows/StatsWindow.tsx delete mode 100644 static/v2/assets/index-B55o-nLL.css delete mode 100644 static/v2/assets/index-BkJV_2F3.js create mode 100644 static/v2/assets/index-Cr_LEFjh.js create mode 100644 static/v2/assets/index-DrsM2PEe.css diff --git a/frontend/src/api/endpoints.ts b/frontend/src/api/endpoints.ts index 63e5b588..52488544 100644 --- a/frontend/src/api/endpoints.ts +++ b/frontend/src/api/endpoints.ts @@ -9,14 +9,13 @@ interface CombatStatsResponse { stats: CombatStatsMessage[]; } -interface CountResponse { - total_rares?: number; - total_kills?: number; - count?: number; -} +// v1 response shapes: /total-rares → { all_time, today }, /total-kills → { total } +interface RaresResponse { all_time: number; today: number; } +interface KillsResponse { total: number; } export const getLive = () => apiFetch('/live'); export const getCombatStats = () => apiFetch('/combat-stats'); export const getServerHealth = () => apiFetch('/server-health'); -export const getTotalRares = () => apiFetch('/total-rares'); -export const getTotalKills = () => apiFetch('/total-kills'); +export const getTotalRares = () => apiFetch('/total-rares'); +export const getTotalKills = () => apiFetch('/total-kills'); +export const getCharacterStats = (name: string) => apiFetch>(`/character-stats/${encodeURIComponent(name)}`); diff --git a/frontend/src/components/map/MapLayout.tsx b/frontend/src/components/map/MapLayout.tsx index a4be9fbd..b4f377d6 100644 --- a/frontend/src/components/map/MapLayout.tsx +++ b/frontend/src/components/map/MapLayout.tsx @@ -57,7 +57,7 @@ export const MapLayout: React.FC = ({ data, onViewToggle }) => { showHeatmap={showHeatmap} showPortals={showPortals} /> - + diff --git a/frontend/src/components/map/Sidebar.tsx b/frontend/src/components/map/Sidebar.tsx index 54598cb7..e43a6d10 100644 --- a/frontend/src/components/map/Sidebar.tsx +++ b/frontend/src/components/map/Sidebar.tsx @@ -58,8 +58,12 @@ export const Sidebar: React.FC = ({
- Coldeve - {serverHealth?.latency_ms != null && {serverHealth.latency_ms}ms} + Coldeve {isOnline ? 'Online' : 'Offline'} + {serverHealth?.player_count != null && 👥 {serverHealth.player_count}} + {serverHealth?.latency_ms != null && {Math.round(serverHealth.latency_ms)}ms} + {serverHealth?.uptime_seconds != null && ( + Up: {Math.floor(serverHealth.uptime_seconds / 3600)}h + )}
@@ -68,6 +72,13 @@ export const Sidebar: React.FC = ({
{totalKills.toLocaleString()}Kills
+ {/* Tool links */} + + {/* Map toggles */}