feat(sidebar): add right-aligned comment display

This commit is contained in:
zipg authored and GitHub committed 2026-07-23 18:34:44 +08:00
1 parent 857a3acb90
commit 9f42f478bf
13 files changed
+115 -10

No files matched your search

@@ -9,6 +9,7 @@ describe("normalizeEditorSettings", () => {
expect(normalizeEditorSettings({}).sidebarObjectInfoMode).toBe("comment-aligned");
expect(normalizeEditorSettings({ sidebarObjectInfoMode: "comment-aligned" }).sidebarObjectInfoMode).toBe("comment-aligned");
expect(normalizeEditorSettings({ sidebarObjectInfoMode: "comment-inline" }).sidebarObjectInfoMode).toBe("comment-inline");
expect(normalizeEditorSettings({ sidebarObjectInfoMode: "comment-right" }).sidebarObjectInfoMode).toBe("comment-right");
expect(normalizeEditorSettings({ sidebarObjectInfoMode: "size" }).sidebarObjectInfoMode).toBe("size");
expect(normalizeEditorSettings({ sidebarTableCommentLayout: "aligned" } as any).sidebarObjectInfoMode).toBe("comment-aligned");
expect(normalizeEditorSettings({ sidebarTableCommentLayout: "hidden" } as any).sidebarObjectInfoMode).toBe("hidden");
+2 -2
View File
@@ -376,7 +376,7 @@ export interface CustomTheme {
export const DEFAULT_CUSTOM_THEMES: CustomTheme[] = [{ id: "default", name: "Custom", colors: { ...DEFAULT_CUSTOM_THEME_COLORS }, ddlColors: { ...DEFAULT_CUSTOM_THEME_DDL_COLORS } }];
export type SidebarObjectInfoMode = "comment-inline" | "comment-aligned" | "size" | "hidden";
export type SidebarObjectInfoMode = "comment-inline" | "comment-aligned" | "comment-right" | "size" | "hidden";
export interface EditorSettings {
fontFamily: string;
@@ -714,7 +714,7 @@ function normalizeConnectionListSortMode(value: unknown): ConnectionListSortMode
}
function normalizeSidebarObjectInfoMode(value: unknown, legacyCommentLayout?: unknown, legacyHideTableComments?: unknown, legacyShowDatabaseSizes?: unknown): SidebarObjectInfoMode {
if (value === "comment-inline" || value === "comment-aligned" || value === "size" || value === "hidden") return value;
if (value === "comment-inline" || value === "comment-aligned" || value === "comment-right" || value === "size" || value === "hidden") return value;
if (legacyCommentLayout === "hidden" || legacyHideTableComments === true) return "hidden";
if (legacyShowDatabaseSizes === true) return "size";
if (legacyCommentLayout === "aligned") return "comment-aligned";