From bc6f581ea553101a727a35e87a08b14f006b7c82 Mon Sep 17 00:00:00 2001 From: sudacode Date: Thu, 26 Feb 2026 23:27:25 -0800 Subject: [PATCH] fix: address claude review action items --- src/config/resolve/subtitle-domains.ts | 2 +- src/core/services/overlay-bridge.ts | 4 +--- src/main/overlay-runtime.ts | 13 +++++++------ src/renderer/subtitle-render.ts | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/config/resolve/subtitle-domains.ts b/src/config/resolve/subtitle-domains.ts index 0307574..fae006c 100644 --- a/src/config/resolve/subtitle-domains.ts +++ b/src/config/resolve/subtitle-domains.ts @@ -170,7 +170,7 @@ export function applySubtitleDomainConfig(context: ResolveContext): void { 'subtitleStyle.hoverTokenBackgroundColor', (src.subtitleStyle as { hoverTokenBackgroundColor?: unknown }).hoverTokenBackgroundColor, resolved.subtitleStyle.hoverTokenBackgroundColor, - 'Expected string.', + 'Expected a CSS color value (hex, rgba/hsl/hsla, named color, or var()).', ); } diff --git a/src/core/services/overlay-bridge.ts b/src/core/services/overlay-bridge.ts index a0461be..99642da 100644 --- a/src/core/services/overlay-bridge.ts +++ b/src/core/services/overlay-bridge.ts @@ -27,9 +27,7 @@ export function sendToVisibleOverlayRuntime(options: { } }; - const getURL = options.mainWindow.webContents.getURL; - const currentURL = - typeof getURL === 'function' ? getURL.call(options.mainWindow.webContents) : 'ready'; + const currentURL = options.mainWindow.webContents.getURL(); const isReady = !options.mainWindow.webContents.isLoading() && currentURL !== '' && diff --git a/src/main/overlay-runtime.ts b/src/main/overlay-runtime.ts index e33e75e..ca87c93 100644 --- a/src/main/overlay-runtime.ts +++ b/src/main/overlay-runtime.ts @@ -65,12 +65,13 @@ export function createOverlayModalRuntimeService( return null; }; - const isWindowReadyForIpc = (window: BrowserWindow): boolean => { - if (window.webContents.isLoading()) { - return false; - } - return window.webContents.getURL() !== '' && window.webContents.getURL() !== 'about:blank'; - }; +const isWindowReadyForIpc = (window: BrowserWindow): boolean => { + if (window.webContents.isLoading()) { + return false; + } + const currentURL = window.webContents.getURL(); + return currentURL !== '' && currentURL !== 'about:blank'; +}; const sendOrQueueForWindow = ( window: BrowserWindow, diff --git a/src/renderer/subtitle-render.ts b/src/renderer/subtitle-render.ts index e337e84..b4480a3 100644 --- a/src/renderer/subtitle-render.ts +++ b/src/renderer/subtitle-render.ts @@ -111,7 +111,7 @@ function applyInlineStyleDeclarations( } const cssValue = String(value); - if (key.startsWith('-') || key.includes('-')) { + if (key.includes('-')) { target.style.setProperty(key, cssValue); if (key === '--webkit-text-stroke') { target.style.setProperty('-webkit-text-stroke', cssValue);