From 936da0070a54714a0007b37bc5bd19fce82fd79d Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 30 Apr 2026 18:01:28 -0400 Subject: [PATCH] Remove file upload from replay viewer, hide load panel when URL provided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove the Choose File / file input from the Load Replay panel entirely - Hide the Load Replay panel when a ?url= param is already in the route, so navigating from a match link goes straight to the replay with no form in the way - Update no-replay overlay text: "Loading replay…" vs "Enter a replay URL" - Remove the fileInput change listener (file uploads no longer supported) Co-Authored-By: Claude Sonnet 4.6 --- web/src/pages/replay.ts | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/web/src/pages/replay.ts b/web/src/pages/replay.ts index bc95b4a..04ce96f 100644 --- a/web/src/pages/replay.ts +++ b/web/src/pages/replay.ts @@ -61,7 +61,7 @@ function initReplayViewerWithClass(ReplayViewerClass: any, initialUrl?: string):
-
Load a replay file to view
+
${initialUrl ? 'Loading replay…' : 'Enter a replay URL to load'}
@@ -85,7 +85,7 @@ function initReplayViewerWithClass(ReplayViewerClass: any, initialUrl?: string):
- Load a replay + ${initialUrl ? 'Loading…' : 'Enter a URL to load'}
@@ -113,19 +113,17 @@ function initReplayViewerWithClass(ReplayViewerClass: any, initialUrl?: string):
-
+ + +

Playback

@@ -514,7 +512,6 @@ function initReplayViewerWithClass(ReplayViewerClass: any, initialUrl?: string): function initReplayViewer(ReplayViewerClass: any, initialUrl?: string): void { const canvas = document.getElementById('replay-canvas') as HTMLCanvasElement; const noReplayDiv = document.getElementById('no-replay') as HTMLDivElement; - const fileInput = document.getElementById('file-input') as HTMLInputElement; const urlInput = document.getElementById('url-input') as HTMLInputElement; const loadUrlBtn = document.getElementById('load-url-btn') as HTMLButtonElement; const playBtn = document.getElementById('play-btn') as HTMLButtonElement; @@ -1354,18 +1351,6 @@ function initReplayViewer(ReplayViewerClass: any, initialUrl?: string): void { noReplayDiv.innerHTML = `${escapeHtml(String(msg))}`; } - fileInput.addEventListener('change', async (e) => { - const file = (e.target as HTMLInputElement).files?.[0]; - if (!file) return; - try { - const text = await file.text(); - const replay = JSON.parse(text) as Replay; - loadReplay(replay); - } catch (err) { - showLoadError('Failed to load replay: ' + err); - } - }); - loadUrlBtn.addEventListener('click', async () => { const url = urlInput.value.trim(); if (!url) return;