Skip to content

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

feat(preview): expose v4 migration UI flag (#15651)

Max Deichmanna4312e2938d8
diff --git a/web/src/__tests__/server/userAccount.servertest.ts b/web/src/__tests__/server/userAccount.servertest.ts
index 40d93fe09d..4e201f8111 100644
--- a/web/src/__tests__/server/userAccount.servertest.ts
+++ b/web/src/__tests__/server/userAccount.servertest.ts
@@ -41,6 +41,29 @@ describe("userAccountRouter.setFeaturePreviewEnabled", () => {
expect(user.featureFlags).toEqual(["templateFlag", "modernSession"]);
});
+ it("enables the V4 migration UI preview, leaving other flags intact", async () => {
+ const { caller, userId } = await createCaller({
+ featureFlags: ["templateFlag"],
+ });
+
+ const result = await caller.userAccount.setFeaturePreviewEnabled({
+ flag: "v4UpgradeUi",
+ enabled: true,
+ });
+
+ expect(result).toEqual({
+ success: true,
+ flag: "v4UpgradeUi",
+ enabled: true,
+ });
+
+ const user = await prisma.user.findUniqueOrThrow({
+ where: { id: userId },
+ select: { featureFlags: true },
+ });
+ expect(user.featureFlags).toEqual(["templateFlag", "v4UpgradeUi"]);
+ });
+
it("disables a preview flag without touching the others", async () => {
const { caller, userId } = await createCaller({
featureFlags: ["templateFlag", "modernSession"],
@@ -153,6 +176,7 @@ async function createCaller({
modernSession: featureFlags.includes("modernSession"),
searchBar: featureFlags.includes("searchBar"),
templateFlag: featureFlags.includes("templateFlag"),
+ v4UpgradeUi: featureFlags.includes("v4UpgradeUi"),
excludeClickhouseRead: false,
observationEvals: false,
v4BetaToggleVisible: false,
diff --git a/web/src/features/feature-previews/components/ControlledFeaturePreviewModal.tsx b/web/src/features/feature-previews/components/ControlledFeaturePreviewModal.tsx
index 9b42139369..226b2b37f8 100644
--- a/web/src/features/feature-previews/components/ControlledFeaturePreviewModal.tsx
+++ b/web/src/features/feature-previews/components/ControlledFeaturePreviewModal.tsx
@@ -20,6 +20,7 @@ type ControlledFeaturePreviewModalProps = {
const PREVIEW_LABEL: Record<PreviewFlag, string> = {
modernSession: "Compact Session View",
searchBar: "Filter Search Bar",
+ v4UpgradeUi: "V4 Migration",
};
export function ControlledFeaturePreviewModal({
@@ -68,6 +69,11 @@ export function ControlledFeaturePreviewModal({
onToggle: onToggle("modernSession"),
isToggling: setFeaturePreviewEnabled.isPending,
},
+ v4UpgradeUi: {
+ enabled: authSession.data?.user?.featureFlags.v4UpgradeUi === true,
+ onToggle: onToggle("v4UpgradeUi"),
+ isToggling: setFeaturePreviewEnabled.isPending,
+ },
// The "Filter Search Bar" preview is retired — the bar is now generally
// available on the v4 events tables for everyone (see useSearchBarEnabled),
// so it no longer renders a tile here. The `searchBar` flag plumbing
diff --git a/web/src/features/feature-previews/components/FeaturePreviewModal.stories.tsx b/web/src/features/feature-previews/components/FeaturePreviewModal.stories.tsx
index fbf43e9ad2..4eb59288e7 100644
--- a/web/src/features/feature-previews/components/FeaturePreviewModal.stories.tsx
+++ b/web/src/features/feature-previews/components/FeaturePreviewModal.stories.tsx
@@ -57,6 +57,7 @@ const meta = preview.meta({
onOpenChange: fn(),
state: {
modernSession: { enabled: false, onToggle: fn(), isToggling: false },
+ v4UpgradeUi: { enabled: false, onToggle: fn(), isToggling: false },
},
},
render: StatefulFeaturePreviewModal,
diff --git a/web/src/features/feature-previews/components/FeaturePreviewModal.tsx b/web/src/features/feature-previews/components/FeaturePreviewModal.tsx
index 36cb1967af..bbd8a01b01 100644
--- a/web/src/features/feature-previews/components/FeaturePreviewModal.tsx
+++ b/web/src/features/feature-previews/components/FeaturePreviewModal.tsx
@@ -23,12 +23,14 @@ import modernSessionLightIllustration from "../assets/modern-session-light.svg";
* `searchBar` is retired and no longer renders a tile — see
* ControlledFeaturePreviewModal. It remains as rollback plumbing.
* TODO(remove ~2026-06-19): drop "searchBar" once GA is confirmed. */
-export type PreviewFlag = "modernSession" | "searchBar";
+export type PreviewFlag = "modernSession" | "searchBar" | "v4UpgradeUi";
type PreviewIllustration = {
light: React.ComponentProps<typeof Image>["src"];
dark: React.ComponentProps<typeof Image>["src"];
alt: string;
+ width?: number;
+ height?: number;
};
type PreviewRegistryItem = {
@@ -69,6 +71,23 @@ const PREVIEW_REGISTRY: PreviewRegistryItem[] = [
alt: "Compact Session View showing a trace minimap beside a continuous session conversation feed.",
},
},
+ {
+ flag: "v4UpgradeUi",
+ title: "V4 Migration",
+ sidebarLabel: "V4 Migration",
+ description:
+ "Review each project's readiness for Langfuse v4 and get guided steps for anything that still needs an update.",
+ details:
+ "The V4 Migration experience adds a migration status page, project-level readiness indicators, and contextual upgrade guidance for SDKs, evaluators, deprecated APIs, and integrations.",
+ feedbackUrl: "https://github.com/orgs/langfuse/discussions",
+ illustration: {
+ light: "/assets/v4-beta-intro.jpg",
+ dark: "/assets/v4-beta-intro.jpg",
+ alt: "Langfuse v4 performance improvements across common observability workflows.",
+ width: 1024,
+ height: 598,
+ },
+ },
// TODO(remove ~2026-06-19): dead registry entry — "searchBar" is GA on the v4
// events tables and no longer surfaced in the dialog (no state entry in
// ControlledFeaturePreviewModal), so this is filtered out and never renders.
@@ -231,11 +250,15 @@ function PreviewMockupPanel({
<Image
src={illustration.light}
alt={illustration.alt}
+ width={illustration.width}
+ height={illustration.height}
className="block h-auto w-full dark:hidden"
/>
<Image
src={illustration.dark}
alt={illustration.alt}
+ width={illustration.width}
+ height={illustration.height}
className="hidden h-auto w-full dark:block"
/>
</div>
diff --git a/web/src/server/api/routers/userAccount.ts b/web/src/server/api/routers/userAccount.ts
index 530df63cb3..07e00631e5 100644
--- a/web/src/server/api/routers/userAccount.ts
+++ b/web/src/server/api/routers/userAccount.ts
@@ -102,9 +102,9 @@ export const userAccountRouter = createTRPCRouter({
z.object({
// Allowlist of user-toggleable Feature Preview flags (the Feature
// Preview modal). Keep in sync with the modal's preview registry.
- // `modernSession` is the active preview. `searchBar` is retired — the
- // bar is now GA on v4 events tables — but remains as rollback plumbing.
- flag: z.enum(["modernSession", "searchBar"]),
+ // `searchBar` is retired — the bar is now GA on v4 events tables —
+ // but remains as rollback plumbing.
+ flag: z.enum(["modernSession", "searchBar", "v4UpgradeUi"]),
enabled: z.boolean(),
}),
)