From b07e5095e950be18bafc69103d8c98dd1b5d392c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 28 Apr 2023 11:13:40 +0100 Subject: [PATCH] Increase support for lower resolutions in the grid UI by using tooltips instead of text for some buttons at low horizontal breakpoints --- .../buttons/ExistingRelationshipButton.svelte | 2 +- .../components/grid/controls/ColumnWidthButton.svelte | 7 ++++--- .../components/grid/controls/HideColumnsButton.svelte | 7 ++++--- .../components/grid/controls/RowHeightButton.svelte | 7 ++++--- .../src/components/grid/controls/SortButton.svelte | 7 ++++--- .../src/components/grid/layout/Grid.svelte | 5 +++-- .../frontend-core/src/components/grid/stores/ui.js | 10 ++++++++++ 7 files changed, 30 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte index 3d837a54f0..0f4bafb001 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte @@ -39,7 +39,7 @@ {#if datasource}
- Define existing relationship + Define relationship
diff --git a/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte index 754aebbb51..5ffd968d30 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte @@ -3,7 +3,7 @@ import { ActionButton, Popover } from "@budibase/bbui" import { DefaultColumnWidth } from "../lib/constants" - const { stickyColumn, columns } = getContext("grid") + const { stickyColumn, columns, compact } = getContext("grid") const smallSize = 120 const mediumSize = DefaultColumnWidth const largeSize = DefaultColumnWidth * 1.5 @@ -59,12 +59,13 @@ on:click={() => (open = !open)} selected={open} disabled={!allCols.length} + tooltip={$compact ? "Width" : null} > - Width + {$compact ? "" : "Width"} - +
{#each sizeOptions as option} (open = !open)} selected={open || anyHidden} disabled={!$columns.length} + tooltip={$compact ? "Columns" : ""} > - Columns + {$compact ? "" : "Columns"}
- +
{#if $stickyColumn} diff --git a/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte b/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte index e9045ac5c7..e9617ce0b6 100644 --- a/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte @@ -7,7 +7,7 @@ SmallRowHeight, } from "../lib/constants" - const { rowHeight, columns, table } = getContext("grid") + const { rowHeight, columns, table, compact } = getContext("grid") const sizeOptions = [ { label: "Small", @@ -41,12 +41,13 @@ size="M" on:click={() => (open = !open)} selected={open} + tooltip={$compact ? "Height" : null} > - Height + {$compact ? "" : "Height"}
- +
{#each sizeOptions as option} (open = !open)} selected={open} disabled={!columnOptions.length} + tooltip={$compact ? "Sort" : ""} > - Sort + {$compact ? "" : "Sort"}
- +