diff --git a/apps/desktop/src/lib/__tests__/editorThemes.spec.ts b/apps/desktop/src/lib/__tests__/editorThemes.spec.ts index 4861988ea..2bf94bb2c 100644 --- a/apps/desktop/src/lib/__tests__/editorThemes.spec.ts +++ b/apps/desktop/src/lib/__tests__/editorThemes.spec.ts @@ -51,4 +51,11 @@ describe("SQL completion theme", () => { expect(rules[".cm-tooltip.cm-tooltip-autocomplete"]).toMatchObject({ borderRadius: "var(--dbx-radius-md)" }); expect(rules[".cm-tooltip.cm-tooltip-autocomplete > ul > li"]).toMatchObject({ borderRadius: "var(--dbx-radius-sm)" }); }); + + it("keeps completion labels ahead of long detail text", () => { + const rules = buildSqlCompletionThemeRules(); + + expect(rules[".cm-completionLabel"]).toMatchObject({ flex: "0 1 auto" }); + expect(rules[".cm-completionDetail"]).toMatchObject({ flex: "1 1 0", minWidth: "0", textOverflow: "ellipsis" }); + }); }); diff --git a/apps/desktop/src/lib/editor/editorThemes.ts b/apps/desktop/src/lib/editor/editorThemes.ts index a756f449d..402555c44 100644 --- a/apps/desktop/src/lib/editor/editorThemes.ts +++ b/apps/desktop/src/lib/editor/editorThemes.ts @@ -995,7 +995,7 @@ export function buildSqlCompletionThemeRules(): CodeMirrorStyleSpec { fontSize: `clamp(11px, calc(var(${EDITOR_FONT_SIZE_CSS_VAR}, 13px) - 1px), 13px)`, fontWeight: "500", fontStyle: "normal", - flex: "1 1 auto", + flex: "1 1 0", marginLeft: "10px", minWidth: "0", opacity: "1",