Skip to content

refactor(editor): extract smoke export config#543

Merged
meiiie merged 1 commit into
mainfrom
refactor/editor-first-architecture-slice
May 20, 2026
Merged

refactor(editor): extract smoke export config#543
meiiie merged 1 commit into
mainfrom
refactor/editor-first-architecture-slice

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 20, 2026

Description

Extracts the dev/smoke export URL parsing contract out of VideoEditor.tsx into a small pure module, then adds focused coverage for that parser boundary.

Motivation

This is the first small editor architecture slice from the god-file refactor pass. The smoke/dev-open query parsing was self-contained, behavior-preserving, and safe to move before touching higher-risk editor state, playback, or export orchestration.

Type of Change

  • Refactor
  • Tests

Related Issue(s)

None.

Changes Made

  • Added src/components/video-editor/smokeExportConfig.ts for getSmokeExportConfig and getDevOpenRecordingConfig.
  • Added unit coverage for disabled smoke export, valid smoke export params, invalid optional values, and dev-open recording params.
  • Updated VideoEditor.tsx to import the parser functions instead of owning them inline.

Scope Note

No UI behavior, export behavior, renderer selection, native helper behavior, or generated binary output is intentionally changed. This PR does not include native helper binaries, local probes, broad editor state movement, or exporter refactors.

Testing Guide

Review the parser extraction and run the focused unit test. Runtime smoke is not required for this slice because the moved code is pure URL parsing and TypeScript coverage verifies the existing call sites.

Checklist

  • One focused architecture slice
  • Behavior-preserving refactor
  • Unit coverage added for moved logic
  • Typecheck passed
  • Scoped Biome completed
  • Branch diff excludes unrelated generated/local files

Local Checks

  • npm test -- src/components/video-editor/smokeExportConfig.test.ts (4 tests passed)
  • npx tsc --noEmit --pretty false (passed)
  • npx biome check --formatter-enabled=false --assist-enabled=false src/components/video-editor/VideoEditor.tsx src/components/video-editor/smokeExportConfig.ts src/components/video-editor/smokeExportConfig.test.ts (exit 0; existing unrelated VideoEditor.tsx exhaustive-deps warning remains)
  • git diff --check main...HEAD (passed)

Runtime/Repro Evidence

Not run. This PR only moves pure smoke/dev URL parsing into a tested module; no Electron, preview, export, or native runtime path changed.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Improved internal code organization by consolidating configuration handling logic for development and testing features, enhancing code maintainability without affecting user-facing functionality.
  • Tests

    • Added comprehensive test coverage for configuration parsing to ensure reliability.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dfafe597-954b-48fd-919d-fe4e3f977290

📥 Commits

Reviewing files that changed from the base of the PR and between 4f729b7 and 8044efd.

📒 Files selected for processing (3)
  • src/components/video-editor/VideoEditor.tsx
  • src/components/video-editor/smokeExportConfig.test.ts
  • src/components/video-editor/smokeExportConfig.ts

📝 Walkthrough

Walkthrough

A new smokeExportConfig module extracts URL query parsing for smoke-export and dev-open recording configurations from VideoEditor.tsx, providing typed SmokeExportConfig and DevOpenRecordingConfig objects alongside helper parsers and comprehensive test coverage. VideoEditor is refactored to import and use these exported functions, removing ~130 lines of local parsing logic.

Changes

Config Module Extraction and VideoEditor Integration

Layer / File(s) Summary
Config types and parsing implementation
src/components/video-editor/smokeExportConfig.ts
SmokeExportConfig and DevOpenRecordingConfig types define the shape of parsed query parameters. Helper parsers validate positive integers, non-negative floats, enum mappings, and MP4 frame rates. getSmokeExportConfig builds a config object gated on smokeExport=1 with optional fields for encoding, quality, FPS, backend selection, queue limits, and paths. getDevOpenRecordingConfig returns input/webcam paths from query parameters.
Config parsing test suite
src/components/video-editor/smokeExportConfig.test.ts
Tests verify disabled-state defaults when smoke-export flag is absent, full parsing of complete query strings with numeric and enum values, dropping of invalid optional parameters while preserving enabled state, and independent parsing of dev-open input paths.
VideoEditor refactoring to use extracted config module
src/components/video-editor/VideoEditor.tsx
VideoEditor imports getSmokeExportConfig and getDevOpenRecordingConfig from the new module, removes local type definitions and all parsing helper implementations (~100 lines), and updates @/lib/exporter imports to drop unused ExportRenderBackend and isValidMp4FrameRate dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • webadderallorg/Recordly#452: Directly related code-level overlap in smoke-export URL/config parsing modifications and refactoring of getSmokeExportConfig logic.

Suggested labels

Checked

Poem

🐰 A parser hops from home to module base,
Types and helpers find their proper place,
Tests confirm the query strings parse true,
Config extraction—clean and shiny new! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main refactoring activity: extracting smoke export configuration logic into a separate module.
Description check ✅ Passed The PR description comprehensively covers all template sections: purpose, motivation, type of change, testing guide, and detailed checklist with local verification results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/editor-first-architecture-slice

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@meiiie meiiie marked this pull request as ready for review May 20, 2026 16:38
@meiiie meiiie merged commit 5e5ec94 into main May 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant