Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoRun configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds support for 3Speak audio embeds: introduces two regex constants, updates anchor and iframe processing to detect and normalize 3Speak audio links/embeds (injecting iframes, classes, sandbox/frameborder, and query params), and adds test coverage for these cases. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/render-helper/src/methods/a.method.ts (1)
806-823: Consider using regex for parameter detection for consistency.The current implementation uses
.includes('iframe=')and.includes('mode=')for parameter detection, whileiframe.method.tsuses regex patterns like/[?&]iframe=/. The.includes()approach could theoretically false-match substrings (e.g.,?noiframe=1), though this is unlikely with 3Speak URLs in practice.For consistency with
iframe.method.tsand slightly more robust matching:♻️ Optional: Align parameter detection with iframe.method.ts
- const embedSrc = href.includes('iframe=') ? href : `${href}&iframe=1` - const finalSrc = embedSrc.includes('mode=') ? embedSrc : `${embedSrc}&mode=compact` + const embedSrc = /[?&]iframe=/.test(href) ? href : `${href}&iframe=1` + const finalSrc = /[?&]mode=/.test(embedSrc) ? embedSrc : `${embedSrc}&mode=compact`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/render-helper/src/methods/a.method.ts` around lines 806 - 823, The parameter checks in the 3Speak audio branch use href.includes('iframe=') and includes('mode=') which can false-match substrings; update the detection to use query-param regexes like /[?&]iframe=/ and /[?&]mode=/ (consistent with iframe.method.ts) when computing embedSrc and finalSrc (refer to the variables href, embedSrc, finalSrc and the SPEAK_AUDIO_REGEX branch in a.method.ts); keep the existing behavior of appending &iframe=1 and &mode=compact only when the corresponding param is not present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/render-helper/src/methods/a.method.ts`:
- Around line 806-823: The parameter checks in the 3Speak audio branch use
href.includes('iframe=') and includes('mode=') which can false-match substrings;
update the detection to use query-param regexes like /[?&]iframe=/ and
/[?&]mode=/ (consistent with iframe.method.ts) when computing embedSrc and
finalSrc (refer to the variables href, embedSrc, finalSrc and the
SPEAK_AUDIO_REGEX branch in a.method.ts); keep the existing behavior of
appending &iframe=1 and &mode=compact only when the corresponding param is not
present.
ℹ️ Review info
Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1873361e-8d50-4be5-bf88-dabfe0570597
📒 Files selected for processing (5)
packages/render-helper/src/consts/regexes.const.tspackages/render-helper/src/methods/a.method.spec.tspackages/render-helper/src/methods/a.method.tspackages/render-helper/src/methods/iframe.method.spec.tspackages/render-helper/src/methods/iframe.method.ts
Summary by CodeRabbit
New Features
Tests
Chores