|
1 | 1 | import { SessionStore } from '../session-store.ts'; |
2 | 2 | import type { DaemonRequest, DaemonResponse, SessionState } from '../types.ts'; |
3 | 3 | import { emitDiagnostic } from '../../utils/diagnostics.ts'; |
4 | | -import { persistRecordingTelemetry } from '../recording-telemetry.ts'; |
5 | 4 | import { IOS_RUNNER_CONTAINER_BUNDLE_IDS } from '../../platforms/ios/runner-client.ts'; |
6 | | -import { getRecordingOverlaySupportWarning } from '../../recording/overlay.ts'; |
7 | 5 | import { formatRecordTraceError } from '../record-trace-errors.ts'; |
8 | 6 | import type { RecordTraceDeps, RecordingBase } from './record-trace-recording.ts'; |
| 7 | +import { finalizeRecordingOverlay } from './record-trace-finalize.ts'; |
9 | 8 | import { errorResponse } from './response.ts'; |
10 | 9 |
|
11 | 10 | export function normalizeAppBundleId(session: SessionState): string | undefined { |
@@ -319,28 +318,13 @@ export async function stopIosDeviceRecording(params: { |
319 | 318 | }); |
320 | 319 | } |
321 | 320 |
|
322 | | - const telemetryPath = persistRecordingTelemetry({ |
| 321 | + await finalizeRecordingOverlay({ |
323 | 322 | recording, |
| 323 | + deps, |
324 | 324 | trimStartMs, |
| 325 | + targetLabel: 'iOS recording', |
325 | 326 | }); |
326 | 327 |
|
327 | | - if (recording.showTouches) { |
328 | | - const overlaySupportWarning = getRecordingOverlaySupportWarning(); |
329 | | - if (overlaySupportWarning) { |
330 | | - recording.overlayWarning = overlaySupportWarning; |
331 | | - } else { |
332 | | - try { |
333 | | - await deps.overlayRecordingTouches({ |
334 | | - videoPath: recording.outPath, |
335 | | - telemetryPath, |
336 | | - targetLabel: 'iOS recording', |
337 | | - }); |
338 | | - } catch (error) { |
339 | | - recording.overlayWarning = `failed to overlay recording touches: ${formatRecordTraceError(error)}`; |
340 | | - } |
341 | | - } |
342 | | - } |
343 | | - |
344 | 328 | return null; |
345 | 329 | } |
346 | 330 |
|
@@ -375,26 +359,11 @@ export async function stopMacOsRecording(params: { |
375 | 359 | }); |
376 | 360 | } |
377 | 361 |
|
378 | | - const telemetryPath = persistRecordingTelemetry({ |
| 362 | + await finalizeRecordingOverlay({ |
379 | 363 | recording, |
| 364 | + deps, |
| 365 | + targetLabel: 'macOS recording', |
380 | 366 | }); |
381 | 367 |
|
382 | | - if (recording.showTouches) { |
383 | | - const overlaySupportWarning = getRecordingOverlaySupportWarning(); |
384 | | - if (overlaySupportWarning) { |
385 | | - recording.overlayWarning = overlaySupportWarning; |
386 | | - } else { |
387 | | - try { |
388 | | - await deps.overlayRecordingTouches({ |
389 | | - videoPath: recording.outPath, |
390 | | - telemetryPath, |
391 | | - targetLabel: 'macOS recording', |
392 | | - }); |
393 | | - } catch (error) { |
394 | | - recording.overlayWarning = `failed to overlay recording touches: ${formatRecordTraceError(error)}`; |
395 | | - } |
396 | | - } |
397 | | - } |
398 | | - |
399 | 368 | return null; |
400 | 369 | } |
0 commit comments