Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

feat: exclude meta source and improve tooltip message

Pranav Cf8f21aa39433
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/index.vue b/packages/nc-gui/components/smartsheet/grid/canvas/index.vue
index 58d8bdd229..f6394ab9fb 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/index.vue
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/index.vue
@@ -161,7 +161,7 @@ const {
// VModels
const vSelectedAllRecords = useVModel(props, 'selectedAllRecords', emits)
-const { eventBus, isSqlView } = useSmartsheetStoreOrThrow()
+const { eventBus, isSqlView, isExternalSource } = useSmartsheetStoreOrThrow()
const { metas, getMeta } = useMetas()
@@ -1702,7 +1702,7 @@ const getHeaderTooltipRegions = (
if (column.uidt) {
totalIconWidth += 26
- tooltipText = getCustomColumnTooltip({ column, metas: metas.value, isExternalLink: true, getMeta })
+ tooltipText = getCustomColumnTooltip({ column, metas: metas.value, isExternalLink: isExternalSource.value, getMeta })
regions.push({
x: xOffset + 8 - scrollLeftValue,
width: 13,
diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/utils/headerUtils.ts b/packages/nc-gui/components/smartsheet/grid/canvas/utils/headerUtils.ts
index 2edb7e3ae3..f75402485b 100644
--- a/packages/nc-gui/components/smartsheet/grid/canvas/utils/headerUtils.ts
+++ b/packages/nc-gui/components/smartsheet/grid/canvas/utils/headerUtils.ts
@@ -72,20 +72,33 @@ export function getCustomColumnTooltip({
refTableColName = refTable?.columns?.find((c) => c.id === relOptions.fk_child_column_id)?.title
}
- // generate a detailed tooltip for link to another record with relation columns and many to many table
- // including column names from the current table, related table and many to many table
- // Format: "Link column: Current table(column in current table) -> Related Table (column in related table)"
- const tooltip = `${columnTypeName(column)}:\n\n ${[
- currentTable?.title,
+ // Generate a detailed tooltip for link-to-record fields.
+ // The tooltip includes:
+ // - Column type
+ // - Current table and column
+ // - Related table and column
+ // - (Optional) many-to-many table with its linking columns
+ //
+ // Format example:
+ // Link column: Customers(id) β†’ Products(product_id)
+ //
+ // Through Orders_Products(customer_id, product_id)
+ const tooltip = `${columnTypeName(column)}:\n\n${[
+ // Current table and column
+ currentTable?.title || '',
currentTableColName ? `(${currentTableColName})` : '',
+
+ // Relation arrow
' β†’ ',
- refTable?.title,
+
+ // Related table and column
+ refTable?.title || '',
refTableColName ? `(${refTableColName})` : '',
- mmTable ? '\n\nVia ' : '',
+
+ // Many-to-many (optional)
+ mmTable ? '\n\nThrough: ' : '',
mmTable ? mmTable.title : '',
- mmTableRefColName ? `(${mmTableRefColName})` : '',
- mmTable && mmTableColName ? ',' : '',
- mmTableColName ? `(${mmTableColName})` : '',
+ mmTableColName && mmTableRefColName ? `(${mmTableColName}, ${mmTableRefColName})` : '',
].join('')}`
return tooltip