Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(web): metric hover underline uses spaced crisp dots with faded tips (#18316)

Trang Nguyen6803b8675f74
diff --git a/web/src/components/design-system/Badge/Badge.tsx b/web/src/components/design-system/Badge/Badge.tsx
index 23661f764c..167d1e5fc0 100644
--- a/web/src/components/design-system/Badge/Badge.tsx
+++ b/web/src/components/design-system/Badge/Badge.tsx
@@ -27,7 +27,7 @@ const badgeVariants = cva(
filled: "border-transparent bg-muted text-foreground-secondary",
},
interactive: {
- true: "decoration-border-contrast underline decoration-dashed decoration-1 underline-offset-[3px]",
+ true: "underline-dotted",
false: "",
},
},
@@ -91,9 +91,10 @@ export function Badge({
{label && <span className="shrink-0 py-0.5">{label}:</span>}
<span
className={cn(
- "overflow-x-clip overflow-y-visible py-0.5 text-ellipsis whitespace-nowrap",
- interactive &&
- "decoration-border-contrast underline decoration-dashed decoration-1 underline-offset-[3px]",
+ "py-0.5 text-ellipsis whitespace-nowrap",
+ interactive
+ ? "underline-dotted overflow-clip"
+ : "overflow-x-clip overflow-y-visible",
)}
title={title ?? (interactive ? undefined : text)}
>
diff --git a/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx b/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
index e279f150d2..bbd2a49a65 100644
--- a/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
+++ b/web/src/features/models/components/UpsertModelFormDialog/UpsertModelFormDialogController.clienttest.tsx
@@ -186,7 +186,7 @@ describe("UpsertModelFormDialogController price editor", () => {
const label = within(trigger).getByText("claude-sonnet-4-5");
expect(trigger.tagName).toBe("BUTTON");
- expect(label).toHaveClass("underline");
+ expect(label).toHaveClass("underline-dotted");
});
it("keeps every keystroke of a usage type that extends an existing one", () => {
diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css
index 3a087078b1..b492fddd90 100644
--- a/web/src/styles/globals.css
+++ b/web/src/styles/globals.css
@@ -900,6 +900,36 @@
reason to try the wheel. This paints a thin scrollbar whenever the content
overflows, and still nothing when it fits. `scrollbar-color` also opts
Firefox out of overlay scrollbars, which it uses by default too. */
+/* Spaced dotted underline for values with a hover breakdown; drawn below the
+ box so it never changes layout. */
+@utility underline-dotted {
+ position: relative;
+ overflow-clip-margin: var(--spacing);
+ &::after {
+ content: "";
+ position: absolute;
+ right: calc(var(--spacing) * -1);
+ bottom: -2px;
+ left: calc(var(--spacing) * -1);
+ height: 1px;
+ background-image: linear-gradient(
+ to right,
+ hsl(var(--foreground-secondary)) 1px,
+ transparent 1px
+ );
+ background-repeat: repeat-x;
+ background-size: 4px 1px;
+ mask-image: linear-gradient(
+ to right,
+ transparent,
+ black calc(var(--spacing) * 2),
+ black calc(100% - var(--spacing) * 2),
+ transparent
+ );
+ pointer-events: none;
+ }
+}
+
@utility scrollbar-visible {
&::-webkit-scrollbar {
width: 8px;