diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index a196ff2941..b90216aa14 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -4,7 +4,15 @@ import TableCustom from './TableCustom.svelte' import { copyToClipboard, roughSizeOfObject, truncate } from '$lib/utils' import { Button, Drawer, DrawerContent } from './common' - import { ClipboardCopy, Download, Expand, PanelRightOpen, Table2 } from 'lucide-svelte' + import { + ClipboardCopy, + Download, + Expand, + PanelRightOpen, + Table2, + Braces, + Highlighter + } from 'lucide-svelte' import Portal from 'svelte-portal' import ObjectViewer from './propertyPicker/ObjectViewer.svelte' import S3FilePicker from './S3FilePicker.svelte' @@ -15,7 +23,8 @@ import FileDownload from './common/fileDownload/FileDownload.svelte' import ParqetTableRenderer from './ParqetTableRenderer.svelte' - import { twMerge } from 'tailwind-merge' + import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte' + import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte' export let result: any export let requireHtmlApproval = false @@ -241,40 +250,48 @@ {:else}
{#if result != undefined && length != undefined && largeObject != undefined} - {#if resultKind && !['json', 's3object', 's3object-list'].includes(resultKind) && !hideAsJson} -
- as JSON 
-
{/if}{#if result && typeof result == 'object' && Object.keys(result).length > 0}
{#if !disableExpand} -
- - - {#if isTableDisplay} - +
+
+ {#if (resultKind && !['json', 's3object', 's3object-list'].includes(resultKind) && !hideAsJson) || isTableDisplay} + { + if (isTableDisplay) { + richRender = ev.detail === 'table' + } else { + forceJson = ev.detail === 'json' + } + }} + > + {#if resultKind && !['json', 's3object', 's3object-list'].includes(resultKind) && !hideAsJson} + {/if} -
- {/if}
{/if}{#if !forceJson && resultKind == 'table-col'} + {#if isTableDisplay} + + {/if} + + + {/if} +
+
+ + {#if !disableExpand} + + + {/if} +
+
+ + {#if !forceJson && resultKind == 'table-col'} {@const data = 'table-col' in result ? result['table-col'] : result} {:else if !forceJson && resultKind == 'table-row'} @@ -393,8 +410,7 @@
{:else if !forceJson && resultKind == 's3object'}
@@ -434,7 +450,7 @@ {/if}
{:else if !forceJson && resultKind == 's3object-list'} -
+
{:else} diff --git a/frontend/src/lib/components/ModulePreview.svelte b/frontend/src/lib/components/ModulePreview.svelte index f09407e93b..776c5d34a9 100644 --- a/frontend/src/lib/components/ModulePreview.svelte +++ b/frontend/src/lib/components/ModulePreview.svelte @@ -135,11 +135,12 @@ {#if testJob != undefined && 'result' in testJob && testJob.result != undefined} -

+						
+							result={testJob.result}
+						>
 							
 								{#if lang && editor && diffEditor && stepArgs && testJob?.result?.error}
 									
 						
-					
+
{:else}
{#if testIsLoading} diff --git a/frontend/src/lib/components/copilot/ScriptFix.svelte b/frontend/src/lib/components/copilot/ScriptFix.svelte index 8dc49f4a14..effc4306c5 100644 --- a/frontend/src/lib/components/copilot/ScriptFix.svelte +++ b/frontend/src/lib/components/copilot/ScriptFix.svelte @@ -117,7 +117,7 @@ {#if SUPPORTED_LANGUAGES.has(lang)} -
+
{#if !genLoading && $generatedCode.length > 0}