Repository navigation
Simplify capture and preview code and restore fast startup - #486
Conversation
Bind device work to connection lifetimes and give captures, previews, input, and exports explicit cleanup owners. Coordinate startup, recording finalization, and shutdown without dropping pending work. Expand regression coverage for device replacement, cancellation, shared previews, and media exports.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35eb6aed8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39b1545f61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bed7ac0eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1e3aac42d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dafb48566
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fbbfdf063
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
Replace unnecessary native and CLI integration work with controlled inputs. Move independent suites into the headless target and remove duplicate runners. Keep busy-window command handling on one content replacement rule.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
Capture, preview, and window code shared responsibility for the same work. Starting, stopping, and switching views required several objects to coordinate cleanup. This PR separates window state from running operations and gives each resource a clear owner.
Summary
New ownership boundaries
AppRuntime/CaptureWorkspacesCaptureWindowSessionCapturePaneSessionScreenshotCapture/RecordingCaptureCaptureBatch. Own each device's tasks, temporary files, results, failures, and cleanup. Each device has a stableCaptureItemfrom the start. Batches do not write to history.CaptureReviewStateLivePreviewService/DevicePreviewCaptureCoordinatorCapture and review use one source of results
The capture pane has two content states:
Recording stays in the live state, so users can keep watching and switching devices. The picker uses that recording's pending or recording items. Failed devices leave the picker without removing healthy devices. Device Manager and device links can switch between recording targets without stopping the batch.
Review reads the same batch and items, without a separate array of completed results. Pending, ready, failed, and cancelled are item states. Review can appear before every device finishes. New results do not change the selected item. Crop and trim edits stay in review; export code applies them when writing media. Save writes the reviewed media to one history entry. Discard removes temporary files. Saved capture history remains a separate app-wide collection.
Preview sharing follows actual use
Each pane attaches only to the device it displays, not every device in its picker. Two windows showing the same connection share video and device input resources. Selection, rendering, visibility, file-drop work, and control UI remain local to each attachment.
PreviewVideoowns video startup, retries, and stopping. A video failure can recover without restarting healthy keyboard or clipboard resources. The shared service grants input to one attachment at a time and controls clipboard syncing. Video pauses when no attached pane needs it. Closing one attachment leaves other viewers running. The last attachment waits for shared preview cleanup.Cleanup remains owned after navigation
Temporary touch settings track their users. They restore the original setting only after the last user releases it. Connection-bound work uses
DeviceTargetidentity, so old work cannot act on a replacement connection.Removed layers and supporting changes
CaptureWindowController,CaptureSnapshotController, the old capture-window mode classes, and the old preview manager/lifecycle layer. Their responsibilities move to the owners above.EmulatorDisplayReaderwith one result protected by a mutex. Preserve command ordering, first-reply handling, and the existing timeout. Restore the Android SDK installation message.Workspace,Capture/Operations,Capture/Review,Capture/Export, andLivePreviewinput, rendering, and views.Tests check app decisions without running media services
TestClock, not socket timeouts.ADBConnectionandToolHTTPExchangein device and tool tests. Script replies, failures, and cancellation without real sockets. Test timers by advancingTestClock.Snap-OUnitTests. Shared test fixtures no longer require running another suite. Remove duplicate standalone runs and the empty preview-lifetime runner.CI diagnostics
Save full build and test logs as artifacts, with short progress updates in the live log. If a test step runs for 45 seconds, capture process stacks, memory, and disk use. Keep existing test and job timeouts.
Validation