From 3129c9b5be4471199f3b924f7987c73c9a7f68f6 Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Sun, 10 May 2026 21:42:41 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20in-app=20chat=20replay=20viewer=20?= =?UTF-8?q?=E2=80=94=20read=20.chat.json/.chat.jsonl=20without=20leaving?= =?UTF-8?q?=20the=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Up to now, the app saved chat data (4.6.2 VOD replay, 4.6.3 live capture) but had no way to view it — users had to open the file in Notepad or write a custom parser. New in-app modal closes that loop: queue items with a sibling .chat.json or .chat.jsonl get a "View chat" button next to Open file / Show in folder; click pops a modal with a scrollable, filterable, formatted message list. Server: - New ipcMain.handle("read-chat-file") parses both formats. JSON Lines (.jsonl) is split per line, header row skipped, malformed lines silently dropped — that way a partial / killed live capture still renders. JSON object (.json) is the VOD replay shape with messages array. Hard-capped at 50k messages so a multi-day archive can't kill the renderer; truncation is reported via {truncated, total} in the result. Renderer: - New chatViewerModal in index.html — full-height list with a filter input + status line. - openChatViewer(filePath, title) loads the file via IPC, normalises the message shape (supports both .chat.json and .chat.jsonl fields), renders in 500-message chunks via setTimeout(0) so the main thread stays responsive on a 30k-message archive. - Each row: time marker (offset for replays, wall-clock for live), user (in their stored color), message text. Non-msg event types (subs, raids, clears) get a faint italic [type] tag. - Filter substring-matches user OR text, case-insensitive, instant. - Esc + outside-click + the close-x dismiss; Esc handler in closeTopmostOpenModal lists the chat viewer first so a user with multiple modals open closes the foreground one. Queue UI: - renderQueueItemFileActions detects sibling chat files (regex /\.chat\.json(l)?$/) in item.outputFiles and surfaces the View chat button. The button is shown for both 4.6.2-style replays and 4.6.3-style live captures because both formats parse. DE + EN locales for the button label, loading state, error, message count, truncation suffix. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/index.html | 13 ++++ src/main.ts | 52 +++++++++++++ src/preload.ts | 1 + src/renderer-globals.d.ts | 1 + src/renderer-locale-de.ts | 5 ++ src/renderer-locale-en.ts | 5 ++ src/renderer-queue.ts | 8 ++ src/renderer.ts | 151 +++++++++++++++++++++++++++++++++++++- 8 files changed, 235 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 10f8b57..9bced6e 100644 --- a/src/index.html +++ b/src/index.html @@ -136,6 +136,19 @@ + + +