Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: embed agentapi chat in the sidebar iframe#18230

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugodutka merged 1 commit intomainfromhugodutka/task-sidebar-iframe-chat
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
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
15 changes: 14 additions & 1 deletionsite/src/pages/TaskPage/TaskAppIframe.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,12 +8,14 @@ type TaskAppIFrameProps = {
task: Task;
app: WorkspaceApp;
active: boolean;
pathname?: string;
};

export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
task,
app,
active,
pathname,
}) => {
const agent = task.workspace.latest_build.resources
.flatMap((r) => r.agents)
Expand All@@ -29,9 +31,20 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
workspace: task.workspace,
});

let href = link.href;
try {
const url = new URL(link.href);
if (pathname) {
url.pathname = pathname;
}
href = url.toString();
} catch (err) {
console.warn(`Failed to parse URL ${link.href} for app ${app.id}`, err);
}

return (
<iframe
src={link.href}
src={href}
title={link.label}
loading="eager"
className={cn([active ? "block" : "hidden", "w-full h-full border-0"])}
Expand Down
12 changes: 9 additions & 3 deletionssite/src/pages/TaskPage/TaskSidebar.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ import { cn } from "utils/cn";
import { timeFrom } from "utils/time";
import { truncateURI } from "utils/uri";
import { TaskAppIFrame } from "./TaskAppIframe";
import { AI_APP_CHAT_SLUG } from "./constants";
import { AI_APP_CHAT_SLUG, AI_APP_CHAT_URL_PATHNAME } from "./constants";

type TaskSidebarProps = {
task: Task;
Expand All@@ -49,7 +49,7 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
"border-0 border-r border-solid border-border",
],
// We want to make the sidebar wider for chat apps
chatApp ? "w-[440px]" : "w-[320px]",
chatApp ? "w-[520px]" : "w-[320px]",
])}
>
<header className="border-0 border-b border-solid border-border p-4 pt-0">
Expand DownExpand Up@@ -105,7 +105,13 @@ export const TaskSidebar: FC<TaskSidebarProps> = ({ task }) => {
</header>

{chatApp ? (
<TaskAppIFrame active key={chatApp.id} app={chatApp} task={task} />
<TaskAppIFrame
active
key={chatApp.id}
app={chatApp}
task={task}
pathname={AI_APP_CHAT_URL_PATHNAME}
/>
) : (
<TaskStatuses task={task} />
)}
Expand Down
1 change: 1 addition & 0 deletionssite/src/pages/TaskPage/constants.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
export const AI_APP_CHAT_SLUG = "claude-code-web";
export const AI_APP_CHAT_URL_PATHNAME = "/chat/embed";
Loading

[8]ページ先頭

©2009-2025 Movatter.jp