Skip to content

Fix speak#661

Merged
feruzm merged 2 commits intodevelopfrom
speak
Feb 18, 2026
Merged

Fix speak#661
feruzm merged 2 commits intodevelopfrom
speak

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Feb 18, 2026

Summary by CodeRabbit

  • Bug Fixes

    • 3Speak video embeds now use the correct playback endpoint so embedded videos load reliably.
  • Tests

    • Updated test cases to match the corrected 3Speak embed behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

This PR updates 3Speak video embed handling in the render-helper package by switching embed endpoints from /embed? to /watch? and updating corresponding tests and the package changelog/version.

Changes

Cohort / File(s) Summary
3Speak URL Generation
packages/render-helper/src/methods/a.method.ts, packages/render-helper/src/methods/a.method.spec.ts
Changed constructed 3Speak embed URL from https://play.3speak.tv/embed?v=...&mode=iframe to https://play.3speak.tv/watch?v=...&mode=iframe; updated tests to match.
3Speak URL Normalization
packages/render-helper/src/methods/iframe.method.ts, packages/render-helper/src/methods/iframe.method.spec.ts
Flipped normalization logic to convert /embed?/watch? (was the reverse); updated test inputs/expectations accordingly.
Markdown/HTML Tests
packages/render-helper/src/markdown-2-html.spec.ts
Updated expected HTML for 3Speak video link cases: data-embed-src now uses /watch?v= instead of /embed?v=.
Package Metadata & Changelog
packages/render-helper/package.json, packages/render-helper/CHANGELOG.md
Bumped package version to 2.4.18 and added changelog entry "Fix speak (#661)".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Fixes and render-helper #617: Modifies the same render-helper embed normalization and tests for 3Speak (same files changed here).
  • Test and edge case fixes #659: Also touches packages/render-helper/src/methods/a.method.ts and adjusts 3Speak-related handling; changes may interact.
  • SEO context for Quality #646: Updates the a() method in packages/render-helper/src/methods/a.method.ts (SEO/external link logic), which could overlap with these embed changes.

Poem

🐰 A rabbit hops from embed to watch with glee,
URLs adjusted, nice and spry,
Tests updated, changelog sings,
Version bumped — a tiny spring!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The title 'Fix speak' is vague and lacks specificity; it does not clearly communicate what aspect of speak functionality is being fixed. Consider using a more descriptive title that specifies the fix, such as 'Fix 3Speak embed URL path from embed to watch' or 'Update 3Speak video embed endpoint path'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch speak

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/render-helper/src/methods/iframe.method.spec.ts (1)

421-432: Consider asserting /watch? in the "no double-prefix" test after this change

The test at line 424 feeds https://play.3speak.tv/embed?v=user/video123 — after this PR's change, the URL will be converted to /watch?. The current assertions (toContain('play.3speak.tv'), not.toContain('play.play.3speak.tv')) are still satisfied, but the test no longer distinguishes the old and new behavior for already-correct domains. Adding expect(src).toContain('/watch?v=') would tighten coverage here.

♻️ Suggested assertion addition
     const src = el.getAttribute('src')!
     expect(src).toContain('play.3speak.tv')
     expect(src).not.toContain('play.play.3speak.tv')
+    expect(src).toContain('/watch?v=')
+    expect(src).not.toContain('/embed?')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/render-helper/src/methods/iframe.method.spec.ts` around lines 421 -
432, The test for iframe() that ensures we don't double-prefix play.3speak.tv
should also assert the new converted path; update the spec in the test that
calls iframe(el) (the case that sets src to
'https://play.3speak.tv/embed?v=user/video123') to include an assertion like
expect(src).toContain('/watch?v=') so the test verifies the URL was normalized
to the new /watch? form in addition to still containing 'play.3speak.tv' and not
containing 'play.play.3speak.tv'.
🤖 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/render-helper/src/methods/a.method.ts`:
- Line 776: The runtime string change in a.method.ts (const videoHref) was
updated to use `watch?v=` but the generated distribution bundles were not
rebuilt; rebuild the package (run the project build script, e.g., npm run build)
so the published dist artifacts are regenerated, verify the built node/browser
bundles contain the new `watch?v=` string (replace any remaining `embed?v=`),
and commit the updated dist files to the PR so consumers installing the package
get the fix; reference the updated symbol videoHref in a.method.ts when
verifying the output.

