Skip to content

Comments

DR-7410 - DOCS | create and use youtube component + add videos ids to docs#7546

Open
ArthurGamby wants to merge 2 commits intomainfrom
dr-7410-add-youtube-embeded-videos
Open

DR-7410 - DOCS | create and use youtube component + add videos ids to docs#7546
ArthurGamby wants to merge 2 commits intomainfrom
dr-7410-add-youtube-embeded-videos

Conversation

@ArthurGamby
Copy link
Contributor

@ArthurGamby ArthurGamby commented Feb 23, 2026

Summary by CodeRabbit

  • Documentation

    • Added embedded YouTube tutorials to multiple guides including Supabase Accelerate, Bun runtime, Deno runtime, database seeding, and Prisma schema documentation for enhanced user learning experience.
  • New Features

    • Introduced video embed capability to documentation pages.

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Feb 23, 2026 5:27pm
docs Ready Ready Preview, Comment Feb 23, 2026 5:27pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

🍈 Lychee Link Check Report

3664 links: ✅ 2994 OK | 🚫 4 errors | 🔀 0 redirects | 👻 664 excluded

❌ Errors

./apps/docs/content/docs.v6/guides/permit-io-access-control.mdx

./apps/docs/content/docs.v6/guides/solid-start.mdx

./apps/docs/content/docs/guides/frameworks/solid-start.mdx

./apps/docs/content/docs/guides/integrations/permit-io.mdx


Full Statistics Table
Status Count
✅ Successful 2994
🔀 Redirected 0
👻 Excluded 664
🚫 Errors 4
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

Adds a new YouTube component and integrates it into the documentation system. The component renders responsive YouTube iframes with 16:9 aspect ratio. Updates the MDX component registry to expose the component globally, then embeds videos in six documentation pages covering various Prisma guides.

Changes

Cohort / File(s) Summary
Component Implementation
apps/docs/src/components/youtube.tsx, apps/docs/src/mdx-components.tsx
New responsive YouTube iframe component with props for videoId and optional title. Component exported and registered in MDX system for global availability in documentation files.
Documentation - Integration & Runtime Guides
apps/docs/content/docs/guides/integrations/supabase-accelerate.mdx, apps/docs/content/docs/guides/runtimes/bun.mdx, apps/docs/content/docs/guides/runtimes/deno.mdx
YouTube video embeds inserted after introduction sections in Supabase Accelerate, Bun, and Deno runtime guides.
Documentation - ORM & Schema Guides
apps/docs/content/docs/orm/prisma-migrate/workflows/seeding.mdx, apps/docs/content/docs/orm/prisma-schema/overview/location.mdx
YouTube embeds added within Accordion components in seeding and schema location guides. Note: location.mdx contains duplicate placement of the same embed in two separate locations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: creating a new YouTube component and integrating it across multiple documentation files with specific video IDs.

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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
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 (2)
apps/docs/src/components/youtube.tsx (2)

11-11: 16 / 9 evaluates to 1.7777... at runtime — prefer the CSS string form.

style={{ aspectRatio: 16 / 9 }} is a JS division expression that resolves to the repeating decimal 1.7777777777777777, which React stringifies directly into the DOM. Both are valid, but the idiomatic CSS notation "16 / 9" preserves semantic intent and matches how the property is specified in stylesheets.

✨ Proposed fix
-      style={{ aspectRatio: 16 / 9 }}
+      style={{ aspectRatio: "16 / 9" }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/src/components/youtube.tsx` at line 11, The inline style uses a
numeric division expression for aspectRatio (style={{ aspectRatio: 16 / 9 }}),
which evaluates to a long decimal; change it to the CSS string form to preserve
intent and avoid float stringification — update the JSX in the YouTube component
(the element using style with aspectRatio) so the aspectRatio value is the
string "16 / 9" instead of the numeric expression.

9-9: videoId is interpolated raw — consider encodeURIComponent for defensive correctness.

videoId is typed as a plain string. Valid YouTube IDs ([A-Za-z0-9_-]) are URL-safe, but the type carries no enforcement. A value like "abc?autoplay=1" or a typo with a space would silently produce a malformed or behavior-altering URL.

🛡️ Proposed fix
-      src={`https://www.youtube.com/embed/${videoId}`}
+      src={`https://www.youtube.com/embed/${encodeURIComponent(videoId)}`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/src/components/youtube.tsx` at line 9, The src URL for the YouTube
iframe is built by interpolating videoId raw, which can produce malformed or
unsafe URLs; update the component in apps/docs/src/components/youtube.tsx to
sanitize/encode the ID before interpolation (use encodeURIComponent(videoId) or
validate against the expected regex [A-Za-z0-9_-]+ and reject/normalize invalid
values) so the src prop becomes a URL-safe string and escapes any accidental
query or whitespace injected into the videoId.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/src/components/youtube.tsx`:
- Line 14: The YouTube embed is missing "web-share" in the iframe's allow
attribute, which prevents the in-player share button from working; update the
allow string in the YouTube embed (the allow attribute in
apps/docs/src/components/youtube.tsx) to include "web-share" alongside the
existing tokens (e.g., "accelerometer; autoplay; clipboard-write;
encrypted-media; gyroscope; picture-in-picture; web-share") so the Web Share API
is enabled inside the player.

---

Nitpick comments:
In `@apps/docs/src/components/youtube.tsx`:
- Line 11: The inline style uses a numeric division expression for aspectRatio
(style={{ aspectRatio: 16 / 9 }}), which evaluates to a long decimal; change it
to the CSS string form to preserve intent and avoid float stringification —
update the JSX in the YouTube component (the element using style with
aspectRatio) so the aspectRatio value is the string "16 / 9" instead of the
numeric expression.
- Line 9: The src URL for the YouTube iframe is built by interpolating videoId
raw, which can produce malformed or unsafe URLs; update the component in
apps/docs/src/components/youtube.tsx to sanitize/encode the ID before
interpolation (use encodeURIComponent(videoId) or validate against the expected
regex [A-Za-z0-9_-]+ and reject/normalize invalid values) so the src prop
becomes a URL-safe string and escapes any accidental query or whitespace
injected into the videoId.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03144e5 and 93c19d9.

📒 Files selected for processing (7)
  • apps/docs/content/docs/guides/integrations/supabase-accelerate.mdx
  • apps/docs/content/docs/guides/runtimes/bun.mdx
  • apps/docs/content/docs/guides/runtimes/deno.mdx
  • apps/docs/content/docs/orm/prisma-migrate/workflows/seeding.mdx
  • apps/docs/content/docs/orm/prisma-schema/overview/location.mdx
  • apps/docs/src/components/youtube.tsx
  • apps/docs/src/mdx-components.tsx

style={{ aspectRatio: 16 / 9 }}
loading="lazy"
referrerPolicy="strict-origin-when-cross-origin"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing web-share from the allow attribute — share button won't work.

YouTube's own embed snippet uses allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share". The omission of web-share disables the Web Share API inside the player, so the in-player share button silently fails.

🐛 Proposed fix
-      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/src/components/youtube.tsx` at line 14, The YouTube embed is
missing "web-share" in the iframe's allow attribute, which prevents the
in-player share button from working; update the allow string in the YouTube
embed (the allow attribute in apps/docs/src/components/youtube.tsx) to include
"web-share" alongside the existing tokens (e.g., "accelerometer; autoplay;
clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share") so
the Web Share API is enabled inside the player.

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