refactor(embedded-mpv): split session controller into focused collaborators [2/7]#1149
Conversation
Greptile SummaryThis PR refactors the embedded-MPV session controller into smaller collaborators. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "docs(embedded-mpv): clarify renderer saf..." | Re-trigger Greptile |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1149 +/- ##
===========================================
- Coverage 71.05% 60.10% -10.96%
===========================================
Files 40 616 +576
Lines 691 35551 +34860
Branches 87 7989 +7902
===========================================
+ Hits 491 21368 +20877
- Misses 176 11184 +11008
- Partials 24 2999 +2975
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b73b54f to
2f9a144
Compare
…rators Mechanical decomposition of the embedded-MPV session controller into focused collaborators under embedded-mpv-player/: - embedded-mpv-command-runner.ts: transport/track/recording IPC delegators with guarded snapshot reconciliation - embedded-mpv-session-factory.ts: pure placeholder-session factories (loading/attaching/error) and the startup-paint wait - embedded-mpv-stalled-tracker.ts: loading-stall timer and stalled flag - embedded-mpv-compositor.ts: host bounds measurement (measureBounds), re-exported from embedded-mpv-format.utils for existing imports No behavior change. The existing embedded-mpv-player component is kept untouched and keeps working against the controller's unchanged public API (commands are now bound fields delegating to the runner). Test coverage extended per Codecov patch report. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2f9a144 to
977fe0c
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Note
Maintainer rebuild on top of merged #1148. The original decomposition is preserved, while the transparent/native-overlay hooks are intentionally excluded because the frame-copy direction supersedes them.
Step 2 of the revised 7-step shared-controls rollout.
Summary
measureBoundsremains in the format utilities;embedded-mpv-compositor,attach(),createAttachingSession(), andboundsTickare not shipped.Why this shape
The frame-copy implementation in #1169, #1171, and #1175 renders video into a normal DOM canvas. That removes the need for the transparent/native-view overlay and native-fullscreen concepts proposed in #1150 and #1151.
This PR therefore lands only the reusable renderer decomposition and lifecycle safety needed by the replacement embedded-MPV shared-controls PR. It does not switch the current player UI, enable shared controls, add transparent overlay windows, or add native fullscreen.
Changes
embedded-mpv-command-runner.tsowns transport, track, and recording IPC delegation plus snapshot reconciliation.embedded-mpv-session-factory.tsowns pure loading/error placeholders and startup-paint waiting.embedded-mpv-stalled-tracker.tsowns the 30-second loading timer.EmbeddedMpvSessionControllerremains the lifecycle coordinator for support probing, prepare/create/load/dispose, frame attachment, bounds sync, and native updates.Lifecycle hardening
startSession()no longer rewrites it after prepare.Validation
ui-playback: 36 suites / 361 tests passed.ui-playbacklint passed.darwin-arm64MPV runtime is absent; the pushed cross-platform build and Electron E2E jobs provide the runtime/package gate.Revised rollout
#1150 and #1151 are superseded by the frame-copy replacement direction and will be closed with a link to that replacement PR.
Original architecture and decomposition work by @larsemig; maintainer rebuild and hardening by @4gray.