🪢 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
chore(design-sync): apply fixes from the daily design-system sync (#19297)
Mark Salpeterf0eb9e940430
diff --git a/.design-sync/NOTES.md b/.design-sync/NOTES.mdindex fc928f5165..04b1cad134 100644--- a/.design-sync/NOTES.md+++ b/.design-sync/NOTES.md@@ -25,7 +25,8 @@- Public assets: LangfuseIcon/LangfuseLogo load `${NEXT_PUBLIC_BASE_PATH ?? ""}/icon.svg|wordart-*.svg` from web/public. The bundle ships no loose files (the build wipes ds-bundle/), so `gen-entry.sh` discovers those paths in DS sources and generates `public-assets.js` (data URLs + an `<img src>` remap via `setAttribute`/`src` setter), imported right after process-shim.js. The reference was broken too - `.ds-sync/storybook/http-serve.mjs` serves `.svg` as octet-stream - so copy-css.sh injects the same script into `sb-reference/iframe.html` (`data-ds-sync-assets`, replaced each run). Run gen-entry.sh before copy-css.sh.- `ds-package/csf-factories-preview.tsx` + `overrides/story-imports.mjs`: stories use CSF factories (`preview.meta().story()`), which need Storybook's runtime ("definePreview is not a function"). The fork redirects `web/.storybook/preview.*` to the shim, which flattens factory stories to CSF3 and maps `globals.theme === "dark"` to a `.dark` wrapper div. It also runs meta + story `beforeEach` hooks once before first render (cleanup on unmount): AppSidebar's Launch Week stories pin `Date.now` there, and without it the frozen capture clock expired those notifications.- `overrides/dts.mjs`: ts-morph `.d.ts` extraction for TS source (baseUrl web + `@/*`, @types/react from web/node_modules, resolveSourceFileDependencies). Two forks for the shared components: `pkgDir` is `web/src` (not the design-system dir), so their own `on*` callbacks survive the DOM-noise filter; and `propsBodyFor` looks up `<Name>Props` in the component's own file first, because with the wider `pkgDir` another file's `InputProps` was winning.-- `cfg.storyImports.shim` lists the shared modules whose filename doesn't match the export (`ai-assisted-input.tsx`, `drawer.tsx`, `MarkdownViewer.tsx`, `grouped-score-badge.tsx`) plus `ui/sidebar.tsx`. Without the shim the preview bundles a second source copy, which loses LangfuseProvider's contexts ("`Tooltip` must be used within `TooltipProvider`", "useSidebar must be used within a Sidebar"). `mobile-page-actions-content.tsx` stays unshimmed: its story imports a non-exported name (ui `Popover`). `ScoreTag.tsx` (renamed from `score-tag.tsx` upstream) now matches its export, so story imports redirect it to the bundle; gen-entry.sh therefore also exports `SCORE_LEVEL_LABELS`, which `ScoreTag.stories.tsx` imports (without it: `Cannot convert undefined or null to object`, empty ScoreTag card). A story importing a non-component name from a module whose filename matches its export needs that name in gen-entry.sh.+- `cfg.storyImports.shim` lists the shared modules whose filename doesn't match the export (`drawer.tsx`, `MarkdownViewer.tsx`) plus `ui/sidebar.tsx`. Without the shim the preview bundles a second source copy, which loses LangfuseProvider's contexts ("`Tooltip` must be used within `TooltipProvider`", "useSidebar must be used within a Sidebar"). Modules whose filename matches their export (`ScoreTag.tsx`, and since 2026-10-22 `ui/AIAssistedInput.tsx`, `GroupedScoreBadges.tsx`, `layouts/MobilePageActionsContent.tsx` - renamed from kebab-case upstream) redirect to the bundle without a shim entry. The shim list still carries the dead `ai-assisted-input.tsx`/`grouped-score-badge.tsx` patterns (they match nothing): `cfg.storyImports` is in the GLOBAL grade key, so editing it re-grades all ~82 components - drop them only when a global re-grade happens anyway. gen-entry.sh also exports `SCORE_LEVEL_LABELS`, which `ScoreTag.stories.tsx` imports (without it: `Cannot convert undefined or null to object`, empty ScoreTag card). A story importing a non-component name from a module whose filename matches its export needs that name in gen-entry.sh.+- MobilePageActionsContent (2026-10-22): after the rename it redirects to the bundle, while its story's `<Popover>` (ui/popover, lowercase filename -> never shimmed) bundled a second copy -> "`PopoverPortal` must be used within `Popover`". Fix without touching the global key: gen-entry.sh exports ui `Popover`, `PopoverTrigger` (no DS name clash; the design agent needs them to open MobilePageActionsContent anyway), and owned `previews/MobilePageActionsContent.tsx` mirrors the story importing both from the package.- `SidebarProvider` + `SidebarInset` are exported because `AppSidebar` can't render outside them.## Fonts@@ -71,7 +72,9 @@- process-shim.js mirrors `.env.dev.example` NEXT_PUBLIC_* values; if a value there starts gating a component's render, the preview follows the dev example, not prod.- New web/public assets referenced via `NEXT_PUBLIC_BASE_PATH ?? ""}/...` are picked up by gen-entry.sh automatically; other static paths (e.g. Avatar's `/apple-touch-icon.png`) need an owned preview.- Shared app components: a new kebab-named (or otherwise export-mismatched) module a story imports must join `cfg.storyImports.shim`, or its preview bundles a second copy and loses provider contexts. New shared components also need a line in gen-entry.sh's heredoc. MediaTag's Wikimedia story stays unverified while capture runs sandboxed.-- Owned preview: `previews/Avatar.tsx` shadows the generated one - re-check it when Avatar stories change.+- Owned previews: `previews/Avatar.tsx` and `previews/MobilePageActionsContent.tsx` shadow the generated ones - re-check them when those stories change (`[STORY_CHANGED]`).+- DateRangeInput (added 2026-10-22): all four `(Test)` stories open the popover in play() -> skipped by id; the three `features-evaluations-...-daterangeinput--*` stories (an out-of-scope `web/src/features` component of the same name, whose props differ -> `Cannot read properties of undefined (reading 'find')`) are skipped by id too. Only `Default` (closed trigger) is graded; popover content is unverified.+- Upstream file renames break gen-entry.sh's explicit shared list first (`[UNRESOLVED_IMPORT] ... missing from node_modules` from `ds-package/index.ts`): update the module path there and re-run gen-entry.sh - the driver does NOT run `buildCmd`.- Story `beforeEach` runs in the preview shim (see Build fixes); a story relying on Storybook loaders, `mount`, or async `beforeEach` work will still diverge.- Late mount (2026-10-19): `_preview/Table.js` and `_preview/DataTable.js` are ~4.8MB (zod, `@langfuse/shared` dist, posthog, next) and finish executing ~1s after `networkidle`. Validate then fails `[RENDER] ... root empty` and compare reports every story `unpaired`, although the cards render fine. The fix is a local wait in the staged harness (lost on every restage - re-apply after the `cp -r`): in `.ds-sync/package-validate.mjs` before the big `page.evaluate`, `await page.waitForFunction(() => [...document.querySelectorAll('#root, [id^="r"]')].some((r) => r.innerHTML.trim().length), null, { timeout: 15_000 }).catch(() => {})`; in `.ds-sync/storybook/compare.mjs` wait for `Array.isArray(window.__dsCells)` before the pairing `evaluate`, and for `#r0` content in `storyShot` before `settleRender`. Better long-term: shrink those previews (they pull the server-side shared barrel).- The driver applies `--max-stories` to every component; without it Table/DataTable are capped at 6 stories. Run compare for Table (`--max-stories 120`) and DataTable (`--max-stories 20`) separately when they are in scope.diff --git a/.design-sync/config.json b/.design-sync/config.jsonindex 52a6794247..1bbd6e4b9b 100644--- a/.design-sync/config.json+++ b/.design-sync/config.json@@ -301,6 +301,17 @@"playground-datatable--removed-lower-handle-rolls-back-preview","playground-datatable--removed-keyboard-handle-cancels-resize"]+ },+ "DateRangeInput": {+ "skip": [+ "design-components-daterangeinput--test-preset-selection",+ "design-components-daterangeinput--test-whole-day-selection",+ "design-components-daterangeinput--test-end-time-outside-rolling-lookback",+ "design-components-daterangeinput--test-start-time-clamped-to-earliest",+ "features-evaluations-evaluators-evaluatorbackfillsettings-daterangeinput--default",+ "features-evaluations-evaluators-evaluatorbackfillsettings-daterangeinput--bounded",+ "features-evaluations-evaluators-evaluatorbackfillsettings-daterangeinput--disabled"+ ]}},"extraFonts": [diff --git a/.design-sync/ds-package/gen-entry.sh b/.design-sync/ds-package/gen-entry.shindex deeb303bf1..d8a44ea929 100755--- a/.design-sync/ds-package/gen-entry.sh+++ b/.design-sync/ds-package/gen-entry.sh@@ -77,7 +77,7 @@ JSwhile read -r mod names; do echo "export { $names } from \"$S/$mod\";"; done <<'EOF'CrashModal/CrashModal CrashModalEnvLabelBadge EnvLabelBadge-grouped-score-badge GroupedScoreBadges+GroupedScoreBadges GroupedScoreBadgesItemBadge ItemBadge, ItemTypeIconMediaFileCard/MediaFileCard MediaFileCardMediaTag/MediaTag MediaTag@@ -85,7 +85,8 @@ OrganizationDropdownMenu/OrganizationDropdownMenu OrganizationDropdownMenuProjectDropdownMenu/ProjectDropdownMenu ProjectDropdownMenuScoreBadge/ScoreBadge ScoreBadgeScoreTag ScoreTag, SCORE_LEVEL_LABELS-layouts/mobile-page-actions-content MobilePageActionsContent+layouts/MobilePageActionsContent MobilePageActionsContent+ui/popover Popover, PopoverTriggernav/AppSidebar/AppSidebar AppSidebaronboarding/components/EvaluatorsOnboardingView/EvaluatorsOnboardingView EvaluatorsOnboardingViewtable/ColumnVisibilityHeader ColumnVisibilityHeader@@ -96,7 +97,7 @@ table/OverviewSelectionBar/OverviewSelectionBar OverviewSelectionBartable/table-view-presets/components/TableViewPresetsButton TableViewPresetsButtonui/MarkdownViewer MarkdownViewui/StatusBadge/StatusBadge StatusBadge-ui/ai-assisted-input AIAssistedInput+ui/AIAssistedInput AIAssistedInputui/drawer Drawer, DrawerController, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescriptionui/sidebar SidebarProvider, SidebarInsetEOFdiff --git a/.design-sync/previews/MobilePageActionsContent.tsx b/.design-sync/previews/MobilePageActionsContent.tsxnew file mode 100644index 0000000000..a02dd17b60--- /dev/null+++ b/.design-sync/previews/MobilePageActionsContent.tsx@@ -0,0 +1,43 @@+import * as React from "react";+import {+ LayoutDashboard,+ PencilIcon,+ SlidersHorizontal,+} from "@langfuse/icons";+import { Button } from "../../web/src/components/ui/button";+import {+ MobilePageActionsContent,+ Popover,+ PopoverTrigger,+} from "@langfuse/design-system";++// Mirrors mobile-page-actions-content.stories.tsx "Mixed page controls".+// Popover/PopoverTrigger come from the bundle so they share a context with the+// bundled MobilePageActionsContent (it renders the ui PopoverContent).+export const MixedPageControls = () => (+ <Popover defaultOpen>+ <PopoverTrigger asChild>+ <Button variant="outline">More actions</Button>+ </PopoverTrigger>+ <MobilePageActionsContent onCloseAutoFocus={() => {}}>+ <div className="flex flex-col gap-1">+ <span className="text-muted-foreground px-2 text-xs">Dashboard</span>+ <Button variant="outline" className="w-full justify-start gap-2">+ <LayoutDashboard size="base" color="default" />+ Langfuse Home+ </Button>+ <Button variant="ghost" className="w-full justify-start gap-2">+ <PencilIcon size="base" color="default" />+ Edit dashboard+ </Button>+ </div>+ <div className="flex flex-col gap-1 border-t pt-2">+ <span className="text-muted-foreground px-2 text-xs">Data</span>+ <Button variant="outline" className="w-full justify-start gap-2">+ <SlidersHorizontal size="base" color="default" />+ Environment and filters+ </Button>+ </div>+ </MobilePageActionsContent>+ </Popover>+);