From 926d6652796e6cecb4ff7d7ed91ba3b21a2297f7 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 26 Jan 2026 10:07:10 -0800 Subject: [PATCH 1/2] fix(docs): separate local and blob asset resolution for quick-reference ActionImage now uses local paths directly for PNGs while ActionVideo uses blob storage with proper path normalization (strips static/ prefix). Co-Authored-By: Claude Opus 4.5 --- apps/docs/components/ui/action-media.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/docs/components/ui/action-media.tsx b/apps/docs/components/ui/action-media.tsx index 13c9063687..1c018757db 100644 --- a/apps/docs/components/ui/action-media.tsx +++ b/apps/docs/components/ui/action-media.tsx @@ -12,8 +12,19 @@ interface ActionVideoProps { alt: string } +/** + * Normalize path for blob storage + * - Strips leading slash + * - Strips 'static/' prefix + */ +function normalizeBlobPath(src: string): string { + let path = src.startsWith('/') ? src.slice(1) : src + path = path.replace(/^static\//, '') + return path +} + export function ActionImage({ src, alt }: ActionImageProps) { - const resolvedSrc = getAssetUrl(src.startsWith('/') ? src.slice(1) : src) + const resolvedSrc = src.startsWith('/') ? src : `/${src}` return ( Date: Mon, 26 Jan 2026 10:11:32 -0800 Subject: [PATCH 2/2] refactor(docs): simplify asset resolution by using correct paths directly Remove path normalization logic from action-media component. Instead, use the appropriate paths in MDX: - PNGs: /static/quick-reference/... (local) - MP4s: quick-reference/... (blob via getAssetUrl) --- apps/docs/components/ui/action-media.tsx | 17 +-------- .../content/docs/en/quick-reference/index.mdx | 38 +++++++++---------- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/apps/docs/components/ui/action-media.tsx b/apps/docs/components/ui/action-media.tsx index 1c018757db..1f187fb906 100644 --- a/apps/docs/components/ui/action-media.tsx +++ b/apps/docs/components/ui/action-media.tsx @@ -12,23 +12,10 @@ interface ActionVideoProps { alt: string } -/** - * Normalize path for blob storage - * - Strips leading slash - * - Strips 'static/' prefix - */ -function normalizeBlobPath(src: string): string { - let path = src.startsWith('/') ? src.slice(1) : src - path = path.replace(/^static\//, '') - return path -} - export function ActionImage({ src, alt }: ActionImageProps) { - const resolvedSrc = src.startsWith('/') ? src : `/${src}` - return ( {alt} @@ -36,7 +23,7 @@ export function ActionImage({ src, alt }: ActionImageProps) { } export function ActionVideo({ src, alt }: ActionVideoProps) { - const resolvedSrc = getAssetUrl(normalizeBlobPath(src)) + const resolvedSrc = getAssetUrl(src) return (