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): move Copy SSH and View Workspace from meatball to pill
Move Copy SSH Command and View Workspace out of the ChatTopBar
meatball menu into the WorkspacePill popover. The meatball menu now
only contains Generate Title and Archive/Delete actions.

Remove the WorkspaceActions interface from ChatTopBar entirely.
WorkspacePill returns null when there are no apps and no SSH command,
letting the ToolBadge fallback handle the simple link case.
  • Loading branch information
DanielleMaywood committed Apr 13, 2026
commit 968919956de3991f5aa9a3e37670a36de974c970
7 changes: 4 additions & 3 deletions site/src/pages/AgentsPage/AgentChatPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,13 @@ export const CompletedWithDiffPanel: Story = {
// Verify menu items are rendered.
const body = within(document.body);
await waitFor(() => {
expect(body.getByText("View Workspace")).toBeInTheDocument();
expect(body.getByText("Archive Agent")).toBeInTheDocument();
});
expect(body.getByText("Archive Agent")).toBeInTheDocument();
// IDE items moved to the workspace pill dropdown.
// Workspace items moved to the workspace pill popover.
expect(body.queryByText("Open in Cursor")).not.toBeInTheDocument();
expect(body.queryByText("Open in VS Code")).not.toBeInTheDocument();
expect(body.queryByText("View Workspace")).not.toBeInTheDocument();
expect(body.queryByText("Copy SSH Command")).not.toBeInTheDocument();
},
};

Expand Down
13 changes: 0 additions & 13 deletions site/src/pages/AgentsPage/AgentChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1063,22 +1063,11 @@ const AgentChatPage: FC = () => {
);

const parentChat = parentChatQuery.data;
const workspaceRoute = workspace
? `/@${workspace.owner_name}/${workspace.name}`
: null;
const canOpenWorkspace = Boolean(workspaceRoute);
const sshCommand =
workspace && workspaceAgent && sshConfigQuery.data?.hostname_suffix
? `ssh ${workspaceAgent.name}.${workspace.name}.${workspace.owner_name}.${sshConfigQuery.data.hostname_suffix}`
: undefined;

const handleViewWorkspace = () => {
if (!workspaceRoute) {
return;
}
window.open(workspaceRoute, "_blank");
};

