The open source coding agent.
TypeScript
fix: Ensure shared file previews use truncated content (#607)
Prashant Choudhary2799a9603206
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsxindex 93aad6e6168..fd828629e79 100644--- a/packages/web/src/components/Share.tsx+++ b/packages/web/src/components/Share.tsx@@ -1346,7 +1346,8 @@ export default function Share(props: {</ErrorPart></div></Match>- <Match when={preview()}>+ {/* Always try to show CodeBlock if preview is available (even if empty string) */}+ <Match when={typeof preview() === 'string'}><div data-part-tool-result><ResultsButtonshowCopy="Show preview"@@ -1366,7 +1367,8 @@ export default function Share(props: {</Show></div></Match>- <Match when={toolData()?.result}>+ {/* Fallback to TextPart if preview is not a string (e.g. undefined) AND result exists */}+ <Match when={typeof preview() !== 'string' && toolData()?.result}><div data-part-tool-result><ResultsButtonresults={showResults()}