Skip to content

Commit e43342e

Browse files
lilyshen0722claude
andcommitted
fix(v2-inspector): use API base URL for PPTX preview fetch
PptxPreview was calling `/api/uploads/.../preview-pptx-html` as a relative URL — that hits the SPA host (app-dev.commonly.me), which returns the index.html shell for any unknown path. The iframe srcdoc got 830 bytes of HTML stub instead of the 17KB OfficeCli render, and the inspector showed a black box. Prepend `getApiBaseUrl()` (already used by signedAttachmentUrl helper and the api hook) so the fetch hits the actual backend host. Verified end-to-end: backend route returns 200 + 17.7KB text/html with embedded slide canvas; the only thing missing was the host. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 309dec3 commit e43342e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎frontend/src/v2/components/V2PodInspector.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { UseV2PodsResult } from '../hooks/useV2Pods';
88
import { useV2Api } from '../hooks/useV2Api';
99
import { useAuth } from '../../context/AuthContext';
1010
import { getSignedAttachmentUrl } from '../../utils/signedAttachmentUrl';
11+
import getApiBaseUrl from '../../utils/apiBaseUrl';
1112
import type { InspectorView } from './V2Layout';
1213

1314
interface V2PodInspectorProps {
@@ -612,7 +613,7 @@ const PptxPreview: React.FC<{ artifact: PreviewArtifact }> = ({ artifact }) => {
612613
setBusy(true); setError(null); setHtml(null);
613614
(async () => {
614615
try {
615-
const r = await fetch(`/api/uploads/${encodeURIComponent(artifact.fileName!)}/preview-pptx-html`);
616+
const r = await fetch(`${getApiBaseUrl()}/api/uploads/${encodeURIComponent(artifact.fileName!)}/preview-pptx-html`);
616617
if (cancelled) return;
617618
if (!r.ok) {
618619
// Surface a useful error from the JSON body if available

0 commit comments

Comments
 (0)