You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(audio): route companion files to source tracks - #1127
Audio files whose names identify a mic or system source now route to the matching track instead of being classified as mixed. The routing engine uses the shared path classifier, so names such as recording-mic.wav and system.mp4 retain their source identity.
Motivation
The audio processor already recognizes these filename conventions, but the routing engine only recognized .mic. and .system. markers. Companion files with other supported names therefore lost their source ID and could be mixed into the wrong track.
Not applicable; this fixes audio routing and adds no visual UI.
Testing Guide
npm test -- src/lib/exporter/audioRoutingEngine.test.ts src/lib/exporter/audioEncoder.test.ts src/lib/exporter/useAudioPreviewSync.test.ts — 21 tests passed.
npm test — 1,468 tests passed, 6 skipped.
npm run typecheck — passed.
npm run lint — passed with one existing warning in ProjectThumbnail.tsx.
Browser smoke check: the root page rendered. The editor route stayed on “Loading editor…” in a standalone browser because it requires the Electron preload bridge.
Checklist
I have performed a self-review of my code.
I have added any necessary screenshots or videos.
I have linked related issue(s) and updated the changelog if applicable.
AI disclosure: OpenAI Codex assisted with analysis, implementation, and verification.
Thank you for contributing!
Summary by CodeRabbit
Refactor
Consolidated how recording audio sources are identified, with no change to the available audio track options.
Tests
Added coverage for microphone and system audio track routing, recording companion paths, and playback order.
Reviewing files that changed from the base of the PR and between 535d1cf and 0e0adae.
📒 Files selected for processing (3)
src/lib/exporter/audioProcessorShared.ts
src/lib/exporter/audioRoutingEngine.test.ts
src/lib/exporter/audioRoutingEngine.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough
The source-track type and path-classification helper are centralized in audioProcessorShared. audioRoutingEngine re-exports them, and new tests cover companion-path classification and routing-plan output.
Changes
Audio track classification
Layer / File(s)
Summary
Centralize and verify track classification src/lib/exporter/audioProcessorShared.ts, src/lib/exporter/audioRoutingEngine.ts, src/lib/exporter/audioRoutingEngine.test.ts
audioProcessorShared exports SourceTrackId and the canonical path-classification helper. audioRoutingEngine re-exports them instead of defining a local type and helper. Tests cover four path classifications, exclude the video path, map microphone and system companions to dedicated tracks, and verify system-then-microphone playback order.
Companion audio files now route to the matching mic or system track through the shared classifier. No remaining merge-blocking risk was found.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary change: routing companion audio files to their source tracks.
Description check
The description covers the purpose, motivation, bug-fix classification, related issue, testing steps, browser limitation, and checklist status. The screenshots section is correctly marked as not appli…
Linked Issues check
Issue #1124 requires one canonical getSourceTrackIdFromPath implementation and correct classification of supported companion paths. audioRoutingEngine.ts removes the duplicate parser and re-export…
Out of Scope Changes check
The pull request changes only the shared source-track type, the routing-engine parser export, and focused routing tests. These changes directly implement issue #1124 and provide regression coverage. N…
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Audio files whose names identify a
micorsystemsource now route to the matching track instead of being classified as mixed. The routing engine uses the shared path classifier, so names such asrecording-mic.wavandsystem.mp4retain their source identity.Motivation
The audio processor already recognizes these filename conventions, but the routing engine only recognized
.mic.and.system.markers. Companion files with other supported names therefore lost their source ID and could be mixed into the wrong track.Type of Change
Related Issue(s)
Fixes #1124
Screenshots / Video
Not applicable; this fixes audio routing and adds no visual UI.
Testing Guide
npm test -- src/lib/exporter/audioRoutingEngine.test.ts src/lib/exporter/audioEncoder.test.ts src/lib/exporter/useAudioPreviewSync.test.ts— 21 tests passed.npm test— 1,468 tests passed, 6 skipped.npm run typecheck— passed.npm run lint— passed with one existing warning inProjectThumbnail.tsx.Checklist
AI disclosure: OpenAI Codex assisted with analysis, implementation, and verification.
Thank you for contributing!
Summary by CodeRabbit