Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded a changeset and updated the VTT loader to strip Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/cli/src/cli/loaders/vtt.ts`:
- Around line 33-42: The loader currently uses a single module-level savedBlocks
array that is overwritten in pull(), causing cross-locale leakage; update the
implementation in createLoader's pull/push logic to keep extracted blocks
per-locale (keyed by the locale argument) or re-derive blocks from the
locale-specific pullInput available in push(), using
extractUnsupportedBlocks(input) for that locale instead of the shared
savedBlocks; update both places that read/write savedBlocks (the pull()
assignment where savedBlocks = blocks and the later code that consumes
savedBlocks) to use the per-locale map or to compute blocks from the pullInput
passed to push().
- Around line 14-19: The unsupportedRegex currently matches prefixes like
"STYLE" or "REGION" and thus incorrectly strips cues such as "REGION42" or
"STYLE_intro"; update the check in the loop that examines firstLine by trimming
trailing whitespace (use trim() or trimEnd()) and change unsupportedRegex to
anchor the end of the line (e.g., /^(?:STYLE|REGION)\s*$/) so it only matches
exact header lines; adjust the test in the for-loop that uses
unsupportedRegex.test(firstLine) accordingly (see unsupportedRegex and the loop
over parts / firstLine).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 05ec2afc-11d8-40b6-a0f6-b6a241c7f463
📒 Files selected for processing (3)
.changeset/violet-pens-build.mdpackages/cli/src/cli/loaders/index.spec.tspackages/cli/src/cli/loaders/vtt.ts
… to match exact keywords
* fix(cli): handle STYLE and REGION blocks unsupported by node-webvtt * fix(cli): add changeset * fix(cli): add test for REGION block preservation in push output * fix(cli): split block extraction into focused functions and fix regex to match exact keywords
Summary
Fix VTT parser crash when files contain STYLE or REGION blocks, which are valid WebVTT features unsupported by the
node-webvttlibrary.Changes
node-webvttparserTesting
Business logic tests added:
Visuals
N/A — no UI changes.
Checklist
Summary by CodeRabbit
Bug Fixes
Tests
Chores