feat(tabs): show table comments in tab tooltips

Closes #8342
This commit is contained in:
t8y2 committed 2026-09-07 14:10:16 +08:00
1 parent c0c97ef0e4
commit 5f81ed2e11
21 files changed
+75 -11

No files matched your search

@@ -1300,7 +1300,7 @@ watch([() => props.specialPageTabs?.settingsActive, () => props.specialPageTabs?
</TooltipTrigger>
<TooltipContent :side="tabTooltipSide" class="text-xs grid grid-cols-[auto_1fr] gap-x-2">
<template v-for="line in tabTooltipLines(entry.tab, t)" :key="line.label">
<span class="text-muted-foreground">{{ line.label }}</span>
<span class="font-medium opacity-70">{{ line.label }}</span>
<span>{{ line.value }}</span>
</template>
</TooltipContent>
@@ -85,7 +85,7 @@ export interface ContentAreaSurfaceEmits {
viewTableDdl: [tabId: string, target: SqlObjectNavigationTarget];
editTableStructure: [tabId: string, target: SqlObjectNavigationTarget];
openObjectSource: [tabId: string, target: SqlObjectNavigationTarget, initialEditing: boolean];
openObjectTable: [tabId: string, target: { tableName: string; schema?: string; tableType?: string; catalog?: string }];
openObjectTable: [tabId: string, target: { tableName: string; schema?: string; tableType?: string; catalog?: string; comment?: string | null }];
objectSchemaChange: [tabId: string, schema: string | undefined];
objectBrowserViewportChange: [tabId: string, viewport: ObjectBrowserViewport];
objectBrowserSearchChange: [tabId: string, query: string];
@@ -182,7 +182,7 @@ const props = defineProps<{
}>();
const emit = defineEmits<{
openTable: [target: { tableName: string; schema?: string; tableType?: string; catalog?: string }];
openTable: [target: { tableName: string; schema?: string; tableType?: string; catalog?: string; comment?: string | null }];
schemaChange: [schema: string | undefined];
viewportChange: [viewport: ObjectBrowserViewport];
searchChange: [query: string];
@@ -966,7 +966,7 @@ function executeRowAction(row: ObjectBrowserRow, action: ObjectBrowserRowAction)
void openTypeInfo(row);
break;
case "open-table":
emit("openTable", { tableName: row.name, schema: row.schema, tableType: objectBrowserOpenTableType(row), catalog: props.catalog });
emit("openTable", { tableName: row.name, schema: row.schema, tableType: objectBrowserOpenTableType(row), catalog: props.catalog, comment: row.comment });
break;
case "open-source":
void (row.type === "EVENT" ? openEventEditor(row) : openSource(row));
@@ -1736,7 +1736,7 @@ function objectBrowserOpenTableType(row: ObjectBrowserRow): string {
}
function openViewData(row: ObjectBrowserRow) {
emit("openTable", { tableName: row.name, schema: row.schema, tableType: objectBrowserOpenTableType(row), catalog: props.catalog });
emit("openTable", { tableName: row.name, schema: row.schema, tableType: objectBrowserOpenTableType(row), catalog: props.catalog, comment: row.comment });
}
function openStructureEditor(row: ObjectBrowserRow) {