diff --git a/apps/desktop/src/components/diff/DataCompareDialog.vue b/apps/desktop/src/components/diff/DataCompareDialog.vue index 2b9f6ccc0..ab1e5c0f7 100644 --- a/apps/desktop/src/components/diff/DataCompareDialog.vue +++ b/apps/desktop/src/components/diff/DataCompareDialog.vue @@ -913,9 +913,9 @@ watch( content-class="w-[var(--reka-popover-trigger-width)]" > @@ -999,9 +999,9 @@ watch( content-class="w-[var(--reka-popover-trigger-width)]" > diff --git a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue index 8e53cc121..fa8c8b334 100644 --- a/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue +++ b/apps/desktop/src/components/diff/SchemaDiffConfigStep.vue @@ -267,9 +267,9 @@ async function fetchDbVersion(connectionId: string, database: string, schema: st content-class="w-[var(--reka-popover-trigger-width)]" > @@ -351,9 +351,9 @@ async function fetchDbVersion(connectionId: string, database: string, schema: st content-class="w-[var(--reka-popover-trigger-width)]" > diff --git a/apps/desktop/src/components/transfer/DataTransferDialog.vue b/apps/desktop/src/components/transfer/DataTransferDialog.vue index 64ddb04b5..f556d3f4a 100644 --- a/apps/desktop/src/components/transfer/DataTransferDialog.vue +++ b/apps/desktop/src/components/transfer/DataTransferDialog.vue @@ -380,9 +380,9 @@ function getConnectionName(id: string) { content-class="w-[var(--reka-popover-trigger-width)]" > @@ -443,9 +443,9 @@ function getConnectionName(id: string) { content-class="w-[var(--reka-popover-trigger-width)]" > diff --git a/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue b/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue index b8de44f54..8a49738ae 100644 --- a/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue +++ b/apps/desktop/src/components/ui/searchable-select/SearchableSelect.vue @@ -273,9 +273,12 @@ function handleKeydown(event: KeyboardEvent) { - - {{ displayName?.(option) }} - + +
+ + {{ displayName?.(option) }} + +
{{ emptyText }} diff --git a/apps/desktop/src/lib/common/__tests__/searchableSelectLayout.spec.ts b/apps/desktop/src/lib/common/__tests__/searchableSelectLayout.spec.ts new file mode 100644 index 000000000..634d33680 --- /dev/null +++ b/apps/desktop/src/lib/common/__tests__/searchableSelectLayout.spec.ts @@ -0,0 +1,21 @@ +import { readFileSync } from "node:fs"; +import { describe, expect, it } from "vitest"; + +const searchableSelectSource = readFileSync(new URL("../../../components/ui/searchable-select/SearchableSelect.vue", import.meta.url), "utf8"); +const dataTransferDialogSource = readFileSync(new URL("../../../components/transfer/DataTransferDialog.vue", import.meta.url), "utf8"); + +describe("SearchableSelect layout", () => { + it("keeps slotted option labels inside a shrinkable overflow boundary", () => { + const labelBoundaries = searchableSelectSource.match(/dbx-searchable-select-option-label min-w-0 flex-1 overflow-hidden/g) ?? []; + + expect(labelBoundaries).toHaveLength(3); + }); + + it("truncates long data transfer connection labels without shrinking their icons", () => { + const truncatedConnectionLabels = dataTransferDialogSource.match(/\{\{ label \}\}<\/span>/g) ?? []; + const fixedConnectionIcons = dataTransferDialogSource.match(/class="h-3\.5 w-3\.5 shrink-0"/g) ?? []; + + expect(truncatedConnectionLabels).toHaveLength(2); + expect(fixedConnectionIcons).toHaveLength(2); + }); +});