diff --git a/web/src/components/layout/WorkspaceShell.tsx b/web/src/components/layout/WorkspaceShell.tsx
index a841b9a..f57bf95 100644
--- a/web/src/components/layout/WorkspaceShell.tsx
+++ b/web/src/components/layout/WorkspaceShell.tsx
@@ -1,14 +1,22 @@
+import { useMemo } from "react";
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
-import { PanelLeftClose, PanelLeftOpen, Terminal } from "lucide-react";
+import { PanelLeftClose, PanelLeftOpen, Play, RotateCw, Square, Terminal } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
+import { cn } from "@/lib/utils";
import { EditorPanel } from "@/components/editor/EditorPanel";
import { TerminalPanel } from "@/components/terminal/TerminalPanel";
import { FileExplorerPanel } from "@/components/workspace/FileExplorerPanel";
import { StatusBar } from "@/components/workspace/StatusBar";
import { WorkspaceSelector } from "@/components/workspace/WorkspaceSelector";
import { useWorkspaceUiStore } from "@/lib/store/workspace-ui-store";
+import {
+ useProcessRestart,
+ useProcessStart,
+ useProcessStatus,
+ useProcessStop,
+} from "@/lib/api/process";
interface WorkspaceShellProps {
workspaceId: string;
@@ -21,6 +29,19 @@ export function WorkspaceShell({ workspaceId }: WorkspaceShellProps) {
const toggleSidebar = useWorkspaceUiStore((s) => s.toggleSidebar);
const toggleTerminal = useWorkspaceUiStore((s) => s.toggleTerminal);
+ const status = useProcessStatus(workspaceId);
+ const start = useProcessStart();
+ const stop = useProcessStop();
+ const restart = useProcessRestart();
+
+ const isRunning = status.data?.running ?? false;
+ const statusUnknown = status.isPending || status.isError;
+
+ const mutationError = useMemo(
+ () => start.error ?? stop.error ?? restart.error,
+ [start.error, stop.error, restart.error],
+ );
+
return (
{/* Toolbar */}
@@ -50,6 +71,41 @@ export function WorkspaceShell({ workspaceId }: WorkspaceShellProps) {
>
+
+
+
+ {mutationError && (
+
+ {mutationError.message}
+
+ )}
@@ -89,7 +145,7 @@ export function WorkspaceShell({ workspaceId }: WorkspaceShellProps) {
{/* Status bar */}
-
+
);
}
diff --git a/web/src/components/workspace/StatusBar.tsx b/web/src/components/workspace/StatusBar.tsx
index cd2e632..a640e7b 100644
--- a/web/src/components/workspace/StatusBar.tsx
+++ b/web/src/components/workspace/StatusBar.tsx
@@ -3,15 +3,19 @@ import { Terminal, FileCode2 } from "lucide-react";
import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";
import { useWorkspaceUiStore } from "@/lib/store/workspace-ui-store";
+import { useProcessStatus } from "@/lib/api/process";
interface StatusBarProps {
activeFilePath: string;
+ workspaceId: string | null;
}
-export function StatusBar({ activeFilePath }: StatusBarProps) {
+export function StatusBar({ activeFilePath, workspaceId }: StatusBarProps) {
const terminalVisible = useWorkspaceUiStore((s) => s.terminalVisible);
const toggleTerminal = useWorkspaceUiStore((s) => s.toggleTerminal);
+ const status = useProcessStatus(workspaceId);
+
return (