refactor: prebuild remaining setup-window focus handlers

This commit is contained in:
2026-02-20 01:36:20 -08:00
parent 86e0527630
commit c3afea6d40
2 changed files with 10 additions and 6 deletions

View File

@@ -414,3 +414,5 @@
- [2026-02-20T09:35:02Z] progress: extracted protocol URL registration dependency assembly to `protocol-url-handlers-main-deps.ts` and rewired main protocol registration call through builder.
- [2026-02-20T09:35:02Z] progress: normalized `cycleSecondarySubMode` to use prebuilt deps builder constant (avoids per-call rebuild).
- [2026-02-20T09:35:02Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `protocol-url-handlers*` and `secondary-sub-mode-main-deps` tests pass.
- [2026-02-20T09:35:02Z] progress: prebuilt setup-window focus handlers (`maybeFocusExistingAnilistSetupWindow`, `maybeFocusExistingJellyfinSetupWindow`) and injected them into corresponding main deps builders in `main.ts`.
- [2026-02-20T09:35:02Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + setup-window suites pass (`anilist-setup-window*`, `jellyfin-setup-window*`).

View File

@@ -1528,10 +1528,11 @@ const registerSubminerProtocolClient = createRegisterSubminerProtocolClientHandl
buildRegisterSubminerProtocolClientMainDepsHandler(),
);
const maybeFocusExistingAnilistSetupWindow = createMaybeFocusExistingAnilistSetupWindowHandler({
getSetupWindow: () => appState.anilistSetupWindow,
});
const buildOpenAnilistSetupWindowMainDepsHandler = createBuildOpenAnilistSetupWindowMainDepsHandler({
maybeFocusExistingSetupWindow: createMaybeFocusExistingAnilistSetupWindowHandler({
getSetupWindow: () => appState.anilistSetupWindow,
}),
maybeFocusExistingSetupWindow: maybeFocusExistingAnilistSetupWindow,
createSetupWindow: () =>
new BrowserWindow({
width: 1000,
@@ -1588,11 +1589,12 @@ function openAnilistSetupWindow(): void {
createOpenAnilistSetupWindowHandler(buildOpenAnilistSetupWindowMainDepsHandler())();
}
const maybeFocusExistingJellyfinSetupWindow = createMaybeFocusExistingJellyfinSetupWindowHandler({
getSetupWindow: () => appState.jellyfinSetupWindow,
});
const buildOpenJellyfinSetupWindowMainDepsHandler =
createBuildOpenJellyfinSetupWindowMainDepsHandler({
maybeFocusExistingSetupWindow: createMaybeFocusExistingJellyfinSetupWindowHandler({
getSetupWindow: () => appState.jellyfinSetupWindow,
}),
maybeFocusExistingSetupWindow: maybeFocusExistingJellyfinSetupWindow,
createSetupWindow: () =>
new BrowserWindow({
width: 520,