Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
import { cn } from '@sim/emcn'
import { ChevronDown } from '@sim/emcn/icons'
import type { WorkflowGroup } from '@/lib/table'
import { HeaderLabel } from '@/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/header-label'
import type { WorkflowMetadata } from '@/stores/workflows/registry/types'
import { COL_WIDTH, SELECTION_TINT_BG } from '../constants'
import type { ColumnSourceInfo, DisplayColumn } from '../types'
Expand Down Expand Up @@ -296,9 +297,10 @@ export const ColumnHeaderMenu = React.memo(function ColumnHeaderMenu({
blockIconInfo={sourceInfo?.blockIconInfo}
blockMissing={blockMissing}
/>
<span className='ml-1.5 min-w-0 overflow-clip text-ellipsis whitespace-nowrap text-[var(--text-primary)] text-small'>
{column.workflowGroupId ? column.headerLabel : column.name}
</span>
<HeaderLabel
label={column.workflowGroupId ? column.headerLabel : column.name}
className='ml-1.5 text-[var(--text-primary)] text-small'
/>
</div>
) : (
<div className='flex h-full w-full min-w-0 items-center'>
Expand All @@ -314,9 +316,10 @@ export const ColumnHeaderMenu = React.memo(function ColumnHeaderMenu({
blockIconInfo={sourceInfo?.blockIconInfo}
blockMissing={blockMissing}
/>
<span className='ml-1.5 min-w-0 overflow-clip text-ellipsis whitespace-nowrap text-[var(--text-primary)] text-small'>
{column.workflowGroupId ? column.headerLabel : column.name}
</span>
<HeaderLabel
label={column.workflowGroupId ? column.headerLabel : column.name}
className='ml-1.5 text-[var(--text-primary)] text-small'
/>
</button>
<button
type='button'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use client'

import { memo } from 'react'
import { cn, FloatingTooltip, isTextClipped, useFloatingTooltip } from '@sim/emcn'

interface HeaderLabelProps {
label: string
className?: string
}

/**
* Column header text that clips with an ellipsis and reveals its full value in
* a floating tooltip — but only while actually clipped, since an untruncated
* header already says everything the tooltip would.
*/
export const HeaderLabel = memo(function HeaderLabel({ label, className }: HeaderLabelProps) {
const { state, handlers } = useFloatingTooltip(isTextClipped)

return (
<>
<span className={cn('min-w-0 truncate', className)} {...handlers}>
{label}
</span>
<FloatingTooltip label={label} state={state} />
</>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
} from '@sim/emcn/icons'
import type { RunLimit, RunMode } from '@/lib/api/contracts/tables'
import type { WorkflowGroupType } from '@/lib/table'
import { HeaderLabel } from '@/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/header-label'
import { getEnrichment } from '@/enrichments/registry'
import type { WorkflowMetadata } from '@/stores/workflows/registry/types'
import { SELECTION_TINT_BG } from '../constants'
Expand Down Expand Up @@ -439,7 +440,7 @@ export function WorkflowGroupMetaCell({
) : (
<Workflow className='size-[12px] shrink-0 text-[var(--text-icon)]' />
)}
<span className='min-w-0 truncate text-[var(--text-secondary)] text-xs'>{name}</span>
<HeaderLabel label={name} className='text-[var(--text-secondary)] text-xs' />
{onRunColumn && (
<DropdownMenu open={runMenuOpen} onOpenChange={setRunMenuOpen}>
<DropdownMenuTrigger asChild>
Expand Down
Loading