diff --git a/packages/app/src/screens/workspace/workspace-screen.tsx b/packages/app/src/screens/workspace/workspace-screen.tsx index 75787ccc6..cf59bab9e 100644 --- a/packages/app/src/screens/workspace/workspace-screen.tsx +++ b/packages/app/src/screens/workspace/workspace-screen.tsx @@ -177,6 +177,12 @@ const EMPTY_PINNED_AGENT_IDS = new Set(); const EMPTY_SET = new Set(); const COMPACT_WEB_GESTURE_TOUCH_ACTION = isWeb ? "auto" : "pan-y"; +function getWorkspaceScripts( + workspaceDescriptor: WorkspaceDescriptor | null | undefined, +): WorkspaceDescriptor["scripts"] { + return workspaceDescriptor?.scripts ?? EMPTY_WORKSPACE_SCRIPTS; +} + const ThemedActivityIndicator = withUnistyles(ActivityIndicator); const ThemedEllipsis = withUnistyles(Ellipsis); const ThemedEllipsisVertical = withUnistyles(EllipsisVertical); @@ -949,6 +955,8 @@ interface WorkspaceHeaderTitleBarProps { isGitCheckout: boolean; normalizedServerId: string; normalizedWorkspaceId: string; + workspaceScripts: WorkspaceDescriptor["scripts"]; + liveTerminalIds: string[]; showWorkspaceSetup: boolean; showCreateBrowserTab: boolean; isMobile: boolean; @@ -967,6 +975,9 @@ interface WorkspaceHeaderTitleBarProps { onCopyWorkspacePath: () => void; onCopyBranchName: () => void; onOpenSetupTab: () => void; + onScriptTerminalStarted: (terminalId: string) => void; + onViewScriptTerminal: (terminalId: string) => void; + onOpenUrlInBrowserTab: (url: string) => void; } function WorkspaceHeaderTitleBar({ @@ -978,6 +989,8 @@ function WorkspaceHeaderTitleBar({ isGitCheckout, normalizedServerId, normalizedWorkspaceId, + workspaceScripts, + liveTerminalIds, showWorkspaceSetup, showCreateBrowserTab, isMobile, @@ -996,6 +1009,9 @@ function WorkspaceHeaderTitleBar({ onCopyWorkspacePath, onCopyBranchName, onOpenSetupTab, + onScriptTerminalStarted, + onViewScriptTerminal, + onOpenUrlInBrowserTab, }: WorkspaceHeaderTitleBarProps) { return ( @@ -1045,6 +1061,18 @@ function WorkspaceHeaderTitleBar({ onCopyBranchName={onCopyBranchName} onOpenSetupTab={onOpenSetupTab} /> + {isMobile && workspaceScripts.length > 0 ? ( + + ) : null} ); } @@ -1471,6 +1499,7 @@ function WorkspaceScreenContent({ [workspaceId], ); const workspaceDescriptor = useWorkspace(normalizedServerId, normalizedWorkspaceId); + const workspaceScripts = getWorkspaceScripts(workspaceDescriptor); const { handleRetryHost, handleManageHost, handleDismissMissingWorkspace } = useWorkspaceRouteActions(normalizedServerId); @@ -1570,7 +1599,7 @@ function WorkspaceScreenContent({ normalizedServerId, normalizedWorkspaceId, workspaceDirectory, - workspaceScripts: workspaceDescriptor?.scripts ?? EMPTY_WORKSPACE_SCRIPTS, + workspaceScripts, hasHydratedWorkspaces, isMissingWorkspaceExecutionAuthority, onTerminalCreated: handleTerminalCreated, @@ -3257,6 +3286,8 @@ function WorkspaceScreenContent({ isGitCheckout={isGitCheckout} normalizedServerId={normalizedServerId} normalizedWorkspaceId={normalizedWorkspaceId} + workspaceScripts={workspaceScripts} + liveTerminalIds={liveTerminalIds} showWorkspaceSetup={showWorkspaceSetup} showCreateBrowserTab={showCreateBrowserTab} isMobile={isMobile} @@ -3275,6 +3306,9 @@ function WorkspaceScreenContent({ onCopyWorkspacePath={handleCopyWorkspacePath} onCopyBranchName={handleCopyBranchName} onOpenSetupTab={handleOpenSetupTab} + onScriptTerminalStarted={handleScriptTerminalStarted} + onViewScriptTerminal={handleViewScriptTerminal} + onOpenUrlInBrowserTab={handleOpenUrlInBrowserTab} /> }