diff options
| author | Prashant Choudhary <[email protected]> | 2025-07-02 21:34:10 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-02 12:04:10 -0400 |
| commit | 2799a96032062584f238d73185e2c6ba7c8d55cf (patch) | |
| tree | 71fa3dcac34a4893d9fc5bf70f56300385d2d275 /packages | |
| parent | 8f4b79227c2fa4db01cc3cf1df2bbfed66695a5f (diff) | |
| download | opencode-2799a96032062584f238d73185e2c6ba7c8d55cf.tar.gz opencode-2799a96032062584f238d73185e2c6ba7c8d55cf.zip | |
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>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/web/src/components/Share.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx index 93aad6e61..fd828629e 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> <ResultsButton showCopy="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> <ResultsButton results={showResults()} |