const handleArchiveAgentAction = () => {
if (!agentId || isArchived) {
return;
Expand Down Expand Up @@ -1203,8 +1192,6 @@ const AgentChatPage: FC = () => {
diffStatusData={chatQuery.data?.diff_status}
gitWatcher={gitWatcher}
sshCommand={sshCommand}
canOpenWorkspace={canOpenWorkspace}
handleViewWorkspace={handleViewWorkspace}
handleCommit={handleCommit}
handleInterrupt={handleInterrupt}
handleDeleteQueuedMessage={handleDeleteQueuedMessage}
Expand Down
6 changes: 1 addition & 5 deletions site/src/pages/AgentsPage/AgentChatPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ const StoryAgentChatPageView: FC<StoryProps> = ({ editing, ...overrides }) => {
typeof AgentChatPageView
>["diffStatusData"],
gitWatcher: buildGitWatcher(),
canOpenWorkspace: false,
sshCommand: undefined as string | undefined,
handleViewWorkspace: fn(),
handleCommit: fn(),
handleInterrupt: fn(),
handleDeleteQueuedMessage: fn(),
Expand Down Expand Up @@ -366,9 +364,7 @@ export const NoModelOptions: Story = {

/** Top bar has workspace action buttons visible. */
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
export const WithWorkspaceActions: Story = {
render: () => (
<StoryAgentChatPageView canOpenWorkspace sshCommand="ssh coder.workspace" />
),
render: () => <StoryAgentChatPageView sshCommand="ssh coder.workspace" />,
};

// ---------------------------------------------------------------------------
Expand Down
20 changes: 1 addition & 19 deletions site/src/pages/AgentsPage/AgentChatPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ interface AgentChatPageViewProps {
};

// Workspace action handlers.
canOpenWorkspace: boolean;
sshCommand: string | undefined;
handleViewWorkspace: () => void;
handleCommit: (repoRoot: string) => void;

// Chat action handlers.
Expand Down Expand Up @@ -203,9 +201,7 @@ export const AgentChatPageView: FC<AgentChatPageViewProps> = ({
prNumber,
diffStatusData,
gitWatcher,
canOpenWorkspace,
sshCommand,
handleViewWorkspace,
handleCommit,
handleInterrupt,
handleDeleteQueuedMessage,
Expand Down Expand Up @@ -351,11 +347,6 @@ export const AgentChatPageView: FC<AgentChatPageViewProps> = ({
showSidebarPanel,
onToggleSidebar: () => onSetShowSidebarPanel((prev) => !prev),
}}
workspace={{
canOpenWorkspace,
onViewWorkspace: handleViewWorkspace,
sshCommand,
}}
onArchiveAgent={handleArchiveAgentAction}
onUnarchiveAgent={handleUnarchiveAgentAction}
onArchiveAndDeleteWorkspace={
Expand Down Expand Up @@ -448,6 +439,7 @@ export const AgentChatPageView: FC<AgentChatPageViewProps> = ({
workspace={workspace}
workspaceAgent={workspaceAgent}
chatId={agentId}
sshCommand={sshCommand}
attachedWorkspace={attachedWorkspace}
/>
</div>
Expand Down Expand Up @@ -562,11 +554,6 @@ export const AgentChatPageLoadingView: FC<AgentChatPageLoadingViewProps> = ({
showSidebarPanel: false,
onToggleSidebar: () => {},
}}
workspace={{
canOpenWorkspace: false,
onViewWorkspace: () => {},
sshCommand: undefined,
}}
onArchiveAgent={() => {}}
onUnarchiveAgent={() => {}}
onRegenerateTitle={() => {}}
Expand Down Expand Up @@ -637,11 +624,6 @@ export const AgentChatPageNotFoundView: FC<AgentChatPageNotFoundViewProps> = ({
showSidebarPanel: false,
onToggleSidebar: () => {},
}}
workspace={{
canOpenWorkspace: false,
onViewWorkspace: () => {},
sshCommand: undefined,
}}
onArchiveAgent={() => {}}
onUnarchiveAgent={() => {}}
onRegenerateTitle={() => {}}
Expand Down
5 changes: 4 additions & 1 deletion site/src/pages/AgentsPage/components/AgentChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ interface AgentChatInputProps {
workspace?: TypesGen.Workspace;
workspaceAgent?: TypesGen.WorkspaceAgent;
chatId?: string;
sshCommand?: string;
attachedWorkspace?: AttachedWorkspaceInfo;
}

Expand Down Expand Up @@ -292,6 +293,7 @@ export const AgentChatInput: FC<AgentChatInputProps> = ({
workspace,
workspaceAgent,
chatId,
sshCommand,
attachedWorkspace,
}) => {
const [chatFullWidth] = useChatFullWidth();
Expand Down Expand Up @@ -937,8 +939,9 @@ export const AgentChatInput: FC<AgentChatInputProps> = ({
workspace={workspace}
agent={workspaceAgent}
chatId={chatId}
sshCommand={sshCommand}
/>
)}
)}{" "}
{allBadges.map((badge, i) => {
const isOverflow = overflowCount > 0 && i >= visibleCount;
return (
Expand Down
3 changes: 3 additions & 0 deletions site/src/pages/AgentsPage/components/ChatPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ interface ChatPageInputProps {
workspace?: TypesGen.Workspace;
workspaceAgent?: TypesGen.WorkspaceAgent;
chatId?: string;
sshCommand?: string;
attachedWorkspace?: AttachedWorkspaceInfo;
}

Expand Down Expand Up @@ -228,6 +229,7 @@ export const ChatPageInput: FC<ChatPageInputProps> = ({
workspace,
workspaceAgent,
chatId,
sshCommand,
attachedWorkspace,
}) => {
const messagesByID = useChatSelector(store, selectMessagesByID);
Expand Down Expand Up @@ -405,6 +407,7 @@ export const ChatPageInput: FC<ChatPageInputProps> = ({
workspace={workspace}
workspaceAgent={workspaceAgent}
chatId={chatId}
sshCommand={sshCommand}
attachedWorkspace={attachedWorkspace}
/>
);
Expand Down
5 changes: 0 additions & 5 deletions site/src/pages/AgentsPage/components/ChatTopBar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ const defaultProps = {
showSidebarPanel: false,
onToggleSidebar: fn(),
},
workspace: {
canOpenWorkspace: true,
onViewWorkspace: fn(),
sshCommand: "ssh main.my-workspace.admin.coder",
},
onArchiveAgent: fn(),
onArchiveAndDeleteWorkspace: fn(),
onRegenerateTitle: fn(),
Expand Down
35 changes: 0 additions & 35 deletions site/src/pages/AgentsPage/components/ChatTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {
ArchiveRestoreIcon,
ArrowLeftIcon,
ChevronRightIcon,
CopyIcon,
EllipsisIcon,
MonitorIcon,
PanelLeftIcon,
PanelRightCloseIcon,
PanelRightOpenIcon,
Expand All @@ -14,7 +12,6 @@ import {
} from "lucide-react";
import type { FC } from "react";
import { Link } from "react-router";
import { toast } from "sonner";
import type * as TypesGen from "#/api/typesGenerated";
import type { ChatDiffStatus } from "#/api/typesGenerated";
import { Button } from "#/components/Button/Button";
Expand All @@ -36,17 +33,10 @@ interface SidebarPanelState {
onToggleSidebar: () => void;
}

interface WorkspaceActions {
canOpenWorkspace: boolean;
onViewWorkspace: () => void;
sshCommand: string | undefined;
}

type ChatTopBarProps = {
chatTitle?: string;
parentChat?: TypesGen.Chat;
panel: SidebarPanelState;
workspace: WorkspaceActions;
onArchiveAgent: () => void;
onUnarchiveAgent: () => void;
onArchiveAndDeleteWorkspace: () => void;
Expand All @@ -64,7 +54,6 @@ export const ChatTopBar: FC<ChatTopBarProps> = ({
chatTitle,
parentChat,
panel,
workspace,
onArchiveAgent,
onUnarchiveAgent,
onArchiveAndDeleteWorkspace,
Expand Down Expand Up @@ -201,30 +190,6 @@ export const ChatTopBar: FC<ChatTopBarProps> = ({
align="end"
className="[&_[role=menuitem]]:text-[13px]"
>
<DropdownMenuItem
disabled={!workspace.sshCommand}
onSelect={async () => {
if (!workspace.sshCommand) return;
try {
await navigator.clipboard.writeText(workspace.sshCommand);
toast.success("SSH command copied to clipboard");
} catch {
toast.error("Failed to copy SSH command");
}
}}
>
<CopyIcon className="h-3.5 w-3.5" />
Copy SSH Command
</DropdownMenuItem>
<DropdownMenuSeparator />

<DropdownMenuItem
disabled={!workspace.canOpenWorkspace}
onSelect={workspace.onViewWorkspace}
>
<MonitorIcon className="h-3.5 w-3.5" />
View Workspace
</DropdownMenuItem>
{!isArchived && (
<>
<DropdownMenuSeparator />
Expand Down
67 changes: 40 additions & 27 deletions site/src/pages/AgentsPage/components/WorkspacePill.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ChevronDownIcon,
CopyIcon,
ExternalLinkIcon,
LayoutGridIcon,
MonitorDotIcon,
Expand Down Expand Up @@ -50,14 +51,14 @@ interface WorkspacePillProps {
workspace: Workspace;
agent: WorkspaceAgent;
chatId: string;
className?: string;
sshCommand?: string;
}

export const WorkspacePill: FC<WorkspacePillProps> = ({
workspace,
agent,
chatId,
className,
sshCommand,
}) => {
const [open, setOpen] = useState(false);
const route = `/@${workspace.owner_name}/${workspace.name}`;
Expand All @@ -81,11 +82,6 @@ export const WorkspacePill: FC<WorkspacePillProps> = ({
};
const statusIcon = statusIconMap[effectiveType];

const badgeCls = cn(
"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",
className,
);

const builtinApps = new Set(agent.display_apps);
const hasVSCode = builtinApps.has("vscode");
const hasVSCodeInsiders = builtinApps.has("vscode_insiders");
Expand All @@ -99,28 +95,13 @@ export const WorkspacePill: FC<WorkspacePillProps> = ({
const hasApps =
hasVSCode || hasVSCodeInsiders || hasTerminal || externalApps.length > 0;

if (!hasApps) {
return (
<Tooltip>
<TooltipTrigger asChild>
<Link
to={route}
target="_blank"
rel="noreferrer"
className={cn(
badgeCls,
"no-underline transition-colors hover:bg-surface-tertiary hover:text-content-primary",
)}
>
{statusIcon}
{workspace.name}
</Link>
</TooltipTrigger>
<TooltipContent>{statusLabel}</TooltipContent>
</Tooltip>
);
if (!hasApps && !sshCommand) {
return null;
}

const badgeCls =
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
"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";

return (
<Popover open={open} onOpenChange={setOpen}>
<Tooltip>
Expand Down Expand Up @@ -183,6 +164,12 @@ export const WorkspacePill: FC<WorkspacePillProps> = ({
onDone={() => setOpen(false)}
/>
)}
{sshCommand && (
<CopySSHMenuItem
sshCommand={sshCommand}
onDone={() => setOpen(false)}
/>
)}
<div className="my-1 h-px bg-border-default" />
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
<Link
to={route}
Expand Down Expand Up @@ -290,3 +277,29 @@ const TerminalMenuItem: FC<{
</button>
);
};

const CopySSHMenuItem: FC<{
sshCommand: string;
onDone: () => void;
}> = ({ sshCommand, onDone }) => {
const handleCopySSH = async () => {
try {
await navigator.clipboard.writeText(sshCommand);
Comment thread
DanielleMaywood marked this conversation as resolved.
Outdated
toast.success("SSH command copied to clipboard");
} catch {
toast.error("Failed to copy SSH command");
}
onDone();
};

return (
<button
type="button"
className={menuItemCls}
onClick={() => void handleCopySSH()}
>
<CopyIcon className="size-3.5" />
Copy SSH Command
</button>
);
};