From e381aa4ee1e41537e9b863654d12b7ffcc76b265 Mon Sep 17 00:00:00 2001 From: zipg Date: Wed, 29 Jul 2026 00:42:07 +0800 Subject: [PATCH] fix(editor): prioritize SQL completion column names --- apps/desktop/src/lib/__tests__/editorThemes.spec.ts | 7 +++++++ apps/desktop/src/lib/editor/editorThemes.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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",