From 0c265f01b59e5f1bdd09ca64a1557ccd572d8fce Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Jan 2026 13:54:58 +0000 Subject: [PATCH] feat: Add pop-out command route for standalone window rendering Add a new /run route that allows windows to be opened in separate browser windows/tabs without affecting the main workspace layout. Changes: - Add RunCommandPage component for /run?cmd= route - Add Pop Out button to WindowToolbar (ExternalLink icon) - Parse command from URL query parameter and render result - Construct minimal WindowInstance for rendering - Display command string in header with clean minimal UI This enables users to pop out any window into a separate browser context while maintaining the main workspace layout, useful for multi-monitor setups or keeping reference windows visible. --- src/components/WindowToolbar.tsx | 28 ++++++ src/components/pages/RunCommandPage.tsx | 124 ++++++++++++++++++++++++ src/root.tsx | 5 + 3 files changed, 157 insertions(+) create mode 100644 src/components/pages/RunCommandPage.tsx diff --git a/src/components/WindowToolbar.tsx b/src/components/WindowToolbar.tsx index 9ffa13f..aef1e35 100644 --- a/src/components/WindowToolbar.tsx +++ b/src/components/WindowToolbar.tsx @@ -6,6 +6,7 @@ import { Copy, CopyCheck, ArrowRightFromLine, + ExternalLink, } from "lucide-react"; import { useSetAtom } from "jotai"; import { useState } from "react"; @@ -91,6 +92,21 @@ export function WindowToolbar({ setShowSpellDialog(true); }; + const handlePopOut = () => { + if (!window) return; + + // Get command string (existing or reconstructed) + const commandString = window.commandString || reconstructCommand(window); + + // Construct the /run URL with the command as a query parameter + const popOutUrl = `/run?cmd=${encodeURIComponent(commandString)}`; + + // Open in a new window/tab + globalThis.window.open(popOutUrl, "_blank"); + + toast.success("Window popped out"); + }; + // Copy functionality for NIPs const { copy, copied } = useCopy(); const isNipWindow = window?.appId === "nip"; @@ -139,6 +155,18 @@ export function WindowToolbar({ + {/* Pop Out button */} + + {/* Copy button for NIPs */} {isNipWindow && (