This commit is contained in:
Timothy Jaeryang Baek
2026-03-24 05:48:43 -05:00
parent cf60b1882f
commit 12f0ad28bf
3 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -291,7 +291,7 @@
<!-- Controls + Files tabs --> <!-- Controls + Files tabs -->
<div class="flex flex-col h-full min-h-0"> <div class="flex flex-col h-full min-h-0">
<!-- Tab bar --> <!-- Tab bar -->
<div class="flex items-center justify-between px-2 pt-2.5 pb-2 shrink-0"> <div class="flex items-center justify-between px-2 pt-2 pb-2 shrink-0">
<div class="flex gap-1 min-w-0 overflow-x-auto scrollbar-hidden"> <div class="flex gap-1 min-w-0 overflow-x-auto scrollbar-hidden">
{#if showControlsTab} {#if showControlsTab}
<button <button
@@ -437,7 +437,7 @@
<!-- Controls + Files tabs --> <!-- Controls + Files tabs -->
<div class="flex flex-col h-full min-h-0"> <div class="flex flex-col h-full min-h-0">
<!-- Tab bar --> <!-- Tab bar -->
<div class="flex items-center justify-between px-2 pt-2.5 pb-2 shrink-0"> <div class="flex items-center justify-between px-2 pt-2 pb-2 shrink-0">
<div class="flex gap-1 min-w-0 overflow-x-auto scrollbar-hidden"> <div class="flex gap-1 min-w-0 overflow-x-auto scrollbar-hidden">
{#if showControlsTab} {#if showControlsTab}
<button <button
+3 -2
View File
@@ -1151,6 +1151,7 @@
<PortPreview <PortPreview
baseUrl={selectedTerminal?.url ?? ''} baseUrl={selectedTerminal?.url ?? ''}
port={previewPort} port={previewPort}
overlay={overlay || isDraggingHandle}
onClose={() => { onClose={() => {
previewPort = null; previewPort = null;
}} }}
@@ -1183,7 +1184,7 @@
}} }}
baseUrl={selectedTerminal?.url ?? ''} baseUrl={selectedTerminal?.url ?? ''}
apiKey={selectedTerminal?.key ?? ''} apiKey={selectedTerminal?.key ?? ''}
{overlay} overlay={overlay || isDraggingHandle}
onSave={async (content) => { onSave={async (content) => {
const terminal = selectedTerminal; const terminal = selectedTerminal;
if (!terminal || !selectedFile) return; if (!terminal || !selectedFile) return;
@@ -1364,7 +1365,7 @@
{#if terminalExpanded} {#if terminalExpanded}
<div style="height: {terminalHeight}px" class="min-h-0"> <div style="height: {terminalHeight}px" class="min-h-0">
<XTerminal <XTerminal
{overlay} overlay={overlay || isDraggingHandle}
bind:connected={terminalConnected} bind:connected={terminalConnected}
bind:connecting={terminalConnecting} bind:connecting={terminalConnecting}
/> />
@@ -9,6 +9,7 @@
export let port: number; export let port: number;
export let path: string = ''; export let path: string = '';
export let onClose: () => void = () => {}; export let onClose: () => void = () => {};
export let overlay = false;
let iframeEl: HTMLIFrameElement; let iframeEl: HTMLIFrameElement;
let urlInput: string = ''; let urlInput: string = '';
@@ -257,16 +258,21 @@
{/if} {/if}
<!-- Iframe --> <!-- Iframe -->
{#key iframeKey} <div class="flex-1 min-h-0 relative">
<iframe {#if overlay}
bind:this={iframeEl} <div class="absolute inset-0 z-10"></div>
src={proxyUrl} {/if}
title="Port {port} preview" {#key iframeKey}
class="flex-1 w-full min-h-0 border-0 bg-white" <iframe
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads" bind:this={iframeEl}
on:load={onIframeLoad} src={proxyUrl}
/> title="Port {port} preview"
{/key} class="w-full h-full border-0 bg-white"
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads"
on:load={onIframeLoad}
/>
{/key}
</div>
</div> </div>
<style> <style>