diff --git a/apps/desktop/src/components/layout/EditorToolbar.vue b/apps/desktop/src/components/layout/EditorToolbar.vue index e97b7b014..20a3f1a2c 100644 --- a/apps/desktop/src/components/layout/EditorToolbar.vue +++ b/apps/desktop/src/components/layout/EditorToolbar.vue @@ -18,6 +18,7 @@ import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { SearchableSelect } from "@/components/ui/searchable-select"; import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"; +import TruncatedTextTooltip from "@/components/ui/TruncatedTextTooltip.vue"; import DatabaseIcon from "@/components/icons/DatabaseIcon.vue"; import { useConnectionStore } from "@/stores/connectionStore"; import { useDatabaseOptions } from "@/composables/useDatabaseOptions"; @@ -254,7 +255,7 @@ function connectionById(connectionId: string): ConnectionConfig | undefined { @@ -278,7 +279,11 @@ function connectionById(connectionId: string): ConnectionConfig | undefined { if (open && activeConnection) loadDatabaseOptions(activeConnection.id).catch(() => {}); } " - /> + > + + - + + +import { ref } from "vue"; +import type { HTMLAttributes } from "vue"; +import LightTooltip from "@/components/ui/LightTooltip.vue"; +import { cn } from "@/lib/utils"; + +const props = withDefaults( + defineProps<{ + text: string; + class?: HTMLAttributes["class"]; + side?: "top" | "right" | "bottom" | "left"; + sideOffset?: number; + delay?: number; + openOnFocus?: boolean; + }>(), + { + side: "top", + sideOffset: 8, + delay: 0, + openOnFocus: true, + }, +); + +const textRef = ref(); + +function isTooltipDisabled(): boolean { + const el = textRef.value; + if (!el) return true; + return el.scrollWidth - el.clientWidth <= 2; +} + + +