Skip to content

Commit a708ad8

Browse files
Copilotsawka
andcommitted
fix: make vertical tab title width dynamic on hover
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
1 parent d8063d8 commit a708ad8

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

frontend/app/tab/vtab.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function VTab({
4444
onDrop={onDrop}
4545
onDragEnd={onDragEnd}
4646
className={cn(
47-
"group flex h-9 w-full cursor-pointer items-center gap-2 rounded-md border pl-2 pr-1 text-sm transition-colors select-none",
47+
"group relative flex h-9 w-full cursor-pointer items-center rounded-md border pl-2 pr-1 text-sm transition-colors select-none",
4848
"whitespace-nowrap",
4949
active
5050
? "border-accent/40 bg-accent/20 text-primary"
@@ -55,16 +55,23 @@ export function VTab({
5555
)}
5656
>
5757
{tab.indicator && (
58-
<span className="shrink-0 text-xs" style={{ color: tab.indicator.color || "#fbbf24" }}>
58+
<span className="mr-1 shrink-0 text-xs" style={{ color: tab.indicator.color || "#fbbf24" }}>
5959
<i className={makeIconClass(tab.indicator.icon, true, { defaultIcon: "bell" })} />
6060
</span>
6161
)}
62-
<span className="min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap">{tab.name}</span>
62+
<span
63+
className={cn(
64+
"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap transition-[padding-right]",
65+
onClose && !isReordering && "group-hover:pr-6"
66+
)}
67+
>
68+
{tab.name}
69+
</span>
6370
{onClose && (
6471
<button
6572
type="button"
6673
className={cn(
67-
"shrink-0 -mr-1 cursor-pointer p-1 text-secondary transition",
74+
"absolute top-1/2 right-0 shrink-0 -translate-y-1/2 cursor-pointer p-1 text-secondary transition",
6875
isReordering ? "opacity-0" : "opacity-0 group-hover:opacity-100 hover:text-primary"
6976
)}
7077
onClick={(event) => {

0 commit comments

Comments
 (0)