Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(sql-editor): use NEllipsis in hover panel (#10058)

boojack60190057a6f6
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
index 9840bf8e03..4a1f0cbfa3 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/ColumnList.vue
@@ -8,20 +8,22 @@
>
<template #default="{ item: column }: VirtualListItem">
<div
- class="bb-column-list--column-item flex items-start mx-3 px-1 cursor-pointer hover:bg-control-bg-hover/50"
+ class="bb-column-list--column-item flex items-start mx-3 px-1 gap-2 cursor-pointer hover:bg-control-bg-hover/50"
@mouseenter="handleMouseEnter($event, column)"
@mouseleave="handleMouseLeave($event, column)"
>
- <!-- eslint-disable vue/no-v-html -->
- <div
- class="text-sm leading-6 text-gray-600whitespace-pre-wrap break-words flex-2 min-w-[4rem]"
- v-html="renderColumnName(column)"
- />
- <div
- class="shrink-0 text-right text-sm leading-6 text-gray-400 overflow-x-hidden whitespace-nowrap flex-1 min-w-[4rem]"
+ <NEllipsis class="max-w-2/3">
+ <!-- eslint-disable vue/no-v-html -->
+ <span
+ class="text-sm leading-6 text-gray-600whitespace-pre-wrap break-words flex-2 min-w-[4rem]"
+ v-html="renderColumnName(column)"
+ />
+ </NEllipsis>
+ <NEllipsis
+ class="shrink-0 max-w-1/2 text-right text-sm leading-6 text-gray-400 flex-1 min-w-[4rem]"
>
{{ column.type }}
- </div>
+ </NEllipsis>
</div>
</template>
</VirtualList>
@@ -30,6 +32,7 @@
<script setup lang="ts">
import { escape } from "lodash-es";
+import { NEllipsis } from "naive-ui";
import { computed, nextTick } from "vue";
import { VirtualList } from "vueuc";
import { ComposedDatabase } from "@/types";
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue
index 1a30274706..8cdf48892a 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ColumnInfo.vue
@@ -1,8 +1,5 @@
<template>
- <div
- class="grid min-w-[14rem] max-w-[18rem] gap-x-2 gap-y-1 break-all"
- style="grid-template-columns: auto 1fr"
- >
+ <div class="min-w-[14rem] max-w-[18rem] gap-y-1">
<InfoItem :title="$t('common.name')">
{{ column.name }}
</InfoItem>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ExternalTableInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ExternalTableInfo.vue
index 25c1ed7bb0..2eafd2abcd 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ExternalTableInfo.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ExternalTableInfo.vue
@@ -1,8 +1,5 @@
<template>
- <div
- class="grid min-w-[14rem] max-w-[18rem] gap-x-2 gap-y-1 break-all"
- style="grid-template-columns: auto 1fr"
- >
+ <div class="min-w-[14rem] max-w-[18rem] gap-y-1">
<InfoItem :title="$t('common.name')">
{{ name }}
</InfoItem>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue
index 435133a7fe..08fe08cfe2 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/InfoItem.vue
@@ -1,15 +1,21 @@
<template>
- <div class="contents">
- <div class="text-gray-500 font-medium">
- <slot name="title">{{ title }}</slot>
- </div>
- <div class="text-main text-right">
- <slot name="default"></slot>
- </div>
+ <div class="w-full grid grid-cols-2 gap-x-2">
+ <NEllipsis class="max-w-1/3">
+ <span class="text-gray-500 font-medium whitespace-nowrap">
+ <slot name="title">{{ title }}</slot>
+ </span>
+ </NEllipsis>
+ <NEllipsis class="max-w-2/3 text-right">
+ <span class="whitespace-nowrap">
+ <slot name="default"></slot>
+ </span>
+ </NEllipsis>
</div>
</template>
<script setup lang="ts">
+import { NEllipsis } from "naive-ui";
+
defineProps<{
title?: string;
}>();
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue
index eb6bde60e7..c3a9546f6c 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/TableInfo.vue
@@ -1,8 +1,5 @@
<template>
- <div
- class="grid min-w-[14rem] max-w-[18rem] gap-x-2 gap-y-1 break-all"
- style="grid-template-columns: auto 1fr"
- >
+ <div class="min-w-[14rem] max-w-[18rem] gap-y-1">
<InfoItem :title="$t('common.name')">
{{ name }}
</InfoItem>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ViewInfo.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ViewInfo.vue
index 8dc7d8399d..0aabdfa57e 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ViewInfo.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/HoverPanel/ViewInfo.vue
@@ -6,7 +6,7 @@
</div>
<div class="flex flex-row justify-end items-center">
<NCheckbox v-if="!formatted.error" v-model:checked="format">
- Format
+ {{ $t("sql-editor.format") }}
</NCheckbox>
</div>
</div>
diff --git a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
index 9d23daed5b..361f4e025b 100644
--- a/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
+++ b/frontend/src/views/sql-editor/SecondarySidebar/InfoTabPane/SchemaPanel/TableList.vue
@@ -8,7 +8,7 @@
>
<template #default="{ item, index }: VirtualListItem">
<div
- class="text-sm leading-6 px-1"
+ class="w-full text-sm leading-6 px-1"
:class="`bb-table-list--item`"
:data-key="item.key"
:data-index="index"
@@ -16,7 +16,7 @@
@mouseleave="handleMouseLeave($event, item)"
>
<div
- class="flex items-center text-gray-600 whitespace-pre-wrap break-words rounded-sm px-1"
+ class="w-full flex items-center text-gray-600 rounded-sm px-1"
:class="
rowClickable && ['hover:bg-control-bg-hover/50', 'cursor-pointer']
"
@@ -27,8 +27,10 @@
class="w-4 h-4 mr-1 shrink-0"
/>
<ViewIcon v-if="item.view" class="w-4 h-4 mr-1 shrink-0" />
- <!-- eslint-disable-next-line vue/no-v-html -->
- <div v-html="renderItem(item)" />
+ <NEllipsis class="grow">
+ <!-- eslint-disable-next-line vue/no-v-html -->
+ <span v-html="renderItem(item)" />
+ </NEllipsis>
</div>
</div>
</template>
@@ -38,6 +40,7 @@
<script setup lang="ts">
import { escape } from "lodash-es";
+import { NEllipsis } from "naive-ui";
import { computed, nextTick } from "vue";
import { VirtualList } from "vueuc";
import { TableIcon, ViewIcon } from "@/components/Icon";