mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
refactor: split main runtime handlers into focused modules
This commit is contained in:
@@ -6,7 +6,7 @@ Read first. Keep concise.
|
||||
| ------------ | -------------- | ---------------------------------------------------- | --------- | ------------------------------------- | ---------------------- |
|
||||
| `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-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-20T03:27:35Z` |
|
||||
| `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-20T05:15:40Z` |
|
||||
| `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` |
|
||||
| `codex-texthooker-highlights-20260220T002354Z-927c` | `codex-texthooker-highlights` | `Add optional texthooker highlight toggles for known/n+1/frequency/JLPT` | `completed` | `docs/subagents/agents/codex-texthooker-highlights-20260220T002354Z-927c.md` | `2026-02-20T00:30:49Z` |
|
||||
| `codex-texthooker-ui-playwright-20260220T003827Z-k3p9` | `codex-texthooker-ui-playwright` | `Run Playwright MCP smoke/regression checks for texthooker-ui changes` | `completed` | `docs/subagents/agents/codex-texthooker-ui-playwright-20260220T003827Z-k3p9.md` | `2026-02-20T00:42:09Z` |
|
||||
|
||||
@@ -181,6 +181,18 @@
|
||||
- `src/main/runtime/anilist-setup-window.test.ts`
|
||||
- `src/main/runtime/jellyfin-setup-window.ts`
|
||||
- `src/main/runtime/jellyfin-setup-window.test.ts`
|
||||
- `src/main/runtime/app-runtime-main-deps.ts`
|
||||
- `src/main/runtime/app-runtime-main-deps.test.ts`
|
||||
- `src/main/runtime/global-shortcuts-main-deps.ts`
|
||||
- `src/main/runtime/global-shortcuts-main-deps.test.ts`
|
||||
- `src/main/runtime/mpv-osd-log-main-deps.ts`
|
||||
- `src/main/runtime/mpv-osd-log-main-deps.test.ts`
|
||||
- `src/main/runtime/app-lifecycle-main-activate.ts`
|
||||
- `src/main/runtime/app-lifecycle-main-activate.test.ts`
|
||||
- `src/main/runtime/initial-args-main-deps.ts`
|
||||
- `src/main/runtime/initial-args-main-deps.test.ts`
|
||||
- `src/main/runtime/mpv-main-event-main-deps.ts`
|
||||
- `src/main/runtime/mpv-main-event-main-deps.test.ts`
|
||||
|
||||
## Open Questions / Blockers
|
||||
|
||||
@@ -188,4 +200,47 @@
|
||||
|
||||
## Next Step
|
||||
|
||||
- extract next `src/main.ts` app-lifecycle cleanup/restore wrapper cluster in startup lifecycle wiring (`onWillQuitCleanup`, `restoreWindowsOnActivate`) into runtime helper + tests.
|
||||
- extract next `src/main.ts` runtime-deps assembly cluster (global shortcuts and/or MPV OSD bindings) into focused `*-main-deps` helper(s) with parity tests.
|
||||
- [2026-02-20T04:04:21Z] progress: extracted MPV main event action callbacks into `src/main/runtime/mpv-main-event-actions.ts` and rewired `bindMpvClientEventHandlers` to delegate through focused handlers.
|
||||
- [2026-02-20T04:04:21Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js dist/main/runtime/mpv-client-runtime-service.test.js dist/main/runtime/mpv-subtitle-render-metrics.test.js` pass (14/14).
|
||||
- [2026-02-20T04:06:41Z] progress: extracted Jellyfin setup-window orchestration into `createOpenJellyfinSetupWindowHandler` in `src/main/runtime/jellyfin-setup-window.ts`; rewired `openJellyfinSetupWindow` in `src/main.ts` to thin wrapper.
|
||||
- [2026-02-20T04:06:41Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/jellyfin-setup-window.test.js dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js dist/main/runtime/mpv-client-runtime-service.test.js` pass (23/23).
|
||||
- [2026-02-20T04:09:21Z] progress: extracted AniList setup-window orchestration into `createOpenAnilistSetupWindowHandler` in `src/main/runtime/anilist-setup-window.ts`; rewired `openAnilistSetupWindow` in `src/main.ts` to thin wrapper.
|
||||
- [2026-02-20T04:09:21Z] progress: `src/main.ts` reduced to 2883 LOC after this slice.
|
||||
- [2026-02-20T04:09:21Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/anilist-setup-window.test.js dist/main/runtime/jellyfin-setup-window.test.js dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js dist/main/runtime/mpv-client-runtime-service.test.js` pass (39/39).
|
||||
- [2026-02-20T04:11:27Z] progress: extracted Jellyfin external subtitle preload/track-picking from `playJellyfinItemInMpv` into new `src/main/runtime/jellyfin-subtitle-preload.ts` (`createPreloadJellyfinExternalSubtitlesHandler`) and rewired `main.ts`.
|
||||
- [2026-02-20T04:11:27Z] progress: `src/main.ts` reduced to 2785 LOC after subtitle-preload extraction.
|
||||
- [2026-02-20T04:11:27Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/jellyfin-subtitle-preload.test.js dist/main/runtime/jellyfin-cli-play.test.js dist/main/runtime/anilist-setup-window.test.js dist/main/runtime/jellyfin-setup-window.test.js dist/main/runtime/mpv-main-event-actions.test.js` pass (41/41).
|
||||
- [2026-02-20T04:17:41Z] progress: extracted `playJellyfinItemInMpv` orchestration into `src/main/runtime/jellyfin-playback-launch.ts` (`createPlayJellyfinItemInMpvHandler`) + tests; rewired `main.ts` playback handler wiring.
|
||||
- [2026-02-20T04:17:41Z] progress: extracted `runJellyfinCommand` command routing into `src/main/runtime/jellyfin-command-dispatch.ts` (`createRunJellyfinCommandHandler`) + tests; rewired `main.ts` dispatcher wiring.
|
||||
- [2026-02-20T04:17:41Z] progress: `src/main.ts` reduced to 2696 LOC after Jellyfin playback/dispatch extraction.
|
||||
- [2026-02-20T04:17:41Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/jellyfin-command-dispatch.test.js dist/main/runtime/jellyfin-playback-launch.test.js dist/main/runtime/jellyfin-subtitle-preload.test.js dist/main/runtime/jellyfin-cli-auth.test.js dist/main/runtime/jellyfin-cli-list.test.js dist/main/runtime/jellyfin-cli-play.test.js dist/main/runtime/jellyfin-cli-remote-announce.test.js` pass (24/24).
|
||||
- [2026-02-20T04:32:30Z] progress: extracted AniList media-state helpers to `src/main/runtime/anilist-media-state.ts` (`createGetCurrentAnilistMediaKeyHandler`, `createResetAnilistMediaTrackingHandler`, `createGetAnilistMediaGuessRuntimeStateHandler`, `createSetAnilistMediaGuessRuntimeStateHandler`, `createResetAnilistMediaGuessStateHandler`) + tests; rewired main AniList guess-state callbacks.
|
||||
- [2026-02-20T04:32:30Z] progress: extracted MPV main event binder orchestration from `bindMpvClientEventHandlers` into `src/main/runtime/mpv-main-event-bindings.ts` (`createBindMpvMainEventHandlersHandler`) + tests; rewired `main.ts` to dependency-only binder setup.
|
||||
- [2026-02-20T04:32:30Z] progress: `src/main.ts` reduced to 2665 LOC.
|
||||
- [2026-02-20T04:32:30Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/mpv-main-event-bindings.test.js dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js dist/main/runtime/anilist-media-state.test.js dist/main/runtime/anilist-media-guess.test.js dist/main/runtime/jellyfin-command-dispatch.test.js dist/main/runtime/jellyfin-playback-launch.test.js` pass (23/23).
|
||||
- [2026-02-20T04:33:17Z] progress: extracted main MPV event binding orchestration from `src/main.ts` into `src/main/runtime/mpv-main-event-bindings.ts` (`createBindMpvMainEventHandlersHandler`) with unit tests in `src/main/runtime/mpv-main-event-bindings.test.ts`; rewired `main.ts` bind setup to dependency map.
|
||||
- [2026-02-20T04:33:17Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/mpv-main-event-bindings.test.js dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js dist/main/runtime/anilist-media-state.test.js dist/main/runtime/anilist-media-guess.test.js dist/main/runtime/jellyfin-command-dispatch.test.js dist/main/runtime/jellyfin-playback-launch.test.js` pass (23/23).
|
||||
- [2026-02-20T05:00:15Z] progress: extracted on-will-quit cleanup dependency assembly to `src/main/runtime/app-lifecycle-main-cleanup.ts` (`createBuildOnWillQuitCleanupDepsHandler`) + tests; rewired `onWillQuitCleanupHandler` wiring in `src/main.ts`.
|
||||
- [2026-02-20T05:00:15Z] progress: extracted overlay runtime options dependency assembly to `src/main/runtime/overlay-runtime-options-main-deps.ts` + tests; rewired `buildInitializeOverlayRuntimeOptionsHandler` wiring in `src/main.ts`.
|
||||
- [2026-02-20T05:00:15Z] progress: extracted CLI command context dependency assembly to `src/main/runtime/cli-command-context-main-deps.ts` + tests; rewired `buildCliCommandContextDepsHandler` wiring in `src/main.ts`.
|
||||
- [2026-02-20T05:00:15Z] progress: `src/main.ts` reduced to 2617 LOC.
|
||||
- [2026-02-20T05:00:15Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/cli-command-context-main-deps.test.js dist/main/runtime/cli-command-context-deps.test.js dist/main/runtime/overlay-runtime-options-main-deps.test.js dist/main/runtime/overlay-runtime-options.test.js dist/main/runtime/app-lifecycle-main-cleanup.test.js dist/main/runtime/mpv-main-event-bindings.test.js` pass (6/6).
|
||||
- [2026-02-20T05:01:42Z] progress: extracted MPV runtime-service dependency assembly into `src/main/runtime/mpv-client-runtime-service-main-deps.ts` + tests; rewired `createMpvClientRuntimeService` in `src/main.ts` to use builder before `createMpvClientRuntimeServiceFactory`.
|
||||
- [2026-02-20T05:01:42Z] progress: `src/main.ts` currently 2618 LOC.
|
||||
- [2026-02-20T05:01:42Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/mpv-client-runtime-service-main-deps.test.js dist/main/runtime/mpv-client-runtime-service.test.js dist/main/runtime/mpv-main-event-bindings.test.js dist/main/runtime/cli-command-context-main-deps.test.js dist/main/runtime/overlay-runtime-options-main-deps.test.js dist/main/runtime/app-lifecycle-main-cleanup.test.js` pass (7/7).
|
||||
- [2026-02-20T05:06:04Z] progress: extracted overlay-window factory dependency assembly into `src/main/runtime/overlay-window-factory-main-deps.ts` + tests; rewired `createOverlayWindowHandler`, `createMainWindowHandler`, and `createInvisibleWindowHandler` wiring in `src/main.ts`.
|
||||
- [2026-02-20T05:06:04Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/overlay-window-factory-main-deps.test.js dist/main/runtime/overlay-window-factory.test.js dist/main/runtime/mpv-client-runtime-service-main-deps.test.js dist/main/runtime/cli-command-context-main-deps.test.js dist/main/runtime/overlay-runtime-options-main-deps.test.js dist/main/runtime/app-lifecycle-main-cleanup.test.js` pass (8/8).
|
||||
- [2026-02-20T05:10:14Z] progress: extracted tray/overlay-bootstrap/Yomitan opener dependency assembly into `src/main/runtime/app-runtime-main-deps.ts` (`createBuildEnsureTrayMainDepsHandler`, `createBuildDestroyTrayMainDepsHandler`, `createBuildInitializeOverlayRuntimeBootstrapMainDepsHandler`, `createBuildOpenYomitanSettingsMainDepsHandler`); rewired `ensureTray`, `destroyTray`, `initializeOverlayRuntime`, and `openYomitanSettings` to thin handlers in `src/main.ts`.
|
||||
- [2026-02-20T05:10:14Z] progress: `src/main.ts` currently 2652 LOC after this slice (line-count bump from import/deps constant growth while inline wrapper bodies were removed).
|
||||
- [2026-02-20T05:10:14Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/app-runtime-main-deps.test.js dist/main/runtime/tray-lifecycle.test.js dist/main/runtime/overlay-runtime-bootstrap.test.js dist/main/runtime/yomitan-settings-opener.test.js dist/main/runtime/tray-main-deps.test.js dist/main/runtime/overlay-runtime-options-main-deps.test.js` pass (13/13).
|
||||
- [2026-02-20T05:12:29Z] progress: extracted global-shortcuts dependency assembly into `src/main/runtime/global-shortcuts-main-deps.ts` (`createBuildGetConfiguredShortcutsMainDepsHandler`, `createBuildRegisterGlobalShortcutsMainDepsHandler`, `createBuildRefreshGlobalAndOverlayShortcutsMainDepsHandler`) and rewired corresponding handler setup in `src/main.ts`.
|
||||
- [2026-02-20T05:12:29Z] progress: extracted MPV OSD/log dependency assembly into `src/main/runtime/mpv-osd-log-main-deps.ts` (`createBuildAppendToMpvLogMainDepsHandler`, `createBuildShowMpvOsdMainDepsHandler`) and rewired `appendToMpvLogHandler` + `showMpvOsdHandler` setup in `src/main.ts`.
|
||||
- [2026-02-20T05:12:29Z] progress: `src/main.ts` currently 2672 LOC after this slice (net increase from imports and explicit deps builders).
|
||||
- [2026-02-20T05:12:29Z] test: initial `bun run build` failed with type mismatch in `global-shortcuts-main-deps` (`unknown` options type); fixed by tightening to `RegisterGlobalShortcutsServiceOptions`.
|
||||
- [2026-02-20T05:12:29Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/global-shortcuts-main-deps.test.js dist/main/runtime/global-shortcuts.test.js dist/main/runtime/mpv-osd-log-main-deps.test.js dist/main/runtime/mpv-osd-log.test.js dist/main/runtime/app-runtime-main-deps.test.js` pass (15/15).
|
||||
- [2026-02-20T05:15:40Z] progress: extracted activate-lifecycle deps assembly into `src/main/runtime/app-lifecycle-main-activate.ts` (`createBuildShouldRestoreWindowsOnActivateMainDepsHandler`, `createBuildRestoreWindowsOnActivateMainDepsHandler`) and rewired `shouldRestoreWindowsOnActivateHandler` + `restoreWindowsOnActivateHandler` setup in `src/main.ts`.
|
||||
- [2026-02-20T05:15:40Z] progress: extracted initial-args deps assembly into `src/main/runtime/initial-args-main-deps.ts` (`createBuildHandleInitialArgsMainDepsHandler`) and rewired `handleInitialArgs` setup in `src/main.ts`.
|
||||
- [2026-02-20T05:15:40Z] progress: extracted MPV main-event deps assembly into `src/main/runtime/mpv-main-event-main-deps.ts` (`createBuildBindMpvMainEventHandlersMainDepsHandler`) and rewired `bindMpvClientEventHandlers` setup in `src/main.ts`.
|
||||
- [2026-02-20T05:15:40Z] progress: `src/main.ts` currently 2653 LOC after this slice.
|
||||
- [2026-02-20T05:15:40Z] test: `bun run build` pass (expected macOS helper Swift cache fallback) + `node --test dist/main/runtime/app-lifecycle-main-activate.test.js dist/main/runtime/initial-args-main-deps.test.js dist/main/runtime/app-lifecycle-actions.test.js dist/main/runtime/initial-args-handler.test.js dist/main/runtime/app-runtime-main-deps.test.js dist/main/runtime/mpv-main-event-main-deps.test.js dist/main/runtime/mpv-main-event-bindings.test.js dist/main/runtime/mpv-main-event-actions.test.js dist/main/runtime/mpv-client-event-bindings.test.js` pass (27/27).
|
||||
|
||||
Reference in New Issue
Block a user