refactor: prebuild more main runtime handler dependencies

This commit is contained in:
2026-02-20 01:46:26 -08:00
parent a33d030d34
commit 2be7829aa5
3 changed files with 32 additions and 11 deletions

View File

@@ -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:44:47Z` |
| `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:46:08Z` |
| `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` |

View File

@@ -9,6 +9,9 @@
## Current Work (newest first)
- [2026-02-20T09:46:08Z] progress: completed 2 more safe slices (10 normalized handler sites) in `src/main.ts` by prebuilding finalized deps for Jellyfin remote command/progress handlers plus field-grouping/runtime-options handlers.
- [2026-02-20T09:46:08Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + targeted suites pass for `jellyfin-remote-*`, `field-grouping-resolver*`, `overlay-runtime-options*`, and `secondary-sub-mode-main-deps` (26/26).
- [2026-02-20T09:46:08Z] scope: staging only `src/main.ts` + subagent index/agent files; leaving unrelated tracked/untracked artifacts untouched.
- [2026-02-20T09:44:47Z] progress: added another safe 5-block normalization in `src/main.ts` for early startup/runtime wiring by prebuilding finalized deps for `applyJellyfinMpvDefaults`, `getDefaultSocketPath`, `overlayContentMeasurementStore`, `subtitleProcessingController`, and config hot-reload message handler.
- [2026-02-20T09:44:47Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + targeted suites pass for `mpv-jellyfin-defaults*`, `config-hot-reload-*`, and `subtitle-processing-controller` (18/18).
- [2026-02-20T09:44:47Z] scope: this commit batch now includes 4 refactor slices (20 normalized `main.ts` handler construction sites) + subagent bookkeeping updates.

View File

@@ -962,20 +962,29 @@ const buildReportJellyfinRemoteStoppedMainDepsHandler =
getSession: () => appState.jellyfinRemoteSession,
logDebug: (message, error) => logger.debug(message, error),
});
const reportJellyfinRemoteProgressMainDeps =
buildReportJellyfinRemoteProgressMainDepsHandler();
const reportJellyfinRemoteStoppedMainDeps =
buildReportJellyfinRemoteStoppedMainDepsHandler();
const reportJellyfinRemoteProgress = createReportJellyfinRemoteProgressHandler(
buildReportJellyfinRemoteProgressMainDepsHandler(),
reportJellyfinRemoteProgressMainDeps,
);
const reportJellyfinRemoteStopped = createReportJellyfinRemoteStoppedHandler(
buildReportJellyfinRemoteStoppedMainDepsHandler(),
reportJellyfinRemoteStoppedMainDeps,
);
const handleJellyfinRemotePlayMainDeps = buildHandleJellyfinRemotePlayMainDepsHandler();
const handleJellyfinRemotePlaystateMainDeps =
buildHandleJellyfinRemotePlaystateMainDepsHandler();
const handleJellyfinRemoteGeneralCommandMainDeps =
buildHandleJellyfinRemoteGeneralCommandMainDepsHandler();
const handleJellyfinRemotePlay = createHandleJellyfinRemotePlay(
buildHandleJellyfinRemotePlayMainDepsHandler(),
handleJellyfinRemotePlayMainDeps,
);
const handleJellyfinRemotePlaystate = createHandleJellyfinRemotePlaystate(
buildHandleJellyfinRemotePlaystateMainDepsHandler(),
handleJellyfinRemotePlaystateMainDeps,
);
const handleJellyfinRemoteGeneralCommand = createHandleJellyfinRemoteGeneralCommand(
buildHandleJellyfinRemoteGeneralCommandMainDepsHandler(),
handleJellyfinRemoteGeneralCommandMainDeps,
);
const configHotReloadRuntime = createConfigHotReloadRuntime(buildConfigHotReloadRuntimeMainDepsHandler());
@@ -1031,8 +1040,10 @@ const buildGetFieldGroupingResolverMainDepsHandler = createBuildGetFieldGrouping
getResolver: () => appState.fieldGroupingResolver,
},
);
const getFieldGroupingResolverMainDeps =
buildGetFieldGroupingResolverMainDepsHandler();
const getFieldGroupingResolverHandler = createGetFieldGroupingResolverHandler(
buildGetFieldGroupingResolverMainDepsHandler(),
getFieldGroupingResolverMainDeps,
);
function getFieldGroupingResolver(): ((choice: KikuFieldGroupingChoice) => void) | null {
@@ -1051,8 +1062,10 @@ const buildSetFieldGroupingResolverMainDepsHandler = createBuildSetFieldGrouping
getSequence: () => appState.fieldGroupingResolverSequence,
},
);
const setFieldGroupingResolverMainDeps =
buildSetFieldGroupingResolverMainDepsHandler();
const setFieldGroupingResolverHandler = createSetFieldGroupingResolverHandler(
buildSetFieldGroupingResolverMainDepsHandler(),
setFieldGroupingResolverMainDeps,
);
function setFieldGroupingResolver(
@@ -1138,8 +1151,9 @@ const overlayVisibilityRuntime = createOverlayVisibilityRuntimeService(
const buildGetRuntimeOptionsStateMainDepsHandler = createBuildGetRuntimeOptionsStateMainDepsHandler({
getRuntimeOptionsManager: () => appState.runtimeOptionsManager,
});
const getRuntimeOptionsStateMainDeps = buildGetRuntimeOptionsStateMainDepsHandler();
const getRuntimeOptionsStateHandler = createGetRuntimeOptionsStateHandler(
buildGetRuntimeOptionsStateMainDepsHandler(),
getRuntimeOptionsStateMainDeps,
);
function getRuntimeOptionsState(): RuntimeOptionState[] {
@@ -1154,8 +1168,10 @@ const buildRestorePreviousSecondarySubVisibilityMainDepsHandler =
createBuildRestorePreviousSecondarySubVisibilityMainDepsHandler({
getMpvClient: () => appState.mpvClient,
});
const restorePreviousSecondarySubVisibilityMainDeps =
buildRestorePreviousSecondarySubVisibilityMainDepsHandler();
const restorePreviousSecondarySubVisibilityHandler = createRestorePreviousSecondarySubVisibilityHandler(
buildRestorePreviousSecondarySubVisibilityMainDepsHandler(),
restorePreviousSecondarySubVisibilityMainDeps,
);
function restorePreviousSecondarySubVisibility(): void {
@@ -1172,8 +1188,10 @@ const buildBroadcastRuntimeOptionsChangedMainDepsHandler =
getRuntimeOptionsState: () => getRuntimeOptionsState(),
broadcastToOverlayWindows: (channel, ...args) => broadcastToOverlayWindows(channel, ...args),
});
const broadcastRuntimeOptionsChangedMainDeps =
buildBroadcastRuntimeOptionsChangedMainDepsHandler();
const broadcastRuntimeOptionsChangedHandler = createBroadcastRuntimeOptionsChangedHandler(
buildBroadcastRuntimeOptionsChangedMainDepsHandler(),
broadcastRuntimeOptionsChangedMainDeps,
);
function broadcastRuntimeOptionsChanged(): void {