mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-04 19:21:33 -07:00
2003efa235
The repeated-subtitle pause leak was only fixed for ordinary subtitle changes. Startup autoplay priming and visible-overlay priming pause the same way and also ignored whether any tokenization was scheduled, so a cache miss on text the controller already holds (mining a card while the line is on screen) left prefetching idle for the rest of the cue. Pause and release are now one operation via pausePrefetchUntilEmit, and both controller entry points report whether an emit is expected. A repeat arriving while a run is already in flight keeps the pause, since that run still emits. Also invalidate the character dictionary lookups centrally from the sync completion handler instead of at three manager call sites. Ordinary selection sync never invalidated them, so a stale non-null name candidate list could skip a newly added name for up to five seconds; a missing list falls back to the exhaustive scan, but a stale one does not. Ordering matters: the invalidation runs before the subtitle refreshes so they re-tokenize against the new dictionary content. Docs: subtitle-overlay-priming no longer claims every subtitle change calls onSeek().
Architecture Map
Status: active Last verified: 2026-05-23 Owner: Kyle Yasuda Read when: runtime ownership, composition boundaries, or layering questions
SubMiner runs as three cooperating runtimes:
- Electron desktop app in
src/ - Launcher CLI in
launcher/ - mpv Lua plugin in
plugin/subminer/
The desktop app keeps src/main.ts as composition root and pushes behavior into small runtime/domain modules.
Read Next
- Domains - who owns what
- Layering - how modules should depend on each other
- Subtitle Overlay Priming - visible-overlay subtitle startup flow
- Public contributor summary:
docs-site/architecture.md
Current Shape
src/main/owns composition, runtime setup, IPC wiring, and app lifecycle adapters.src/main/boot/owns boot-phase assembly seams sosrc/main.tscan stay focused on lifecycle coordination and startup-path selection.src/core/services/owns focused runtime services plus pure or side-effect-bounded logic.src/renderer/owns overlay rendering and input behavior.src/config/owns config definitions, defaults, loading, and resolution.src/types/owns shared cross-runtime contracts via domain entrypoints;src/types.tsstays a compatibility barrel.src/main/runtime/composers/owns larger domain compositions.src/main.tscall sites invoke configured runtime handlers and runtime-object methods directly; do not add local pass-through wrappers around them.
Architecture Intent
- Small units, explicit boundaries
- Composition over monoliths
- Pure helpers where possible
- Stable user behavior while internals evolve