Skip to content

Commit 13d737f

Browse files
committed
Truncate long branch names and show tooltip
1 parent 8fe4492 commit 13d737f

File tree

2 files changed

+22
-4
lines changed
  • apps/webapp/app

2 files changed

+22
-4
lines changed

apps/webapp/app/components/environments/EnvironmentLabel.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,40 @@ export function EnvironmentCombo({
5151
environment,
5252
className,
5353
iconClassName,
54+
tooltipSideOffset,
55+
tooltipSide,
5456
}: {
5557
environment: Environment;
5658
className?: string;
5759
iconClassName?: string;
60+
tooltipSideOffset?: number;
61+
tooltipSide?: "top" | "right" | "bottom" | "left";
5862
}) {
5963
return (
6064
<span className={cn("flex items-center gap-1.5 text-sm text-text-bright", className)}>
6165
<EnvironmentIcon
6266
environment={environment}
6367
className={cn("size-4.5 shrink-0", iconClassName)}
6468
/>
65-
<EnvironmentLabel environment={environment} />
69+
<EnvironmentLabel
70+
environment={environment}
71+
tooltipSideOffset={tooltipSideOffset}
72+
tooltipSide={tooltipSide}
73+
/>
6674
</span>
6775
);
6876
}
6977

7078
export function EnvironmentLabel({
7179
environment,
7280
className,
81+
tooltipSideOffset = 34,
82+
tooltipSide = "right",
7383
}: {
7484
environment: Environment;
7585
className?: string;
86+
tooltipSideOffset?: number;
87+
tooltipSide?: "top" | "right" | "bottom" | "left";
7688
}) {
7789
const spanRef = useRef<HTMLSpanElement>(null);
7890
const [isTruncated, setIsTruncated] = useState(false);
@@ -115,9 +127,10 @@ export function EnvironmentLabel({
115127
{text}
116128
</span>
117129
}
118-
side="right"
130+
side={tooltipSide}
119131
variant="dark"
120-
sideOffset={34}
132+
sideOffset={tooltipSideOffset}
133+
disableHoverableContent
121134
/>
122135
);
123136
}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.concurrency/route.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,12 @@ function Upgradable({
452452
{environments.map((environment, index) => (
453453
<TableRow key={environment.id}>
454454
<TableCell>
455-
<EnvironmentCombo environment={environment} />
455+
<EnvironmentCombo
456+
environment={environment}
457+
className="max-w-[18ch]"
458+
tooltipSideOffset={6}
459+
tooltipSide="top"
460+
/>
456461
</TableCell>
457462
<TableCell alignment="right">{environment.planConcurrencyLimit}</TableCell>
458463
<TableCell alignment="right">

0 commit comments

Comments
 (0)