🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(web): yellow warning icon on the no-cost chip (#19255)
Trang Nguyend47865eb4d4c
diff --git a/web/src/components/design-system/Badge/Badge.stories.tsx b/web/src/components/design-system/Badge/Badge.stories.tsxindex 57be18f0c1..91ce9f2451 100644--- a/web/src/components/design-system/Badge/Badge.stories.tsx+++ b/web/src/components/design-system/Badge/Badge.stories.tsx@@ -1,5 +1,5 @@import React from "react";-import { ExternalLinkIcon } from "@langfuse/icons";+import { ExternalLinkIcon, TriangleAlert } from "@langfuse/icons";import { expect } from "storybook/test";import preview from "../../../../.storybook/preview";@@ -24,6 +24,7 @@ const allColors = Object.keys({teal: true,green: true,ghost: true,+ "ghost-warning": true,filled: true,filledOnMuted: true,violetTint: true,@@ -90,6 +91,16 @@ export const GhostInteractive = meta.story({},});+export const GhostWarning = meta.story({+ args: {+ color: "ghost-warning",+ interactive: true,+ font: "mono",+ leadingIcon: TriangleAlert,+ text: "no cost",+ },+});+export const VariantMatrix = meta.story({parameters: {controls: {diff --git a/web/src/components/design-system/Badge/Badge.tsx b/web/src/components/design-system/Badge/Badge.tsxindex 7f0c02f6d3..3a923433cb 100644--- a/web/src/components/design-system/Badge/Badge.tsx+++ b/web/src/components/design-system/Badge/Badge.tsx@@ -27,6 +27,9 @@ const badgeVariants = cva(teal: "border-transparent bg-light-teal text-dark-teal",green: "border-transparent bg-light-green text-dark-green",ghost: "border-0 bg-transparent px-0 text-foreground-secondary",+ /** `ghost` with the leading icon in the warning colour; the text stays muted. */+ "ghost-warning":+ "border-0 bg-transparent px-0 text-foreground-secondary",filled: "border-transparent bg-muted text-foreground-secondary",/** `filled` for a chip on a muted or accent surface, e.g. a selected or hovered row, where `bg-muted` vanishes. */filledOnMuted:@@ -153,9 +156,17 @@ export function Badge({trailingIconTone = "default",...props}: BadgeProps) {+ const warningIcon = color === "ghost-warning";return (<BadgeShell color={color} shouldWrap={shouldWrap} {...props}>- {LeadingIcon && <LeadingIcon aria-hidden size="sm" color="tertiary" />}+ {LeadingIcon && (+ <LeadingIcon+ aria-hidden+ size="sm"+ color={warningIcon ? "inherit" : "tertiary"}+ __rawClassName={warningIcon ? "text-dark-yellow" : undefined}+ />+ )}{label && <span className="shrink-0 py-0.5">{label}:</span>}<spanclassName={cn(diff --git a/web/src/components/design-system/TextLink/TextLink.stories.tsx b/web/src/components/design-system/TextLink/TextLink.stories.tsxindex 4b7f0a66e7..68edded2d1 100644--- a/web/src/components/design-system/TextLink/TextLink.stories.tsx+++ b/web/src/components/design-system/TextLink/TextLink.stories.tsx@@ -22,3 +22,11 @@ export const WithIcon = meta.story({icon: User,},});++export const External = meta.story({+ args: {+ path: "https://langfuse.com/docs",+ value: "Docs",+ external: true,+ },+});diff --git a/web/src/components/design-system/TextLink/TextLink.tsx b/web/src/components/design-system/TextLink/TextLink.tsxindex f0643273df..317c0f8a99 100644--- a/web/src/components/design-system/TextLink/TextLink.tsx+++ b/web/src/components/design-system/TextLink/TextLink.tsx@@ -7,12 +7,15 @@ export function TextLink({icon,onClick,title,+ external = false,}: {path: string;value: string;icon?: IconComponent;onClick?: (event: React.MouseEvent) => void;title?: string;+ /** Opens in a new tab. */+ external?: boolean;}) {const Icon = icon;const handleClick = (event: React.MouseEvent) => {@@ -32,6 +35,7 @@ export function TextLink({title={title ?? value}prefetch={false}onClick={handleClick}+ {...(external && { target: "_blank", rel: "noopener noreferrer" })}><span className="inline-block max-w-full overflow-hidden align-middle leading-normal text-nowrap text-ellipsis">{Icon ? (diff --git a/web/src/features/traces/components/ObservationMetadataBadgesTooltip.tsx b/web/src/features/traces/components/ObservationMetadataBadgesTooltip.tsxindex 6892aacabe..aafbeabe92 100644--- a/web/src/features/traces/components/ObservationMetadataBadgesTooltip.tsx+++ b/web/src/features/traces/components/ObservationMetadataBadgesTooltip.tsx@@ -72,10 +72,18 @@ function MissingCostBadge({ projectId }: { projectId: string }) {No model price matched this generation. Add a model price, or sendthe cost from your SDK.</p>- <TextLink- path={`/project/${encodeURIComponent(projectId)}/settings/models`}- value="Model settings"- />+ <div className="flex items-center gap-1.5">+ <TextLink+ path={`/project/${encodeURIComponent(projectId)}/settings/models`}+ value="Model settings"+ />+ <span className="text-muted-foreground text-xs">·</span>+ <TextLink+ path="https://langfuse.com/docs/model-usage-and-cost"+ value="Docs"+ external+ />+ </div></div>}>@@ -83,7 +91,7 @@ function MissingCostBadge({ projectId }: { projectId: string }) {<span {...getTriggerProps()} className="inline-flex" tabIndex={0}><Badgefont="mono"- color="ghost"+ color="ghost-warning"interactiveleadingIcon={TriangleAlert}text="no cost"