From 211174f889fd47339568bf547b64305c15774d00 Mon Sep 17 00:00:00 2001 From: Andre <200930841+Andre-Bzk@users.noreply.github.com> Date: Thu, 14 May 2026 12:57:29 +0200 Subject: [PATCH] refactor: extract IPC channel names into a single source of truth Duplicate raw string literals across handlers.ts, preload/index.ts made typos undetectable at compile time and renames a multi-file grep problem. A single channels.ts now owns all channel names; both files import from it. Also fixes two bugs found during testing: - LoginScreen and AccountScreen buttons were not triggerable via gamepad A-button: synthetic KeyboardEvents are untrusted and don't fire native button clicks. Added explicit keydown handlers that call the action directly. - AppShell loading overlay could disappear while hlsPayload was still null if the playback:event 'started' IPC message arrived before playback:hls-url. Overlay now stays visible until hlsPayload is set, regardless of playState. --- CLAUDE.md | 26 +++++++++++++--- src/main/ipc/channels.ts | 36 ++++++++++++++++++++++ src/main/ipc/handlers.ts | 35 ++------------------- src/preload/index.ts | 34 +------------------- src/renderer/src/screens/AccountScreen.tsx | 2 ++ src/renderer/src/screens/AppShell.tsx | 2 +- src/renderer/src/screens/LoginScreen.tsx | 10 ++++++ src/renderer/src/types/t4sd.d.ts | 1 + 8 files changed, 75 insertions(+), 71 deletions(-) create mode 100644 src/main/ipc/channels.ts diff --git a/CLAUDE.md b/CLAUDE.md index 9049124..1c4afaa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,7 +39,10 @@ Renderer (React) │ ChannelScreen (Hauptscreen), StreamListScreen, Settings, Account ├── components/ │ ├── VideoPlayer.tsx — hls.js