refactor(main): move IPC, CLI and app-ready wiring into assemblies (#311)

This commit is contained in:
sudacode authored and GitHub committed 2026-11-01 17:59:52 -08:00
1 parent 655510cf2e
commit 696462a82e
33 files changed
+3719 -2101

No files matched your search

+2 -2
View File
@@ -54,7 +54,7 @@ function makeDeps(overrides: Partial<AppReadyRuntimeDeps> = {}) {
startBackgroundWarmups: () => {
calls.push('startBackgroundWarmups');
},
texthookerOnlyMode: false,
isTexthookerOnlyMode: () => false,
shouldAutoInitializeOverlayRuntimeFromConfig: () => true,
setVisibleOverlayVisible: (visible) => calls.push(`setVisibleOverlayVisible:${visible}`),
initializeOverlayRuntime: () => calls.push('initializeOverlayRuntime'),
@@ -180,7 +180,7 @@ test('runAppReadyRuntime skips heavy startup when shouldSkipHeavyStartup returns
test('runAppReadyRuntime keeps websocket startup in texthooker-only mode but skips overlay window', async () => {
const { deps, calls } = makeDeps({
texthookerOnlyMode: true,
isTexthookerOnlyMode: () => true,
reloadConfig: () => calls.push('reloadConfig'),
handleInitialArgs: () => calls.push('handleInitialArgs'),
});
+1 -1
View File
@@ -44,7 +44,7 @@ function createAppReadyDeps(overrides: Partial<AppReadyRuntimeDeps> = {}) {
handleFirstRunSetup: recordAsync('first-run'),
prewarmSubtitleDictionaries: recordAsync('prewarm'),
startBackgroundWarmups: record('warmups'),
texthookerOnlyMode: false,
isTexthookerOnlyMode: () => false,
shouldAutoInitializeOverlayRuntimeFromConfig: () => false,
setVisibleOverlayVisible: record('visible-overlay'),
initializeOverlayRuntime: record('init-overlay'),
+3 -2
View File
@@ -148,7 +148,8 @@ export interface AppReadyRuntimeDeps {
handleFirstRunSetup: () => Promise<void>;
prewarmSubtitleDictionaries?: () => Promise<void>;
startBackgroundWarmups: () => void;
texthookerOnlyMode: boolean;
/** Read when app-ready reaches the overlay decision, after startup state is applied. */
isTexthookerOnlyMode: () => boolean;
shouldAutoInitializeOverlayRuntimeFromConfig: () => boolean;
setVisibleOverlayVisible: (visible: boolean) => void;
initializeOverlayRuntime: () => void;
@@ -351,7 +352,7 @@ export async function runAppReadyRuntime(deps: AppReadyRuntimeDeps): Promise<voi
deps.log('Runtime ready: immersion tracker dependency is missing.');
}
if (deps.texthookerOnlyMode) {
if (deps.isTexthookerOnlyMode()) {
deps.log('Texthooker-only mode enabled; skipping overlay window.');
startBackgroundWarmupsOnce();
} else if (deps.shouldAutoInitializeOverlayRuntimeFromConfig()) {