Skip to content

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

fix(web): flatter filter tokens and a centred search line (#18350)

Trang Nguyen9aca47c2b287
diff --git a/web/src/features/filters/components/FilterToken.tsx b/web/src/features/filters/components/FilterToken.tsx
index 5035d53897..3c13eec840 100644
--- a/web/src/features/filters/components/FilterToken.tsx
+++ b/web/src/features/filters/components/FilterToken.tsx
@@ -2,7 +2,7 @@ import { cva } from "class-variance-authority";
import { type ReactNode } from "react";
const filterTokenVariants = cva(
- "inline max-w-full rounded border border-border bg-secondary px-1.5 py-0.5 text-secondary-foreground shadow-sm transition-colors hover:border-ring hover:bg-accent",
+ "inline max-w-full rounded-sm border border-transparent bg-secondary px-1.5 py-0.5 text-secondary-foreground transition-colors hover:border-border-contrast",
{
variants: {
deactivated: {
@@ -12,7 +12,7 @@ const filterTokenVariants = cva(
// Pointer-independent hover treatment: the caret/keyboard path marks the
// token an open explanation refers to.
highlighted: {
- true: "border-ring bg-accent",
+ true: "border-ring",
false: "",
},
},
diff --git a/web/src/features/search-bar/components/ComposerTokens.tsx b/web/src/features/search-bar/components/ComposerTokens.tsx
index 7d2af2cf33..b904cce52a 100644
--- a/web/src/features/search-bar/components/ComposerTokens.tsx
+++ b/web/src/features/search-bar/components/ComposerTokens.tsx
@@ -43,7 +43,7 @@ const composerTokenVariants = cva("max-w-full", {
kind: {
filter: "",
freeText:
- "mr-1 inline rounded border px-1.5 py-0.5 border-transparent bg-muted/70 text-foreground/90 transition-colors hover:border-border hover:bg-accent",
+ "mr-1 inline rounded-sm border px-1.5 py-0.5 border-transparent bg-muted/70 text-foreground/90 transition-colors hover:border-border-contrast",
operator: "font-bold uppercase text-qlang-keyword",
paren: "text-muted-foreground",
invalid:
@@ -55,7 +55,7 @@ const composerTokenVariants = cva("max-w-full", {
deactivated: { true: "opacity-50 line-through decoration-1", false: "" },
// The token whose explanation is showing. Mirrors the hover treatment, so
// the caret (keyboard) path highlights exactly like the pointer does.
- highlighted: { true: "border-border bg-accent", false: "" },
+ highlighted: { true: "border-ring", false: "" },
},
defaultVariants: { kind: "freeText", deactivated: false, highlighted: false },
});
diff --git a/web/src/features/search-bar/components/SearchComposer.tsx b/web/src/features/search-bar/components/SearchComposer.tsx
index 33151e6600..400b149a2c 100644
--- a/web/src/features/search-bar/components/SearchComposer.tsx
+++ b/web/src/features/search-bar/components/SearchComposer.tsx
@@ -1532,7 +1532,7 @@ export function SearchComposer({
className={cn(
"absolute top-0.75 right-2 z-20 inline-flex items-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5",
"bg-background text-muted-foreground font-sans text-xs",
- "hover:border-border hover:text-foreground hover:bg-accent transition-colors",
+ "hover:text-foreground transition-colors",
// Match the app's focus ring (ring-ring) instead of the browser's
// default blue outline, like the shared Button used elsewhere.
"ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden",
diff --git a/web/src/features/search-bar/components/composer-chrome.ts b/web/src/features/search-bar/components/composer-chrome.ts
index b6318b3305..fbebec1c8b 100644
--- a/web/src/features/search-bar/components/composer-chrome.ts
+++ b/web/src/features/search-bar/components/composer-chrome.ts
@@ -5,7 +5,7 @@
/** The bar's box: border, background, radius, padding, min height. */
export const COMPOSER_SURFACE_CLASSES =
- "border-input bg-background relative min-h-8 rounded-md border px-2 py-0.5";
+ "border-input bg-background relative min-h-8 rounded-md border px-2 py-0.75";
/** The query text metrics: mono font, pill-matched line height, wrapping. */
export const COMPOSER_TEXT_CLASSES =
diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css
index c9eb1c6aed..e228b3ffea 100644
--- a/web/src/styles/globals.css
+++ b/web/src/styles/globals.css
@@ -479,10 +479,10 @@
keyword=blue. Scoped to the filter grammar (key:value pills); retune
freely, a designer can own these later. Operators reuse muted-foreground.
Values from the langfuse-search-bar prototype. */
- --qlang-field: 262 60% 47%;
- --qlang-value: 152 60% 30%;
- --qlang-number: 24 75% 42%;
- --qlang-keyword: 221 83% 53%;
+ --qlang-field: 263.4 69.3% 42.2%; /* violet-800 */
+ --qlang-value: 162.9 93.5% 24.3%; /* emerald-700 */
+ --qlang-number: 17.5 88.3% 40.4%; /* orange-700 */
+ --qlang-keyword: 224.3 76.3% 48%; /* blue-700 */
--json-value-string: var(--color-green-800);
--json-value-number: var(--color-blue-800);