Skip to content

Commit ca47383

Browse files
committed
RunTag component doesn’t get squished and hover behaviour is nicer
1 parent 0819ae7 commit ca47383

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

apps/webapp/app/components/runs/v3/RunTag.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,21 @@ export function RunTag({ tag, to, tooltip }: { tag: string; to?: string; tooltip
4141
const tagContent = to ? (
4242
<SimpleTooltip
4343
button={
44-
<Link to={to} className="group">
44+
<Link to={to} className="group shrink-0" onMouseEnter={() => setIsHovered(true)}>
4545
<span className="flex h-6 items-stretch">{renderTagContent()}</span>
4646
</Link>
4747
}
4848
content={tooltip || `Filter by ${tag}`}
4949
disableHoverableContent
5050
/>
5151
) : (
52-
<span className="flex h-6 items-stretch">{renderTagContent()}</span>
52+
<span className="flex h-6 shrink-0 items-stretch" onMouseEnter={() => setIsHovered(true)}>
53+
{renderTagContent()}
54+
</span>
5355
);
5456

5557
return (
56-
<div
57-
className="group relative inline-flex"
58-
onMouseEnter={() => setIsHovered(true)}
59-
onMouseLeave={() => setIsHovered(false)}
60-
>
58+
<div className="group relative inline-flex shrink-0" onMouseLeave={() => setIsHovered(false)}>
6159
{tagContent}
6260
<CopyButton textToCopy={tag} isHovered={isHovered} />
6361
</div>
@@ -87,8 +85,8 @@ function CopyButton({ textToCopy, isHovered }: { textToCopy: string; isHovered:
8785
onClick={copy}
8886
onMouseDown={(e) => e.stopPropagation()}
8987
className={cn(
90-
"absolute -right-6 top-0 z-10 flex size-6 items-center justify-center rounded-r-sm border-y border-r border-charcoal-650 bg-charcoal-750",
91-
isHovered ? "opacity-100" : "opacity-0",
88+
"absolute -right-6 top-0 z-10 size-6 items-center justify-center rounded-r-sm border-y border-r border-charcoal-650 bg-charcoal-750",
89+
isHovered ? "flex" : "hidden",
9290
copied
9391
? "text-green-500"
9492
: "text-text-dimmed hover:border-charcoal-600 hover:bg-charcoal-700 hover:text-text-bright"

0 commit comments

Comments
 (0)