The best way to control Claude Code, Codex and more from any computer or phone
fix(web): play pull request videos inline (#10617)
maria committed
Sep 7, 2026 at 20:52 UTC
569a8cd2c3303f55fd869687eb31359b5658cc78
1 file changed
+17
-14
apps/web/src/components/pullRequest/PullRequestMarkdown.tsx
+17
-14
@@ -1,4 +1,4 @@
1
-import { ExternalLinkIcon, PaperclipIcon, PlayIcon } from "lucide-react";
1
+import { ExternalLinkIcon, PaperclipIcon } from "lucide-react";
2
import type { EnvironmentId, ScopedThreadRef } from "@t3tools/contracts";
3
import { createContext, useContext, useMemo } from "react";
4
import type { Options as ReactMarkdownOptions } from "react-markdown";
@@ -6,17 +6,12 @@ import type { Options as ReactMarkdownOptions } from "react-markdown";
6
import { cn } from "~/lib/utils";
7
8
import ChatMarkdown from "../ChatMarkdown";
9
+import { MediaVideoPlayer } from "../media/MediaVideoPlayer";
10
import { remarkPullRequestAutolinks, splitPullRequestBody } from "./pullRequestMarkdown.logic";
11
12
export const PullRequestMarkdownContext = createContext<string | null>(null);
13
13
-/**
14
- * A pull request body, rendered with the app's markdown renderer plus a card for each upload
15
- * embedded in it, which that renderer drops on the floor.
16
- *
17
- * These upload URLs do not identify the media format. The card links to GitHub, where the
18
- * original upload can be opened or downloaded even when its codec cannot play in the client.
19
- */
14
+/** Renders PR uploads inline, with retry and an original link when video playback fails. */
15
export function PullRequestMarkdown({
16
text,
17
cwd,
@@ -52,8 +47,18 @@ export function PullRequestMarkdown({
47
/>
48
);
49
}
55
- const isVideo = segment.media === "video";
56
- const Icon = isVideo ? PlayIcon : PaperclipIcon;
50
+ if (segment.media === "video") {
51
+ return (
52
+ <MediaVideoPlayer
53
+ key={`${segment.id}:${segment.url}`}
54
+ src={segment.url}
55
+ originalUrl={segment.url}
56
+ label="Pull request video"
57
+ className="w-full"
58
+ videoClassName="rounded-lg border border-border/60"
59
+ />
60
+ );
61
+ }
62
return (
63
// A plain anchor rather than the page's openExternal button: the desktop window
64
// turns a blocked _blank into openExternal itself, and in a browser tab — where
@@ -65,10 +70,8 @@ export function PullRequestMarkdown({
70
target="_blank"
71
className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/30 px-3 py-2 text-sm hover:bg-muted/60"
72
>
68
- <Icon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />
69
- <span className="min-w-0 flex-1 truncate">
70
- {isVideo ? "Play video on GitHub" : "Open attachment on GitHub"}
71
- </span>
73
+ <PaperclipIcon aria-hidden className="size-3.5 shrink-0 text-muted-foreground" />
74
+ <span className="min-w-0 flex-1 truncate">Open attachment on GitHub</span>
75
<ExternalLinkIcon aria-hidden className="size-3 shrink-0 text-muted-foreground" />
76
</a>
77
);