@devries-cameron20 / t3code Mirror · read-only / commits / 3997b9a3a4
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 02:45 UTC

fix(web): align floating browser preview corners (#10915)

Henry Zhang committed Sep 11, 2026 at 02:37 UTC 3997b9a3a4ee6b43ee768a9b372ff3dd52fd840e
1 file changed +17 -5
apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
+17 -5
@@ -44,6 +44,8 @@ interface Props {
44 readonly bottomInset: number;
45 }
46
47 +const PREVIEW_MINI_PLAYER_CORNER_RADIUS = 12;
48 +
49 // Invisible grab zones straddling each edge; the cursor is the only affordance.
50 const RESIZE_HANDLES: ReadonlyArray<{
51 readonly direction: BrowserViewportResizeDirection;
@@ -59,6 +61,10 @@ const RESIZE_HANDLES: ReadonlyArray<{
61 { direction: "southeast", className: "-bottom-2 -right-2 size-4 cursor-nwse-resize" },
62 ];
63
64 +/**
65 + * Floats the thread's browser surface over chat. Native clipping and the DOM
66 + * frame use the same radius so their separately composited edges stay aligned.
67 + */
68 export function ThreadPreviewMiniPlayer({ threadRef, tabId, bottomInset }: Props) {
69 const containerRef = useRef<HTMLDivElement | null>(null);
70 const gestureRef = useRef<PointerGesture | null>(null);
@@ -193,7 +199,13 @@ export function ThreadPreviewMiniPlayer({ threadRef, tabId, bottomInset }: Props
199 aria-label="Floating browser preview"
200 data-preview-mini-player={tabId}
201 className="pointer-events-none absolute select-none"
196 - style={{ left: frame.x, top: frame.y, width: frame.width, height: frame.height }}
202 + style={{
203 + left: frame.x,
204 + top: frame.y,
205 + width: frame.width,
206 + height: frame.height,
207 + borderRadius: PREVIEW_MINI_PLAYER_CORNER_RADIUS,
208 + }}
209 >
210 <div className="group pointer-events-auto absolute right-2 top-2 z-[49] size-3">
211 <div
@@ -267,19 +279,19 @@ export function ThreadPreviewMiniPlayer({ threadRef, tabId, bottomInset }: Props
279 </div>
280 </div>
281
270 - <div className="absolute inset-0 z-[47] rounded-xl bg-muted shadow-2xl/35" />
282 + <div className="absolute inset-0 z-[47] rounded-[inherit] bg-muted shadow-2xl/35" />
283 <BrowserSurfaceSlot
284 tabId={runtimeTabId}
285 visible={Boolean(desktopOverlay?.hasWebContents)}
274 - cornerRadius={12}
286 + cornerRadius={PREVIEW_MINI_PLAYER_CORNER_RADIUS}
287 zIndex={PREVIEW_MINI_PLAYER_WEBVIEW_Z_INDEX}
288 fitSourceContent
289 layoutVersion={`${frame.x}:${frame.y}`}
290 className="absolute inset-0"
291 />
280 - <div className="pointer-events-none absolute inset-0 z-[49] rounded-xl ring-1 ring-inset ring-border/80" />
292 + <div className="pointer-events-none absolute inset-0 z-[49] rounded-[inherit] ring-1 ring-inset ring-border/80" />
293 {!desktopOverlay?.hasWebContents ? (
282 - <div className="pointer-events-none absolute inset-0 z-[49] flex items-center justify-center rounded-xl bg-muted text-xs text-muted-foreground">
294 + <div className="pointer-events-none absolute inset-0 z-[49] flex items-center justify-center rounded-[inherit] bg-muted text-xs text-muted-foreground">
295 Reconnecting preview…
296 </div>
297 ) : null}