Skip to content

refactor(export): wire lightning route policy#555

Merged
meiiie merged 1 commit into
mainfrom
refactor/export-route-policy-wiring
May 22, 2026
Merged

refactor(export): wire lightning route policy#555
meiiie merged 1 commit into
mainfrom
refactor/export-route-policy-wiring

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 22, 2026

Summary

  • Wire the merged Lightning backend policy into ModernVideoExporter startup routing.
  • Defer the streaming native encoder for Windows auto exports so native static-layout can be probed first.
  • Add a regression test proving Windows auto returns the static-layout result without starting Breeze/WebCodecs when that path succeeds.

Verification

  • npm test -- src/lib/exporter/modernVideoExporter.fallback.test.ts src/lib/exporter/backendPolicy.test.ts
  • npx tsc --noEmit
  • npx biome check --formatter-enabled=false src/lib/exporter/modernVideoExporter.ts src/lib/exporter/modernVideoExporter.fallback.test.ts src/lib/exporter/backendPolicy.ts src/lib/exporter/backendPolicy.test.ts
  • git diff --check

Notes

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced video export on Windows by prioritizing static-layout export before attempting streaming export, improving compatibility and performance.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 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: 7f6022af-4667-499e-8c3d-4d8d1d342d6e

📥 Commits

Reviewing files that changed from the base of the PR and between b5132de and 90ad8a6.

📒 Files selected for processing (2)
  • src/lib/exporter/modernVideoExporter.fallback.test.ts
  • src/lib/exporter/modernVideoExporter.ts

📝 Walkthrough

Walkthrough

This PR adds Windows native static-layout export preference to ModernVideoExporter. The export method now defers streaming native encoder startup when a backend policy function indicates static-layout should be attempted first. A new test validates this fallback routing behavior on Windows.

Changes

Native static-layout routing for Windows

Layer / File(s) Summary
Backend selection policy integration
src/lib/exporter/modernVideoExporter.ts
Type imports are reordered and backendPolicy imports expanded to include shouldPreferNativeStaticLayoutBeforeBreeze. In export(), shouldDeferNativeEncoderStart now checks both the Breeze fallback condition and the native static-layout preference policy, deferring encoder startup when either applies.
Windows native fallback routing test
src/lib/exporter/modernVideoExporter.fallback.test.ts
New test case stubs navigator.platform to Windows and verifies that with backendPreference: "auto", export() calls static-layout preparation and returns the static-layout blob without starting the streaming native encoder or loading streaming decoder metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • webadderallorg/Recordly#554: Introduces the shouldPreferNativeStaticLayoutBeforeBreeze policy function that this PR integrates into the export routing.
  • webadderallorg/Recordly#461: Earlier regression test in the same file covering native static-layout probing and fallback behavior.
  • webadderallorg/Recordly#519: Prior work on shouldDeferNativeEncoderStart logic that this PR extends with the static-layout policy.

Suggested labels

Checked

Poem

🐰 A Windows path hops through the static layout, no streaming encoder shout,
fallback test guards the route so true—native first, then Breeze pursues!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor(export): wire lightning route policy' directly and clearly summarizes the main change of wiring the Lightning backend policy into ModernVideoExporter routing.
Description check ✅ Passed The description covers Summary, Verification, and Notes sections with clear technical details, but lacks explicit Description, Motivation, Type of Change, and Related Issue sections from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/export-route-policy-wiring

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 22, 2026 11:48
@meiiie meiiie merged commit 9d8b3c6 into main May 22, 2026
3 checks passed
@meiiie meiiie deleted the refactor/export-route-policy-wiring branch May 22, 2026 11:50
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