From 3e4871c3d9b138495b1491000287c59c281cc665 Mon Sep 17 00:00:00 2001 From: pngwn Date: Thu, 8 Jun 2023 21:24:13 +0900 Subject: [PATCH] UI fix (#4447) * revert correct empty sizes for components * tweak * changelog * fix empty icon alignment with custom height * fixes * revert demo * more tweaks * remove logs * format --- CHANGELOG.md | 1 + .../AnnotatedImage/AnnotatedImage.svelte | 2 +- js/app/src/components/Label/Label.svelte | 3 +- js/app/src/components/Model3D/Model3D.svelte | 2 +- .../components/TimeSeries/TimeSeries.svelte | 2 +- js/atoms/src/Empty.svelte | 42 ++++++++++++++++++- js/audio/src/StaticAudio.svelte | 2 +- js/code/Index.svelte | 2 +- js/file/src/File.svelte | 2 +- js/gallery/src/Gallery.svelte | 2 +- js/image/src/StaticImage.svelte | 2 +- js/label/src/Label.svelte | 5 ++- js/plot/src/Plot.svelte | 2 +- js/video/src/StaticVideo.svelte | 2 +- 14 files changed, 57 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e531449bb6..1b5f74cb38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ## Bug Fixes: +- Ensure components have the correct empty sizes to prevent empty containers from collapsing by [@pngwn](https://github.com/pngwn) in [PR 4447](https://github.com/gradio-app/gradio/pull/4447). - Frontend code no longer crashes when there is a relative URL in an `` element, by [@akx](https://github.com/akx) in [PR 4449](https://github.com/gradio-app/gradio/pull/4449). ## Other Changes: diff --git a/js/app/src/components/AnnotatedImage/AnnotatedImage.svelte b/js/app/src/components/AnnotatedImage/AnnotatedImage.svelte index 2accf0e0f7..6f77a2f795 100644 --- a/js/app/src/components/AnnotatedImage/AnnotatedImage.svelte +++ b/js/app/src/components/AnnotatedImage/AnnotatedImage.svelte @@ -74,7 +74,7 @@
{#if _value == null} - + {:else}
diff --git a/js/app/src/components/Label/Label.svelte b/js/app/src/components/Label/Label.svelte index eb7ad7862b..cd83157773 100644 --- a/js/app/src/components/Label/Label.svelte +++ b/js/app/src/components/Label/Label.svelte @@ -36,6 +36,7 @@ {container} {scale} {min_width} + padding={false} > {#if show_label} @@ -44,6 +45,6 @@ {#if _label !== undefined && _label !== null}
+
@@ -13,6 +34,7 @@ display: flex; justify-content: center; align-items: center; + margin-top: calc(0px - var(--size-6)); height: var(--size-full); } @@ -22,11 +44,27 @@ color: var(--body-text-color); } - .unpadded_box.small { + .small { + min-height: calc(var(--size-32) - 20px); + } + + .large { + min-height: calc(var(--size-64) - 20px); + } + + .unpadded_box { + margin-top: 0; + } + + /* .unpadded_box.small { min-height: var(--size-32); } .unpadded_box.large { min-height: var(--size-64); + } */ + + .small_parent { + min-height: 100% !important; } diff --git a/js/audio/src/StaticAudio.svelte b/js/audio/src/StaticAudio.svelte index 2fd5c1870b..daf9e9e12e 100644 --- a/js/audio/src/StaticAudio.svelte +++ b/js/audio/src/StaticAudio.svelte @@ -40,7 +40,7 @@ {#if value === null} - + {:else} diff --git a/js/code/Index.svelte b/js/code/Index.svelte index 3f975beb64..641739722e 100644 --- a/js/code/Index.svelte +++ b/js/code/Index.svelte @@ -50,7 +50,7 @@ {#if !value} - + {:else} diff --git a/js/file/src/File.svelte b/js/file/src/File.svelte index 5120a5e545..3f62ee5876 100644 --- a/js/file/src/File.svelte +++ b/js/file/src/File.svelte @@ -20,5 +20,5 @@ {#if value} {:else} - + {/if} diff --git a/js/gallery/src/Gallery.svelte b/js/gallery/src/Gallery.svelte index 4941d1f974..edf486f039 100644 --- a/js/gallery/src/Gallery.svelte +++ b/js/gallery/src/Gallery.svelte @@ -173,7 +173,7 @@ /> {/if} {#if value === null || _value === null || _value.length === 0} - + {:else} {#if selected_image !== null}
{#if value === null} - + {:else}