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

Commit61f2b04

Browse files
authored
fix: embed agentapi chat in the sidebar iframe (#18230)
- hardcode a custom pathname (`/chat/embed`) to use in the sidebariframe. this is a temporary fix so that the agentapi chat displaysproperly- make the sidebar a bit wider so that the chat fits without linewrapping<img width="1512" alt="Screenshot 2025-06-04 at 15 32 30"src="https://github.com/user-attachments/assets/8be5d053-d7b3-40da-8b62-a6151975527d"/>
1 parent5f7e5d7 commit61f2b04

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

‎site/src/pages/TaskPage/TaskAppIframe.tsx

Lines changed: 14 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
exportconstTaskAppIFrame:FC<TaskAppIFrameProps>=({
1415
task,
1516
app,
1617
active,
18+
pathname,
1719
})=>{
1820
constagent=task.workspace.latest_build.resources
1921
.flatMap((r)=>r.agents)
@@ -29,9 +31,20 @@ export const TaskAppIFrame: FC<TaskAppIFrameProps> = ({
2931
workspace:task.workspace,
3032
});
3133

34+
lethref=link.href;
35+
try{
36+
consturl=newURL(link.href);
37+
if(pathname){
38+
url.pathname=pathname;
39+
}
40+
href=url.toString();
41+
}catch(err){
42+
console.warn(`Failed to parse URL${link.href} for app${app.id}`,err);
43+
}
44+
3245
return(
3346
<iframe
34-
src={link.href}
47+
src={href}
3548
title={link.label}
3649
loading="eager"
3750
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
typeTaskSidebarProps={
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
<headerclassName="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-
<TaskAppIFrameactivekey={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
<TaskStatusestask={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
exportconstAI_APP_CHAT_SLUG="claude-code-web";
2+
exportconstAI_APP_CHAT_URL_PATHNAME="/chat/embed";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp