Skip to content

Commit 2bf5913

Browse files
committed
task sidebar iframe: make it wider and add custom pathname
1 parent 4d0fe20 commit 2bf5913

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

site/src/pages/TaskPage/TaskAppIframe.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ type TaskAppIFrameProps = {
88
task: Task;
99
app: WorkspaceApp;
1010
active: boolean;
11+
pathname?: string;
1112
};
1213

1314
export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
1415
task,
1516
app,
1617
active,
18+
pathname,
1719
}) => {
1820
const agent = task.workspace.latest_build.resources
1921
.flatMap((r) => r.agents)
@@ -29,9 +31,14 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
2931
workspace: task.workspace,
3032
});
3133

34+
const url = new URL(link.href);
35+
if (pathname) {
36+
url.pathname = pathname;
37+
}
38+
3239
return (
3340
<iframe
34-
src={link.href}
41+
src={url.toString()}
3542
title={link.label}
3643
loading="eager"
3744
className={cn([active ? "block" : "hidden", "w-full h-full border-0"])}

site/src/pages/TaskPage/TaskSidebar.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { cn } from "utils/cn";
2929
import { timeFrom } from "utils/time";
3030
import { truncateURI } from "utils/uri";
3131
import { TaskAppIFrame } from "./TaskAppIframe";
32-
import { AI_APP_CHAT_SLUG } from "./constants";
32+
import { AI_APP_CHAT_SLUG, AI_APP_CHAT_URL_PATHNAME } from "./constants";
3333

3434
type TaskSidebarProps = {
3535
task: Task;
@@ -49,7 +49,7 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
4949
"border-0 border-r border-solid border-border",
5050
],
5151
// We want to make the sidebar wider for chat apps
52-
chatApp ? "w-[440px]" : "w-[320px]",
52+
chatApp ? "w-[520px]" : "w-[320px]",
5353
])}
5454
>
5555
<header className="border-0 border-b border-solid border-border p-4 pt-0">
@@ -105,7 +105,13 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
105105
</header>
106106

107107
{chatApp ? (
108-
<TaskAppIFrame active key={chatApp.id} app={chatApp} task={task} />
108+
<TaskAppIFrame
109+
active
110+
key={chatApp.id}
111+
app={chatApp}
112+
task={task}
113+
pathname={AI_APP_CHAT_URL_PATHNAME}
114+
/>
109115
) : (
110116
<TaskStatuses task={task} />
111117
)}

site/src/pages/TaskPage/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export const AI_APP_CHAT_SLUG = "claude-code-web";
2+
export const AI_APP_CHAT_URL_PATHNAME = "/chat/embed";

0 commit comments

Comments
 (0)