Repository navigation
feat: play YouTube videos inline in Control UI chats - #164576
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 7:00 PM ET / 23:00 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds click-to-play YouTube cards to Control UI chat replies, with timestamp support, external watch links, playback cleanup, documentation, and assistant guidance. Merge readiness✅ Ready for maintainer review Keep open: current main lacks the dedicated playback path, and the PR remains useful. No actionable correctness or security finding emerged from this re-review. Priority: P2 Review scores
Verification
How this fits togetherControl UI chat turns assistant embed shortcodes into inline content. The new renderer recognizes supported YouTube URLs and presents a preview, then loads the external player after user activation. flowchart TD
A[Assistant reply] --> B[Existing embed parser]
B --> C[YouTube URL validation]
C --> D[Thumbnail card]
D --> E{Playback permitted and activated}
E -->|Yes| F[YouTube privacy player]
E -->|No| G[External watch link]
F --> H[Card and session cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +429, Tests +331, Docs +52. Total +812 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the dedicated lazy renderer within the existing embed contract, preserving strict-mode fallback, bounded provider URLs, and card-owned playback cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request. Current-main source establishes the missing dedicated renderer; this read-only review did not execute playback. Is this the best way to solve the issue? Yes. Reusing the embed syntax with a narrow provider renderer avoids another model-facing tool and preserves the existing widget isolation boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1a158881cd01. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
* feat: play YouTube videos inline in Control UI chats * fix: keep narrow YouTube previews inside their cards * fix: bind YouTube playback handler to the card * fix: use Control UI tokens and link cursor styling
What Problem This Solves
Control UI replies had no supported inline YouTube player or cover preview.
User Impact
Assistants can emit
[embed url="https://www.youtube.com/watch?v=VIDEO_ID" title="Video" /]to show a thumbnail card with click-to-load playback, timestamps, and an always-visible Open on YouTube link. Starting another card stops the previous video. Strict embed mode and narrow layouts keep external playback available.Thumbnails contact Google before Play. The player loads from
youtube-nocookie.comafter activation and receives only the Control UI origin as its referrer. No new configuration or migration is required; generic external embeds and widget sandbox rules retain their existing behavior.Why This Change Was Made
The existing embed shortcode gives agents a direct way to present videos without a new media tool, download, or rehosting step. A small hint in the Control UI prompt advertises it while preserving the stable prompt prefix and other channels' link behavior. The UI owns URL normalization and playback lifecycle; the privileged parent does not load YouTube's API script.
Evidence
88952a178850481708137dc553dce10323418100. Earlier CI exposed handler-binding and theme/cursor-policy errors; all were corrected and verified with their existing checks.pnpm test <focused files> --maxWorkers=1took 94.52s cold across the prompt/UI shards; final prompt/lifecycle replay took 73.95s and widget siblings 9.37s. Style-policy coverage took 43.66s. Bundled E2E took 21.97s local wall; its new case took 2.04s in CI (2.20s for the file), within the existing shared job.The before/after screenshots use the same synthetic conversation and artwork. The narrow preview was also inspected in the user's gallery after refresh: 188px preview inside a 190px card, with matching button/card centers.