Skip to content
Merged
Changes from all 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
7 changes: 5 additions & 2 deletions ui/desktop/src/components/McpApps/McpAppRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function McpAppRenderer({
});
const [error, setError] = useState<string | null>(null);
const [iframeHeight, setIframeHeight] = useState(DEFAULT_IFRAME_HEIGHT);
const [iframeWidth, setIframeWidth] = useState<number | null>(null);

useEffect(() => {
if (!sessionId) {
Expand Down Expand Up @@ -199,9 +200,10 @@ export default function McpAppRenderer({
[append, sessionId, extensionName]
);

const handleSizeChanged = useCallback((height: number, _width?: number) => {
const handleSizeChanged = useCallback((height: number, width?: number) => {
const newHeight = Math.max(DEFAULT_IFRAME_HEIGHT, height);
setIframeHeight(newHeight);
setIframeWidth(width ?? null);
}, []);

const { iframeRef, proxyUrl } = useSandboxBridge({
Expand Down Expand Up @@ -263,7 +265,8 @@ export default function McpAppRenderer({
ref={iframeRef}
src={proxyUrl}
style={{
width: '100%',
width: iframeWidth ? `${iframeWidth}px` : '100%',
Comment thread
Abhijay007 marked this conversation as resolved.
maxWidth: '100%',
height: `${iframeHeight}px`,
border: 'none',
overflow: 'hidden',
Expand Down
Loading