fix: Ensure shared file previews use truncated content (#607)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Prashant Choudhary
2025-07-02 12:04:10 -04:00
committed by GitHub
co-authored by google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
parent 8f4b79227c
commit 2799a96032
+4 -2
View File
@@ -1346,7 +1346,8 @@ export default function Share(props: {
</ErrorPart> </ErrorPart>
</div> </div>
</Match> </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> <div data-part-tool-result>
<ResultsButton <ResultsButton
showCopy="Show preview" showCopy="Show preview"
@@ -1366,7 +1367,8 @@ export default function Share(props: {
</Show> </Show>
</div> </div>
</Match> </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> <div data-part-tool-result>
<ResultsButton <ResultsButton
results={showResults()} results={showResults()}