---

Nitpick comments:
In `@packages/render-helper/src/methods/iframe.method.spec.ts`:
- Around line 421-432: The test for iframe() that ensures we don't double-prefix
play.3speak.tv should also assert the new converted path; update the spec in the
test that calls iframe(el) (the case that sets src to
'https://play.3speak.tv/embed?v=user/video123') to include an assertion like
expect(src).toContain('/watch?v=') so the test verifies the URL was normalized
to the new /watch? form in addition to still containing 'play.3speak.tv' and not
containing 'play.play.3speak.tv'.

// match[1] / match[2] = tld , match[3] = embed address
if ((match[1] || match[2]) && match[3]) {
const videoHref = `https://play.3speak.tv/embed?v=${match[3]}&mode=iframe`
const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm dist files reference old embed path and check package.json main/module fields
echo "=== Checking if dist directory exists ==="
ls -la packages/render-helper/dist/ 2>/dev/null || echo "dist directory not found"

echo ""
echo "=== Checking dist files for old embed path ==="
rg -n "embed\?v=" packages/render-helper/dist/ 2>/dev/null || echo "No matches found or dist directory doesn't exist"

echo ""
echo "=== Checking package.json main/module/exports fields ==="
fd "package.json" packages/render-helper --max-depth 1 --exec cat {}

echo ""
echo "=== Checking .gitignore for dist patterns ==="
if [ -f "packages/render-helper/.gitignore" ]; then
  cat packages/render-helper/.gitignore | grep -E "dist|build" || echo "No dist/build ignore patterns found"
else
  echo "No .gitignore in packages/render-helper"
fi

echo ""
echo "=== Checking root .gitignore for dist patterns ==="
cat .gitignore 2>/dev/null | grep -E "dist|build" || echo "No dist/build ignore patterns in root"

Repository: ecency/vision-next

Length of output: 50375


🏁 Script executed:

#!/bin/bash
echo "=== Checking source file line 776 for 'watch?v=' ==="
sed -n '770,780p' packages/render-helper/src/methods/a.method.ts

echo ""
echo "=== Checking package.json for main/module/exports ==="
cat packages/render-helper/package.json | grep -A 10 '"main"\|"module"\|"exports"'

Repository: ecency/vision-next

Length of output: 1230


Rebuild and commit dist artifacts before merging

The source code change to use watch?v= is correct, but all three pre-built dist files still contain the old embed?v= endpoint:

  • dist/node/index.mjs line 905
  • dist/node/index.cjs line 934
  • dist/browser/index.js line 902

Since package.json explicitly declares these dist files as the published entry points ("main", "module", and "exports"), consumers installing this package from npm will receive the old code and the fix will have no effect. The dist files must be rebuilt and committed as part of this PR.

🤖 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` at line 776, The runtime
string change in a.method.ts (const videoHref) was updated to use `watch?v=` but
the generated distribution bundles were not rebuilt; rebuild the package (run
the project build script, e.g., npm run build) so the published dist artifacts
are regenerated, verify the built node/browser bundles contain the new
`watch?v=` string (replace any remaining `embed?v=`), and commit the updated
dist files to the PR so consumers installing the package get the fix; reference
the updated symbol videoHref in a.method.ts when verifying the output.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Feb 18, 2026
@feruzm feruzm merged commit 237ef96 into develop Feb 18, 2026
1 check passed
@feruzm feruzm deleted the speak branch February 18, 2026 22:26
@coderabbitai coderabbitai bot mentioned this pull request Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant