🐛 fix(query-editor): 修复大字号表候选下划线裁剪

This commit is contained in:
kunghim
2026-08-03 15:34:07 +08:00
parent d06d9a0f7f
commit 630ba7fc3f
5 changed files with 122 additions and 32 deletions

View File

@@ -3,6 +3,7 @@ import { describe, expect, it } from 'vitest';
import {
migrateLegacySqlEditorTypographySettings,
resolveSqlEditorFontSize,
resolveSqlEditorSuggestionLayout,
sanitizeSqlEditorTypographySettings,
} from './sqlEditorTypography';
@@ -39,4 +40,22 @@ describe('SQL editor typography', () => {
sqlEditorFontSizeFollowGlobal: false,
});
});
it('keeps default completion rows unchanged and grows the table-name row for large fonts', () => {
expect(resolveSqlEditorSuggestionLayout(13)).toEqual({
nameLineHeight: 18,
commentLineHeight: 18,
rowHeight: 36,
});
expect(resolveSqlEditorSuggestionLayout(18)).toEqual({
nameLineHeight: 25,
commentLineHeight: 18,
rowHeight: 43,
});
expect(resolveSqlEditorSuggestionLayout(20)).toEqual({
nameLineHeight: 28,
commentLineHeight: 18,
rowHeight: 46,
});
});
});