Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
51d076f
feat(site): expose workspace apps in chat workspace pill
DanielleMaywood Apr 13, 2026
057ac8d
test(site): add storybook stories for WorkspacePill
DanielleMaywood Apr 13, 2026
dd3f0be
refactor(site): drop appendChatIdToHref, match AgentRow pattern
DanielleMaywood Apr 13, 2026
da60ae8
chore(site): remove stale-prone comments from WorkspacePill
DanielleMaywood Apr 13, 2026
fd165c9
refactor(site): WorkspacePill owns its status display, eliminate Reac…
DanielleMaywood Apr 13, 2026
f366b30
fix(site): remove stray whitespace expression in ChatTopBar
DanielleMaywood Apr 13, 2026
ba6fda9
fix(site): update AgentChatPage story for meatball menu changes
DanielleMaywood Apr 13, 2026
3441075
refactor(site): use Popover styling from #24308 for WorkspacePill
DanielleMaywood Apr 13, 2026
9689199
refactor(site): move Copy SSH and View Workspace from meatball to pill
DanielleMaywood Apr 13, 2026
6610110
fix(site): flip chevron direction for top popover, suppress tooltip w…
DanielleMaywood Apr 13, 2026
20de227
fix(site): show all workspace apps in pill, not just external ones
DanielleMaywood Apr 13, 2026
9c4be48
fix(site): address self-review findings (separator, overflow, story)
DanielleMaywood Apr 13, 2026
29ae400
fix(site): address review feedback (folder, status indicator, null gu…
DanielleMaywood Apr 13, 2026
0dcd9bd
fix(site): address panel review feedback (dropdown, token guard, stor…
DanielleMaywood Apr 13, 2026
5d6aa30
fix(site): address self-review findings (mutation unmount, disabled s…
DanielleMaywood Apr 13, 2026
559e05b
fix(site): address self-review round 2 (tooltip, alt, folder fallback…
DanielleMaywood Apr 13, 2026
1b186da
refactor(site): inline cls variables and remove workspaceStatusDisplay
DanielleMaywood Apr 13, 2026
19ba116
refactor(site): extract StatusIcon component to deduplicate status ic…
DanielleMaywood Apr 13, 2026
a95bf52
fix(site): address R3 review feedback (shared status, mutation lift, …
DanielleMaywood Apr 14, 2026
831572d
fix(site/src/pages/AgentsPage): add external app disabled assertions,…
DanielleMaywood Apr 14, 2026
6373d75
fix(site/src/pages/AgentsPage): fix WithWorkspace story props, add en…
DanielleMaywood Apr 14, 2026
ef908e8
fix(site/src/pages/AgentsPage): useClipboard, restore Cursor, fix fak…
DanielleMaywood Apr 14, 2026
95d78c5
fix(site/src/pages/AgentsPage): remove builtin Cursor, fix clipboard/…
DanielleMaywood Apr 14, 2026
cff4e04
fix(site/src/pages/AgentsPage): assert href absence on disabled exter…
DanielleMaywood Apr 14, 2026
aedb81c
fix(site/src/pages/AgentsPage): group launch items above separator
DanielleMaywood Apr 14, 2026
ed94b48
fix(site/src/pages/AgentsPage): use consistent app names without Open…
DanielleMaywood Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(site): inline cls variables and remove workspaceStatusDisplay
- Inline badgeCls directly into cn() call in WorkspacePill
- Remove workspaceStatusDisplay.tsx and its test file
- Inline status icon/label computation into both callers
  (WorkspacePill and AgentChatPageView)
- Replace iconCls variable with direct "size-3" on each icon
  • Loading branch information
DanielleMaywood committed Apr 13, 2026
commit 1b186da9aff4711cb4fa6a420b9ad2216c2b3f80
52 changes: 46 additions & 6 deletions site/src/pages/AgentsPage/AgentChatPageView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ArchiveIcon } from "lucide-react";
import {
ArchiveIcon,
MonitorDotIcon,
MonitorIcon,
MonitorPauseIcon,
MonitorXIcon,
} from "lucide-react";

import {
type FC,
Expand All @@ -14,7 +20,10 @@ import type * as TypesGen from "#/api/typesGenerated";
import type { ChatDiffStatus, ChatMessagePart } from "#/api/typesGenerated";
import { cn } from "#/utils/cn";
import { pageTitle } from "#/utils/page";

import {
type DisplayWorkspaceStatusType,
getDisplayWorkspaceStatus,
} from "#/utils/workspace";
import {
AgentChatInput,
type ChatMessageInputRef,
Expand All @@ -34,7 +43,6 @@ import { GitPanel } from "./components/GitPanel/GitPanel";
import { RightPanel } from "./components/RightPanel/RightPanel";
import { SidebarTabView } from "./components/Sidebar/SidebarTabView";
import { TerminalPanel } from "./components/TerminalPanel";
import { getWorkspaceStatusDisplay } from "./components/workspaceStatusDisplay";
import { ChatWorkspaceContext } from "./context/ChatWorkspaceContext";
import { chatWidthClass, useChatFullWidth } from "./hooks/useChatFullWidth";
import type { ChatDetailError } from "./utils/usageLimitMessage";
Expand Down Expand Up @@ -269,11 +277,43 @@ export const AgentChatPageView: FC<AgentChatPageViewProps> = ({

const attachedWorkspace = (() => {
if (!workspace || !workspaceRoute) return undefined;
const { statusLabel, statusIcon } = getWorkspaceStatusDisplay(
workspace,
workspaceAgent,

const statusIconMap: Record<DisplayWorkspaceStatusType, ReactNode> = {
success: <MonitorIcon className="size-3" />,
active: <MonitorDotIcon className="size-3" />,
inactive: <MonitorPauseIcon className="size-3" />,
error: <MonitorXIcon className="size-3" />,
danger: <MonitorXIcon className="size-3" />,
warning: <MonitorXIcon className="size-3" />,
};

let { type, text } = getDisplayWorkspaceStatus(
workspace.latest_build.status,
workspace.latest_build.job,
);

const agentPreparing =
workspace.latest_build.status === "running" &&
(workspaceAgent?.lifecycle_state === "created" ||
workspaceAgent?.lifecycle_state === "starting");
const agentStartupFailed =
workspace.latest_build.status === "running" &&
(workspaceAgent?.lifecycle_state === "start_error" ||
workspaceAgent?.lifecycle_state === "start_timeout");
if (agentPreparing) {
type = "active";
text = "Preparing";
} else if (agentStartupFailed) {
type = "warning";
text = "Startup failed";
}

const effectiveType = workspace.health.healthy ? type : "warning";
const statusLabel = workspace.health.healthy
? `Workspace ${text.toLowerCase()}`
: `Workspace ${text.toLowerCase()} (unhealthy)`;
const statusIcon = statusIconMap[effectiveType];

return {
name: workspace.name,
route: workspaceRoute,
Expand Down
50 changes: 42 additions & 8 deletions site/src/pages/AgentsPage/components/WorkspacePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import {
CopyIcon,
ExternalLinkIcon,
LayoutGridIcon,
MonitorDotIcon,
MonitorIcon,
MonitorPauseIcon,
MonitorXIcon,
SquareTerminalIcon,
} from "lucide-react";
import type { FC } from "react";
import type { FC, ReactNode } from "react";
import { useState } from "react";
import { useMutation } from "react-query";
import { Link } from "react-router";
Expand Down Expand Up @@ -39,10 +42,19 @@ import {
} from "#/modules/apps/apps";
import { useAppLink } from "#/modules/apps/useAppLink";
import { cn } from "#/utils/cn";
import { getWorkspaceStatusDisplay } from "./workspaceStatusDisplay";
import {
type DisplayWorkspaceStatusType,
getDisplayWorkspaceStatus,
} from "#/utils/workspace";

const badgeCls =
"inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-secondary px-2 py-0.5 text-xs font-medium text-content-secondary";
const statusIconMap: Record<DisplayWorkspaceStatusType, ReactNode> = {
success: <MonitorIcon className="size-3" />,
active: <MonitorDotIcon className="size-3" />,
inactive: <MonitorPauseIcon className="size-3" />,
error: <MonitorXIcon className="size-3" />,
danger: <MonitorXIcon className="size-3" />,
warning: <MonitorXIcon className="size-3" />,
};

interface WorkspacePillProps {
workspace: Workspace;
Expand All @@ -64,11 +76,33 @@ export const WorkspacePill: FC<WorkspacePillProps> = ({
const isRunning = workspace.latest_build.status === "running";
const route = `/@${workspace.owner_name}/${workspace.name}`;

const { statusLabel, statusIcon } = getWorkspaceStatusDisplay(
workspace,
agent,
let { type, text } = getDisplayWorkspaceStatus(
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
workspace.latest_build.status,
workspace.latest_build.job,
);

const agentPreparing =
workspace.latest_build.status === "running" &&
(agent?.lifecycle_state === "created" ||
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
agent?.lifecycle_state === "starting");
const agentStartupFailed =
workspace.latest_build.status === "running" &&
(agent?.lifecycle_state === "start_error" ||
agent?.lifecycle_state === "start_timeout");
if (agentPreparing) {
type = "active";
text = "Preparing";
} else if (agentStartupFailed) {
type = "warning";
text = "Startup failed";
}

const effectiveType = workspace.health.healthy ? type : "warning";
const statusLabel = workspace.health.healthy
? `Workspace ${text.toLowerCase()}`
: `Workspace ${text.toLowerCase()} (unhealthy)`;
const statusIcon = statusIconMap[effectiveType];

const builtinApps = new Set(agent.display_apps);
const hasVSCode = builtinApps.has("vscode");
const hasVSCodeInsiders = builtinApps.has("vscode_insiders");
Expand All @@ -95,7 +129,7 @@ export const WorkspacePill: FC<WorkspacePillProps> = ({
type="button"
aria-label={`${workspace.name} workspace menu`}
className={cn(
badgeCls,
"inline-flex shrink-0 items-center gap-1 rounded-full bg-surface-secondary px-2 py-0.5 text-xs font-medium text-content-secondary",
"cursor-pointer border-0 transition-colors hover:bg-surface-tertiary hover:text-content-primary",
)}
>
Expand Down

This file was deleted.

65 changes: 0 additions & 65 deletions site/src/pages/AgentsPage/components/workspaceStatusDisplay.tsx

This file was deleted.