Skip to content

Commit fae85a0

Browse files
committed
improvement(ui): give idle resource tab titles more room
1 parent 293e883 commit fae85a0

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

‎packages/emcn/src/components/tab-strip/tab-strip.tsx‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,20 @@ const Tab = forwardRef<HTMLDivElement, TabProps>(function Tab(
448448
>
449449
{tab.icon}
450450
{!tab.pinned && (
451-
<span
452-
ref={titleRef}
453-
className={cn(
454-
overflowTextClipClass,
455-
'flex-1 select-none text-left',
456-
titleTruncated && overflowTextFadeClass
457-
)}
458-
>
459-
{tab.title}
451+
<span className='min-w-0 flex-1 select-none text-left'>
452+
<span
453+
ref={titleRef}
454+
className={cn(
455+
overflowTextClipClass,
456+
closeable &&
457+
!tab.active &&
458+
!tab.attention &&
459+
'w-[calc(100%_+_24px)] group-focus-within:w-full group-hover:w-full [@media(hover:none)]:w-full',
460+
titleTruncated && overflowTextFadeClass
461+
)}
462+
>
463+
{tab.title}
464+
</span>
460465
</span>
461466
)}
462467
{tab.attention && !tab.active && (
@@ -485,7 +490,7 @@ const Tab = forwardRef<HTMLDivElement, TabProps>(function Tab(
485490
'-translate-y-1/2 absolute top-1/2 right-0.5 z-20 size-[24px] p-0 transition-opacity',
486491
tab.active
487492
? 'opacity-100'
488-
: 'opacity-0 group-focus-within:opacity-100 group-hover:opacity-100'
493+
: 'pointer-events-none opacity-0 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100 [@media(hover:none)]:pointer-events-auto [@media(hover:none)]:opacity-100'
489494
)}
490495
onClick={(event) => {
491496
event.stopPropagation()

0 commit comments

Comments
 (0)