Skip to content

Commit

Permalink
Merge pull request #237 from liam-hq/hovering-on-table-name-tooltip
Browse files Browse the repository at this point in the history
feat(ERDRenderer): Add tooltip functionality to TableHeader component
  • Loading branch information
hoshinotsuyoshi authored Dec 13, 2024
2 parents 306fe20 + c5c8459 commit 2bfde5e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions frontend/.changeset/new-deers-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@liam-hq/erd-core": patch
"@liam-hq/cli": patch
---

Add tooltips to display the full table name when it is truncated in the Table node
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { useDBStructureStore, useUserEditingStore } from '@/stores'
import { Table2 } from '@liam-hq/ui'
import {
Table2,
TooltipContent,
TooltipPortal,
TooltipProvider,
TooltipRoot,
TooltipTrigger,
} from '@liam-hq/ui'
import { Handle, Position } from '@xyflow/react'
import type { FC } from 'react'
import styles from './TableHeader.module.css'
Expand All @@ -22,7 +29,20 @@ export const TableHeader: FC<Props> = ({ name }) => {
return (
<div className={styles.wrapper}>
<Table2 width={16} />
<span className={styles.name}>{name}</span>

<TooltipProvider>
<TooltipRoot>
<TooltipTrigger asChild>
<span className={styles.name}>{name}</span>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent side={'top'} sideOffset={4}>
{name}
</TooltipContent>
</TooltipPortal>
</TooltipRoot>
</TooltipProvider>

{showMode === 'TABLE_NAME' && (
<>
{isTarget && (
Expand Down

0 comments on commit 2bfde5e

Please sign in to comment.