feat(grid): add table font shortcuts

This commit is contained in:
终焉之时 authored and GitHub committed 2026-07-22 22:20:42 +08:00
1 parent 43b810fb36
commit 5d1a6e63cd
25 files changed
+198 -77

No files matched your search

@@ -108,6 +108,13 @@ describe("normalizeEditorSettings", () => {
expect(invalid.dataGridHideNullColumns).toBe(false);
});
it("defaults the data grid font and preserves a custom font family", () => {
const defaultFontFamily = `"Geist Variable Tabular", "Geist Variable", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`;
expect(normalizeEditorSettings({}).tableFontFamily).toBe(defaultFontFamily);
expect(normalizeEditorSettings({ tableFontFamily: "'IBM Plex Mono', monospace" }).tableFontFamily).toBe("'IBM Plex Mono', monospace");
expect(normalizeEditorSettings({ tableFontFamily: " " }).tableFontFamily).toBe(defaultFontFamily);
});
it("shows cell detail metadata by default and preserves collapsed state", () => {
expect(normalizeEditorSettings({}).cellDetailMetadataCollapsed).toBe(false);
expect(normalizeEditorSettings({ cellDetailMetadataCollapsed: true }).cellDetailMetadataCollapsed).toBe(true);
-10
View File
@@ -535,16 +535,6 @@ export const EDITOR_THEMES: { value: EditorTheme; label: string; dark: boolean }
const EDITOR_THEME_VALUES = new Set<EditorTheme>(EDITOR_THEMES.map((theme) => theme.value));
export const FONT_FAMILIES: { value: string; label: string }[] = [
{ value: "'Fira Code', 'Cascadia Code', 'Cascadia Mono', 'JetBrains Mono', monospace", label: "Fira Code" },
{ value: "'JetBrains Mono', 'Fira Code', monospace", label: "JetBrains Mono" },
{ value: "'Cascadia Code', 'Cascadia Mono', monospace", label: "Cascadia Code" },
{ value: "'Source Code Pro', monospace", label: "Source Code Pro" },
{ value: "'SF Mono', 'Menlo', monospace", label: "SF Mono / Menlo" },
{ value: "'Consolas', 'Courier New', monospace", label: "Consolas" },
{ value: "monospace", label: "System Monospace" },
];
export const EXECUTE_MODE_CURRENT_DEFAULT_VERSION = 1;
export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {