mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor: prebuild additional main runtime deps in startup flow
This commit is contained in:
@@ -6,7 +6,7 @@ Read first. Keep concise.
|
||||
| ------------ | -------------- | ---------------------------------------------------- | --------- | ------------------------------------- | ---------------------- |
|
||||
| `codex-generate-minecard-image-20260220T112900Z-vsxr` | `codex-generate-minecard-image` | `Generate media fallbacks (GIF) from assets/minecard.webm and wire README/docs fallback markup` | `done` | `docs/subagents/agents/codex-generate-minecard-image-20260220T112900Z-vsxr.md` | `2026-02-20T11:35:30Z` |
|
||||
| `codex-main` | `planner-exec` | `Fix frequency/N+1 regression in plugin --start flow` | `in_progress` | `docs/subagents/agents/codex-main.md` | `2026-02-19T19:36:46Z` |
|
||||
| `codex-task85-20260219T233711Z-46hc` | `codex-task85` | `Resume TASK-85 maintainability refactor from latest handoff point` | `in_progress` | `docs/subagents/agents/codex-task85-20260219T233711Z-46hc.md` | `2026-02-20T09:41:54Z` |
|
||||
| `codex-task85-20260219T233711Z-46hc` | `codex-task85` | `Resume TASK-85 maintainability refactor from latest handoff point` | `in_progress` | `docs/subagents/agents/codex-task85-20260219T233711Z-46hc.md` | `2026-02-20T09:43:47Z` |
|
||||
| `codex-config-validation-20260219T172015Z-iiyf` | `codex-config-validation` | `Find root cause of config validation error for ~/.config/SubMiner/config.jsonc` | `completed` | `docs/subagents/agents/codex-config-validation-20260219T172015Z-iiyf.md` | `2026-02-19T17:26:17Z` |
|
||||
| `codex-task85-20260219T233711Z-46hc` | `codex-task85` | `Resume TASK-85 maintainability refactor from latest handoff point` | `in_progress` | `docs/subagents/agents/codex-task85-20260219T233711Z-46hc.md` | `2026-02-20T02:56:34Z` |
|
||||
| `codex-anilist-deeplink-20260219T233926Z` | `anilist-deeplink` | `Fix external subminer:// AniList callback handling from browser` | `done` | `docs/subagents/agents/codex-anilist-deeplink-20260219T233926Z.md` | `2026-02-19T23:59:21Z` |
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
## Current Work (newest first)
|
||||
|
||||
- [2026-02-20T09:43:47Z] progress: completed larger safe batch in `src/main.ts` across 3 contiguous slices (15 normalized sites) by prebuilding finalized deps objects for AniList media-state handlers, AniList post-watch/retry handlers, and protocol/lifecycle/subtitle-position handlers.
|
||||
- [2026-02-20T09:43:47Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + targeted suites pass for `anilist-media-state*`, `anilist-media-guess*`, `anilist-post-watch*`, `subtitle-position*`, `protocol-url-handlers*`, `app-lifecycle-main-activate*`, `startup-config*` (39/39).
|
||||
- [2026-02-20T09:43:47Z] scope: staging only `src/main.ts` + subagent bookkeeping files for one large checkpoint commit; excluding unrelated `vendor/texthooker-ui`, backlog task draft, and other agent files.
|
||||
- [2026-02-20T09:41:54Z] progress: completed another 5-block safe normalization in `src/main.ts` by prebuilding finalized deps objects for `notifyAnilistSetup`, `consumeAnilistSetupTokenFromUrl`, `handleAnilistSetupProtocolUrl`, `registerSubminerProtocolClient`, and `refreshAnilistClientSecretState`.
|
||||
- [2026-02-20T09:41:54Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + targeted AniList suites pass: `anilist-setup-protocol-main-deps`, `anilist-setup-protocol`, `anilist-token-refresh-main-deps`, `anilist-token-refresh` (13/13).
|
||||
- [2026-02-20T09:41:54Z] scope: staged-only checkpoint planned for `src/main.ts` + subagent bookkeeping files; excluding unrelated `vendor/texthooker-ui` and other agent/backlog artifacts.
|
||||
|
||||
55
src/main.ts
55
src/main.ts
@@ -1683,8 +1683,10 @@ const buildGetCurrentAnilistMediaKeyMainDepsHandler =
|
||||
createBuildGetCurrentAnilistMediaKeyMainDepsHandler({
|
||||
getCurrentMediaPath: () => appState.currentMediaPath,
|
||||
});
|
||||
const getCurrentAnilistMediaKeyMainDeps =
|
||||
buildGetCurrentAnilistMediaKeyMainDepsHandler();
|
||||
const getCurrentAnilistMediaKey = createGetCurrentAnilistMediaKeyHandler(
|
||||
buildGetCurrentAnilistMediaKeyMainDepsHandler(),
|
||||
getCurrentAnilistMediaKeyMainDeps,
|
||||
);
|
||||
|
||||
const buildResetAnilistMediaTrackingMainDepsHandler =
|
||||
@@ -1705,8 +1707,10 @@ const buildResetAnilistMediaTrackingMainDepsHandler =
|
||||
anilistLastDurationProbeAtMs = value;
|
||||
},
|
||||
});
|
||||
const resetAnilistMediaTrackingMainDeps =
|
||||
buildResetAnilistMediaTrackingMainDepsHandler();
|
||||
const resetAnilistMediaTracking = createResetAnilistMediaTrackingHandler(
|
||||
buildResetAnilistMediaTrackingMainDepsHandler(),
|
||||
resetAnilistMediaTrackingMainDeps,
|
||||
);
|
||||
|
||||
const buildGetAnilistMediaGuessRuntimeStateMainDepsHandler =
|
||||
@@ -1717,8 +1721,10 @@ const buildGetAnilistMediaGuessRuntimeStateMainDepsHandler =
|
||||
getMediaGuessPromise: () => anilistCurrentMediaGuessPromise,
|
||||
getLastDurationProbeAtMs: () => anilistLastDurationProbeAtMs,
|
||||
});
|
||||
const getAnilistMediaGuessRuntimeStateMainDeps =
|
||||
buildGetAnilistMediaGuessRuntimeStateMainDepsHandler();
|
||||
const getAnilistMediaGuessRuntimeState = createGetAnilistMediaGuessRuntimeStateHandler(
|
||||
buildGetAnilistMediaGuessRuntimeStateMainDepsHandler(),
|
||||
getAnilistMediaGuessRuntimeStateMainDeps,
|
||||
);
|
||||
|
||||
const buildSetAnilistMediaGuessRuntimeStateMainDepsHandler =
|
||||
@@ -1739,8 +1745,10 @@ const buildSetAnilistMediaGuessRuntimeStateMainDepsHandler =
|
||||
anilistLastDurationProbeAtMs = value;
|
||||
},
|
||||
});
|
||||
const setAnilistMediaGuessRuntimeStateMainDeps =
|
||||
buildSetAnilistMediaGuessRuntimeStateMainDepsHandler();
|
||||
const setAnilistMediaGuessRuntimeState = createSetAnilistMediaGuessRuntimeStateHandler(
|
||||
buildSetAnilistMediaGuessRuntimeStateMainDepsHandler(),
|
||||
setAnilistMediaGuessRuntimeStateMainDeps,
|
||||
);
|
||||
|
||||
const buildResetAnilistMediaGuessStateMainDepsHandler =
|
||||
@@ -1752,8 +1760,10 @@ const buildResetAnilistMediaGuessStateMainDepsHandler =
|
||||
anilistCurrentMediaGuessPromise = value;
|
||||
},
|
||||
});
|
||||
const resetAnilistMediaGuessStateMainDeps =
|
||||
buildResetAnilistMediaGuessStateMainDepsHandler();
|
||||
const resetAnilistMediaGuessState = createResetAnilistMediaGuessStateHandler(
|
||||
buildResetAnilistMediaGuessStateMainDepsHandler(),
|
||||
resetAnilistMediaGuessStateMainDeps,
|
||||
);
|
||||
|
||||
const buildMaybeProbeAnilistDurationMainDepsHandler =
|
||||
@@ -1767,8 +1777,10 @@ const buildMaybeProbeAnilistDurationMainDepsHandler =
|
||||
requestMpvDuration: async () => appState.mpvClient?.requestProperty('duration'),
|
||||
logWarn: (message, error) => logger.warn(message, error),
|
||||
});
|
||||
const maybeProbeAnilistDurationMainDeps =
|
||||
buildMaybeProbeAnilistDurationMainDepsHandler();
|
||||
const maybeProbeAnilistDuration = createMaybeProbeAnilistDurationHandler(
|
||||
buildMaybeProbeAnilistDurationMainDepsHandler(),
|
||||
maybeProbeAnilistDurationMainDeps,
|
||||
);
|
||||
|
||||
const buildEnsureAnilistMediaGuessMainDepsHandler = createBuildEnsureAnilistMediaGuessMainDepsHandler(
|
||||
@@ -1783,8 +1795,10 @@ const buildEnsureAnilistMediaGuessMainDepsHandler = createBuildEnsureAnilistMedi
|
||||
guessAnilistMediaInfo: (mediaPath, mediaTitle) => guessAnilistMediaInfo(mediaPath, mediaTitle),
|
||||
},
|
||||
);
|
||||
const ensureAnilistMediaGuessMainDeps =
|
||||
buildEnsureAnilistMediaGuessMainDepsHandler();
|
||||
const ensureAnilistMediaGuess = createEnsureAnilistMediaGuessHandler(
|
||||
buildEnsureAnilistMediaGuessMainDepsHandler(),
|
||||
ensureAnilistMediaGuessMainDeps,
|
||||
);
|
||||
|
||||
const rememberAnilistAttemptedUpdate = (key: string): void => {
|
||||
@@ -1816,8 +1830,10 @@ const buildProcessNextAnilistRetryUpdateMainDepsHandler =
|
||||
logInfo: (message) => logger.info(message),
|
||||
now: () => Date.now(),
|
||||
});
|
||||
const processNextAnilistRetryUpdateMainDeps =
|
||||
buildProcessNextAnilistRetryUpdateMainDepsHandler();
|
||||
const processNextAnilistRetryUpdate = createProcessNextAnilistRetryUpdateHandler(
|
||||
buildProcessNextAnilistRetryUpdateMainDepsHandler(),
|
||||
processNextAnilistRetryUpdateMainDeps,
|
||||
);
|
||||
|
||||
const buildMaybeRunAnilistPostWatchUpdateMainDepsHandler =
|
||||
@@ -1861,8 +1877,10 @@ const buildMaybeRunAnilistPostWatchUpdateMainDepsHandler =
|
||||
minWatchSeconds: ANILIST_UPDATE_MIN_WATCH_SECONDS,
|
||||
minWatchRatio: ANILIST_UPDATE_MIN_WATCH_RATIO,
|
||||
});
|
||||
const maybeRunAnilistPostWatchUpdateMainDeps =
|
||||
buildMaybeRunAnilistPostWatchUpdateMainDepsHandler();
|
||||
const maybeRunAnilistPostWatchUpdate = createMaybeRunAnilistPostWatchUpdateHandler(
|
||||
buildMaybeRunAnilistPostWatchUpdateMainDepsHandler(),
|
||||
maybeRunAnilistPostWatchUpdateMainDeps,
|
||||
);
|
||||
|
||||
const buildLoadSubtitlePositionMainDepsHandler = createBuildLoadSubtitlePositionMainDepsHandler({
|
||||
@@ -1876,8 +1894,9 @@ const buildLoadSubtitlePositionMainDepsHandler = createBuildLoadSubtitlePosition
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
});
|
||||
const loadSubtitlePositionMainDeps = buildLoadSubtitlePositionMainDepsHandler();
|
||||
const loadSubtitlePosition = createLoadSubtitlePositionHandler(
|
||||
buildLoadSubtitlePositionMainDepsHandler(),
|
||||
loadSubtitlePositionMainDeps,
|
||||
);
|
||||
|
||||
const buildSaveSubtitlePositionMainDepsHandler = createBuildSaveSubtitlePositionMainDepsHandler({
|
||||
@@ -1898,8 +1917,9 @@ const buildSaveSubtitlePositionMainDepsHandler = createBuildSaveSubtitlePosition
|
||||
appState.subtitlePosition = position;
|
||||
},
|
||||
});
|
||||
const saveSubtitlePositionMainDeps = buildSaveSubtitlePositionMainDepsHandler();
|
||||
const saveSubtitlePosition = createSaveSubtitlePositionHandler(
|
||||
buildSaveSubtitlePositionMainDepsHandler(),
|
||||
saveSubtitlePositionMainDeps,
|
||||
);
|
||||
|
||||
registerSubminerProtocolClient();
|
||||
@@ -1921,7 +1941,8 @@ const buildRegisterProtocolUrlHandlersMainDepsHandler =
|
||||
logger.warn('Unhandled second-instance protocol URL', { rawUrl });
|
||||
},
|
||||
});
|
||||
registerProtocolUrlHandlers(buildRegisterProtocolUrlHandlersMainDepsHandler());
|
||||
const registerProtocolUrlHandlersMainDeps = buildRegisterProtocolUrlHandlersMainDepsHandler();
|
||||
registerProtocolUrlHandlers(registerProtocolUrlHandlersMainDeps);
|
||||
|
||||
const buildOnWillQuitCleanupDepsHandler = createBuildOnWillQuitCleanupDepsHandler({
|
||||
destroyTray: () => destroyTray(),
|
||||
@@ -1965,8 +1986,10 @@ const buildShouldRestoreWindowsOnActivateMainDepsHandler =
|
||||
isOverlayRuntimeInitialized: () => appState.overlayRuntimeInitialized,
|
||||
getAllWindowCount: () => BrowserWindow.getAllWindows().length,
|
||||
});
|
||||
const shouldRestoreWindowsOnActivateMainDeps =
|
||||
buildShouldRestoreWindowsOnActivateMainDepsHandler();
|
||||
const shouldRestoreWindowsOnActivateHandler = createShouldRestoreWindowsOnActivateHandler(
|
||||
buildShouldRestoreWindowsOnActivateMainDepsHandler(),
|
||||
shouldRestoreWindowsOnActivateMainDeps,
|
||||
);
|
||||
|
||||
const buildRestoreWindowsOnActivateMainDepsHandler =
|
||||
@@ -1984,8 +2007,9 @@ const buildRestoreWindowsOnActivateMainDepsHandler =
|
||||
overlayVisibilityRuntime.updateInvisibleOverlayVisibility();
|
||||
},
|
||||
});
|
||||
const restoreWindowsOnActivateMainDeps = buildRestoreWindowsOnActivateMainDepsHandler();
|
||||
const restoreWindowsOnActivateHandler = createRestoreWindowsOnActivateHandler(
|
||||
buildRestoreWindowsOnActivateMainDepsHandler(),
|
||||
restoreWindowsOnActivateMainDeps,
|
||||
);
|
||||
|
||||
const buildReloadConfigMainDepsHandler = createBuildReloadConfigMainDepsHandler({
|
||||
@@ -2011,8 +2035,9 @@ const buildCriticalConfigErrorMainDepsHandler = createBuildCriticalConfigErrorMa
|
||||
quit: () => app.quit(),
|
||||
},
|
||||
});
|
||||
const criticalConfigErrorMainDeps = buildCriticalConfigErrorMainDepsHandler();
|
||||
const criticalConfigErrorHandler = createCriticalConfigErrorHandler(
|
||||
buildCriticalConfigErrorMainDepsHandler(),
|
||||
criticalConfigErrorMainDeps,
|
||||
);
|
||||
|
||||
const buildAppReadyRuntimeMainDepsHandler = createBuildAppReadyRuntimeMainDepsHandler({
|
||||
|
||||
Reference in New Issue
Block a user