🪢 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 (#19031)
Mark Salpeterbd328dc855a1
diff --git a/.design-sync/NOTES.md b/.design-sync/NOTES.mdindex 5254e44543..fc928f5165 100644--- a/.design-sync/NOTES.md+++ b/.design-sync/NOTES.md@@ -7,6 +7,8 @@## Setup / prerequisites+- Chromium: the staged `.ds-sync` playwright can need a newer headless shell than the preinstalled one (`[RENDER_SKIPPED] ... Executable doesn't exist at /opt/pw-browsers/chromium_headless_shell-<rev>`) - run `(cd .ds-sync && npx playwright install chromium)`.+- Env: build Storybook with the committed `.env.dev.example` (`npx dotenv -e ../.env.dev.example`), never the main checkout's `.env` (may hold secrets). `gen-entry.sh` mirrors its `NEXT_PUBLIC_*` values into `process-shim.js`.- Build `@langfuse/shared` first (`pnpm --filter=@langfuse/shared exec prisma generate && pnpm --filter=@langfuse/shared build`) - the bundle resolves its `dist/`; missing dist = WORKSPACE_SIBLING failures.- `.design-sync/node_modules` must be a symlink to `../.ds-sync/node_modules` (gitignored; recreate per clone) - `overrides/dts.mjs` needs ts-morph from there.@@ -23,7 +25,7 @@- 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"). `score-tag.tsx` and `mobile-page-actions-content.tsx` stay unshimmed: their stories import non-exported names (`SCORE_LEVEL_LABELS`, ui `Popover`).+- `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.- `SidebarProvider` + `SidebarInset` are exported because `AppSidebar` can't render outside them.## Fonts@@ -34,7 +36,7 @@## Preview / grading decisions- `[PORTAL?]` fires on EVERY component - false positive: LayerProvider always mounts `div[data-overlay-root]` with empty layer divs as a body child. Judge overlay bleed from the images; apply cardMode "single" only where overlay content visibly escapes.-- `play()` stories: Storybook runs a story's `play` before capture; static previews never do. Stories whose post-play state differs visibly (opened dialog/menu/tooltip, toggled format) are skipped via `cfg.overrides.<Name>.skip` - they're interaction tests, not design variants. `(Test)` stories whose play leaves the initial render unchanged stay and are graded. Skips live in `cfg.overrides.<Name>.skip` (overlays: every (Test) story that opens a menu/hover card/tooltip/dialog; charts: (Test) stories whose play opens a tooltip or toggles a series; Dialog/Avatar/Codeblock interaction tests; GroupedScoreBadges "(Test) With Overflow", KeyValueFilterBuilder "(Test) Observed Key Suggestion Preserves Value", MarkdownView "(Test) Reveals Header Controls On Focus"). A play() that only leaves a focus ring (Accordion/Alert/Callout dismiss tests, chart legend buttons, IconButton/Toggle clicks, form-input (Test) stories, Table actions trigger, AIAssistedInput retrigger) is graded match - focus residue is not a design difference.+- `play()` stories: Storybook runs a story's `play` before capture; static previews never do. Stories whose post-play state differs visibly (opened dialog/menu/tooltip, toggled format) are skipped via `cfg.overrides.<Name>.skip` - they're interaction tests, not design variants. `(Test)` stories whose play leaves the initial render unchanged stay and are graded. Skips live in `cfg.overrides.<Name>.skip` (overlays: every (Test) story that opens a menu/hover card/tooltip/dialog; charts: (Test) stories whose play opens a tooltip or toggles a series; Dialog/Avatar/Codeblock interaction tests (incl. Dialog "(Test) Scrollable body keeps controls above footer", which opens the dialog); GroupedScoreBadges "(Test) With Overflow", KeyValueFilterBuilder "(Test) Observed Key Suggestion Preserves Value", MarkdownView "(Test) Reveals Header Controls On Focus"). A play() that only leaves a focus ring (Accordion/Alert/Callout dismiss tests, chart legend buttons, IconButton/Toggle clicks, form-input (Test) stories, Table actions trigger, AIAssistedInput retrigger) is graded match - focus residue is not a design difference.- Button absorbs 7 `Playground/Button` stories from `src/components/ui/Button.stories.tsx` (out of scope) - skipped by id.- Table absorbs ~88 `Table/Columns/create*TableColumn` stories (titleParts match "Table"; titleMap can't exclude) - kept under Table with cardMode single, primaryStory Default.- Avatar: owned `previews/Avatar.tsx` - Default story's `src: "/apple-touch-icon.png"` is a Storybook staticDirs path; the owned preview imports the file (esbuild dataurl) instead.@@ -48,6 +50,7 @@- Padded-layout framing: sb captures crop to the 868px story root at 0,0; ds captures are 900px with the card's 24px body inset, so full-width content is 16px narrower in ds. Framing only - graded match everywhere (Tabs, CodeSection, Button, Table columns, ...).- Meta decorators apply twice (fixed, 2026-10-18): `makeStory` in `csf-factories-preview.tsx` merges meta decorators into `story.decorators`, and the preview generator (`preview-gen-storybook.mjs:60`) concatenates `meta.decorators` again, which doubled the `p-4` inset on DataTable and the 8 charts. `preview.meta` now omits `decorators` from the meta fields it returns. The 9 components were regraded after the fix and are pixel-identical apart from play() focus residue. The shim is not grade-keyed, so any later shim edit needs the affected grade.json files deleted by hand.- Table Actor/Button column stories don't set `layout: "fullscreen"`, so the preview keeps the 24px card inset storybook lacks - framing only, graded match.+- SortableList is excluded (`cfg.titleMap {SortableList: null}`; still in the bundle via the design-system `export *`): both stories are play() tests - "(Test) Sorting Inside a Dialog" ends with the dialog closed, "(Test) Different Height Rows..." ends with the rows visibly reordered in storybook - so no static story can be verified. Drop the titleMap entry once a story without play() exists.- ChartTooltip (`internal/charts`) is excluded (`cfg.titleMap {ChartTooltip: null}` + not exported by gen-entry.sh): all 10 stories render the tooltip only after play() hover/focus; charts render it internally.- ConfirmationDialogController: the converter pairs stories to exports by display name first, so stories "Standard"/"Type to confirm" (exports `StandardExample`/`TypeToConfirmExample`) render the `(Test)` exports `Standard`/`TypeToConfirm` - identical args, so harmless; both `(Test)` stories are skipped. Revisit if their args diverge.- OrganizationDropdownMenu/ProjectDropdownMenu: no story opens the menu (render-prop trigger, no `open`/play), so compare verifies only the trigger; the menu content is unverified.@@ -70,6 +73,8 @@- 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.- 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.- Play-state skips are by story id; renamed stories silently lose their skip (compare then shows the post-play delta - re-skip).- Story caps (Table 120, Tabs 24), Table name collisions, ConfirmationDialogController pairing and HoverCard "(Test) Delayed" timing (see above).- A new Storybook framework mock (router, image, font) is invisible to the bundle - a blank or throwing preview usually means one is missing from LangfuseProvider.diff --git a/.design-sync/config.json b/.design-sync/config.jsonindex 992fb59fd8..52a6794247 100644--- a/.design-sync/config.json+++ b/.design-sync/config.json@@ -127,7 +127,8 @@"skip": ["design-components-dialog--autofocus","design-components-dialog--destructive-autofocus",- "design-components-dialog--destructive-only-autofocus"+ "design-components-dialog--destructive-only-autofocus",+ "design-components-dialog--scrollable-body-keeps-controls-above-footer"]},"Avatar": {@@ -311,7 +312,8 @@"mobile-page-actions-content": "MobilePageActionsContent","MarkdownViewer": "MarkdownView","ai-assisted-input": "AIAssistedInput",- "drawer": "Drawer"+ "drawer": "Drawer",+ "SortableList": null},"readmeHeader": ".design-sync/conventions.md","storyImports": {diff --git a/.design-sync/ds-package/gen-entry.sh b/.design-sync/ds-package/gen-entry.shindex 2ca22fed4c..c53fb3c1a3 100755--- a/.design-sync/ds-package/gen-entry.sh+++ b/.design-sync/ds-package/gen-entry.sh@@ -82,7 +82,7 @@ MediaTag/MediaTag MediaTagOrganizationDropdownMenu/OrganizationDropdownMenu OrganizationDropdownMenuProjectDropdownMenu/ProjectDropdownMenu ProjectDropdownMenuScoreBadge/ScoreBadge ScoreBadge-score-tag ScoreTag+ScoreTag ScoreTag, SCORE_LEVEL_LABELSlayouts/mobile-page-actions-content MobilePageActionsContentnav/AppSidebar/AppSidebar AppSidebaronboarding/components/EvaluatorsOnboardingView/EvaluatorsOnboardingView EvaluatorsOnboardingView