From cb2cef48ffaf56a7daffd72d4801346928dd6210 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Wed, 13 Aug 2025 18:19:32 +0100 Subject: [PATCH] fix(frontend): fix minor issues in the UI (#6382) * fix flow result overflow * fix resource type misalignment and icon sizes * Do not display resource type description if empty * Display flow yaml editor full height * fix detail page overflow * nit --- .../src/lib/components/DisplayResult.svelte | 15 +++-- .../src/lib/components/FlowJobResult.svelte | 2 +- .../lib/components/IconedResourceType.svelte | 6 +- .../src/lib/components/ResourceEditor.svelte | 13 ++-- .../src/lib/components/SimpleEditor.svelte | 6 +- .../details/DetailPageLayout.svelte | 67 ++++++++++--------- .../flows/header/FlowYamlEditor.svelte | 12 +++- .../(root)/(logged)/resources/+page.svelte | 8 ++- 8 files changed, 77 insertions(+), 52 deletions(-) diff --git a/frontend/src/lib/components/DisplayResult.svelte b/frontend/src/lib/components/DisplayResult.svelte index fbb5641b95..d6dfdbfa8b 100644 --- a/frontend/src/lib/components/DisplayResult.svelte +++ b/frontend/src/lib/components/DisplayResult.svelte @@ -40,6 +40,7 @@ import { toJsonStr } from '$lib/utils' import { userStore } from '$lib/stores' import ResultStreamDisplay from './ResultStreamDisplay.svelte' + import { twMerge } from 'tailwind-merge' const IMG_MAX_SIZE = 10000000 const TABLE_MAX_SIZE = 5000000 @@ -95,6 +96,7 @@ fixTableSizingToParent?: boolean copilot_fix?: import('svelte').Snippet children?: import('svelte').Snippet + growVertical?: boolean } let { @@ -118,7 +120,8 @@ fixTableSizingToParent = false, copilot_fix, children, - loading = false + loading = false, + growVertical = false }: Props = $props() let enableHtml = $state(false) let s3FileDisplayRawMode = $state(false) @@ -540,11 +543,11 @@
Non displayable object
{:else}
{#if result != undefined && length != undefined && largeObject != undefined}
diff --git a/frontend/src/lib/components/FlowJobResult.svelte b/frontend/src/lib/components/FlowJobResult.svelte index 22e12fe1bf..5a443b3dd4 100644 --- a/frontend/src/lib/components/FlowJobResult.svelte +++ b/frontend/src/lib/components/FlowJobResult.svelte @@ -108,7 +108,7 @@
Result {#if result !== undefined || result_stream !== undefined} - + {:else if loading} {:else} diff --git a/frontend/src/lib/components/IconedResourceType.svelte b/frontend/src/lib/components/IconedResourceType.svelte index 36e0c8ade0..9f7863a4d2 100644 --- a/frontend/src/lib/components/IconedResourceType.svelte +++ b/frontend/src/lib/components/IconedResourceType.svelte @@ -32,16 +32,18 @@ : APP_TO_ICON_COMPONENT[name] || APP_TO_ICON_COMPONENT[name.split('_')[0]] : undefined ) + + let widthInPixels = $derived(parseInt(width)) -
+
{#if !silent && !after} {name} {/if} {#if iconComponent} {@const SvelteComponent = iconComponent} - + {:else if formatExtension} diff --git a/frontend/src/lib/components/ResourceEditor.svelte b/frontend/src/lib/components/ResourceEditor.svelte index 2a7f56373d..51226d4958 100644 --- a/frontend/src/lib/components/ResourceEditor.svelte +++ b/frontend/src/lib/components/ResourceEditor.svelte @@ -21,6 +21,7 @@ import GfmMarkdown from './GfmMarkdown.svelte' import TestTriggerConnection from './triggers/TestTriggerConnection.svelte' import GitHubAppIntegration from './GitHubAppIntegration.svelte' + import Button from './common/button/Button.svelte' interface Props { canSave?: boolean @@ -223,10 +224,14 @@

Resource description {#if can_write} -
- - -
+

{#if can_write && editDescription} diff --git a/frontend/src/lib/components/SimpleEditor.svelte b/frontend/src/lib/components/SimpleEditor.svelte index e15bff18f2..a431a341ee 100644 --- a/frontend/src/lib/components/SimpleEditor.svelte +++ b/frontend/src/lib/components/SimpleEditor.svelte @@ -121,7 +121,8 @@ class: className = '', loadAsync = false, key, - disabled = false + disabled = false, + minHeight = 1000 }: { lang: string code?: string @@ -147,6 +148,7 @@ initialCursorPos?: IPosition key?: string disabled?: boolean + minHeight?: number } = $props() const dispatch = createEventDispatcher() @@ -435,7 +437,7 @@ if (autoHeight) { const updateHeight = () => { if (!editor) return - const contentHeight = Math.min(1000, editor.getContentHeight()) + const contentHeight = Math.min(minHeight, editor.getContentHeight()) if (divEl) { divEl.style.height = `${contentHeight}px` } diff --git a/frontend/src/lib/components/details/DetailPageLayout.svelte b/frontend/src/lib/components/details/DetailPageLayout.svelte index b3e987f69a..3ea1511086 100644 --- a/frontend/src/lib/components/details/DetailPageLayout.svelte +++ b/frontend/src/lib/components/details/DetailPageLayout.svelte @@ -1,6 +1,5 @@ @@ -71,7 +73,15 @@ {#await import('../../SimpleEditor.svelte')} {:then Module} - +
+ +
{/await} {/if} diff --git a/frontend/src/routes/(root)/(logged)/resources/+page.svelte b/frontend/src/routes/(root)/(logged)/resources/+page.svelte index 0c2e7bf1bd..252e401e83 100644 --- a/frontend/src/routes/(root)/(logged)/resources/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/resources/+page.svelte @@ -480,9 +480,11 @@ formatExtension={resourceTypeViewerObj.formatExtension} /> -
- -
+ {#if resourceTypeViewerObj.description} +
+ +
+ {/if} {#if resourceTypeViewerObj.formatExtension}