refactor(editor): extract smoke export progress sampler#550
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughIntroduces a new smoke export progress sampling utility that conditionally records export state transitions and collects timestamped samples based on phase changes, elapsed time intervals, and completion. VideoEditor integrates the sampler to replace inline progress tracking during MP4 export. Tests validate all sampling conditions. ChangesSmoke Export Progress Sampling
Sequence DiagramsequenceDiagram
participant VideoEditor
participant Sampler as Smoke Sampler
participant Samples as Sample Array
VideoEditor->>Sampler: createSmokeExportProgressSampler({enabled, startedAtMs})
activate Sampler
Sampler->>Samples: initialize empty array
deactivate Sampler
loop on each export progress update
VideoEditor->>Sampler: record(exportProgress)
activate Sampler
alt sampling triggered
note over Sampler: phase changed OR<br/>interval elapsed OR<br/>isLastFrame
Sampler->>Samples: append timestamped sample
end
Sampler-->>VideoEditor: return { record, samples }
deactivate Sampler
end
VideoEditor->>VideoEditor: use samples for telemetry
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Extracts the smoke-export progress sampling logic out of
VideoEditor.tsxinto a smallsmokeExportProgressmodule with focused unit coverage.Motivation
handleExportis one of the remaining orchestration-heavy areas inVideoEditor.tsx. The smoke-export progress sampler is a low-risk extraction target because it is local, deterministic, and does not touch exporter construction, save/finalize behavior, native export, or rendering.Type of Change
Changes Made
createSmokeExportProgressSamplerfor smoke export report sampling.handleExportwith the extracted module.Scope
This PR intentionally does not refactor exporter config construction, save handling, native export, or runtime rendering paths.
Testing Guide
.report.jsonstill includes progress samples.Verification
npm test -- src/components/video-editor/smokeExportProgress.test.ts src/components/video-editor/smokeExportConfig.test.tsnpx tsc --noEmit --pretty falsenpx biome check src/components/video-editor/smokeExportProgress.ts src/components/video-editor/smokeExportProgress.test.tsnpx biome lint src/components/video-editor/VideoEditor.tsxgit diff --checkSummary by CodeRabbit
Refactor
Tests