Skip to content

feat: group external apps on task page #18107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Test and check external apps
  • Loading branch information
BrunoQuaresma committed May 29, 2025
commit 50724f47714bc4cc75e631f763d4b6b1b0b9957a
8 changes: 7 additions & 1 deletion site/src/pages/TaskPage/TaskPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,15 @@ export const Active: Story = {
{
...MockWorkspaceApp,
id: "vscode",
display_name: "VSCode",
display_name: "VS Code Web",
icon: "/icon/code.svg",
},
{
...MockWorkspaceApp,
id: "zed",
display_name: "Zed",
icon: "/icon/zed.svg",
},
],
},
],
Expand Down
73 changes: 39 additions & 34 deletions site/src/pages/TaskPage/TaskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,13 @@ const TaskApps: FC<TaskAppsProps> = ({ task }) => {
return src;
});

const emmbedApps = apps.filter((app) => !app.external);
const externalApps = apps.filter((app) => app.external);

return (
<main className="flex-1 flex flex-col">
<div className="border-0 border-b border-border border-solid w-full p-1 flex gap-2">
{apps
{emmbedApps
.filter((app) => !app.external)
.map((app) => (
<TaskAppButton
Expand All @@ -338,39 +341,41 @@ const TaskApps: FC<TaskAppsProps> = ({ task }) => {
/>
))}

<div className="ml-auto">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="sm" variant="subtle">
Open in IDE
<ChevronDownIcon />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
{apps
.filter((app) => app.external)
.map((app) => {
const link = useAppLink(app, {
agent,
workspace: task.workspace,
});

return (
<DropdownMenuItem key={app.id} asChild>
<RouterLink to={link.href}>
{app.icon ? (
<ExternalImage src={app.icon} />
) : (
<LayoutGridIcon />
)}
{link.label}
</RouterLink>
</DropdownMenuItem>
);
})}
</DropdownMenuContent>
</DropdownMenu>
</div>
{externalApps.length > 0 && (
<div className="ml-auto">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="sm" variant="subtle">
Open in IDE
<ChevronDownIcon />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
{externalApps
.filter((app) => app.external)
.map((app) => {
const link = useAppLink(app, {
agent,
workspace: task.workspace,
});

return (
<DropdownMenuItem key={app.id} asChild>
<RouterLink to={link.href}>
{app.icon ? (
<ExternalImage src={app.icon} />
) : (
<LayoutGridIcon />
)}
{link.label}
</RouterLink>
</DropdownMenuItem>
);
})}
</DropdownMenuContent>
</DropdownMenu>
</div>
)}
</div>

<div className="flex-1">
Expand Down