🪢 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(v4): keep the migration modal close button clear of the status link (#15582)
Trang Nguyened5792e4ba66
diff --git a/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx b/web/src/features/v4-migration/V4MigrationContent.clienttest.tsxindex 944b537bd6..ab0607dab1 100644--- a/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx+++ b/web/src/features/v4-migration/V4MigrationContent.clienttest.tsx@@ -204,4 +204,19 @@ describe("V4MigrationHeaderContent", () => {screen.queryByText(/This project still uses the previous setup/),).not.toBeInTheDocument();});++ it("reserves a close-button gutter on the title row when the host asks", () => {+ // The modal host floats the dialog's fallback close button over the+ // body's top-right corner; without the gutter it overlaps the+ // right-aligned status link.+ render(+ <V4MigrationHeaderContent+ projectId="project-1"+ titleRowClassName="pr-6"+ />,+ );+ const link = screen.getByRole("link", { name: "View Status" });+ expect(link).toHaveAttribute("href", "/v4-migration");+ expect(link.parentElement).toHaveClass("pr-6");+ });});diff --git a/web/src/features/v4-migration/V4MigrationContent.tsx b/web/src/features/v4-migration/V4MigrationContent.tsxindex 844ed6383a..dfd396b1b0 100644--- a/web/src/features/v4-migration/V4MigrationContent.tsx+++ b/web/src/features/v4-migration/V4MigrationContent.tsx@@ -289,11 +289,17 @@ export function V4MigrationHeaderContent({projectName,projectId,onNavigate,+ titleRowClassName,}: {projectName?: string;projectId?: string;/** Fires when an internal link is followed so the surface can close. */onNavigate?: () => void;+ /** Extra classes on the title row. The modal host passes a right gutter:+ * its dialog floats a fallback close button over the body's top-right+ * corner (the title is sr-only, so there is no DialogHeader row), which+ * would otherwise overlap the right-aligned status link. */+ titleRowClassName?: string;}) {const capture = usePostHogClientCapture();const handleCopyPrompt = useCopyMigrationPrompt();@@ -319,7 +325,12 @@ export function V4MigrationHeaderContent({return (<>- <div className="mb-1.5 flex items-baseline justify-between gap-2">+ <div+ className={cn(+ "mb-1.5 flex items-baseline justify-between gap-2",+ titleRowClassName,+ )}+ ><p className="min-w-0 text-lg font-bold">{projectName ? <>Migrate {projectName} to v4</> : "Migrate to v4"}</p>@@ -331,7 +342,7 @@ export function V4MigrationHeaderContent({}}className="shrink-0 text-sm underline">- Migration Status+ View Status</Link></div><p className="text-muted-foreground mb-3 text-sm leading-relaxed">@@ -437,7 +448,8 @@ export function V4MigrationDetailsContent({<div className="flex flex-col gap-3"><div className="flex items-center justify-between gap-2"><div className="flex items-center gap-2 text-base font-bold">- <LibraryBig className="h-4 w-4" /> Want to review first?+ <LibraryBig className="h-4 w-4 shrink-0" /> Want to review+ first?</div><V4PreviewToggleRow projectId={projectId} /></div>@@ -460,8 +472,8 @@ export function V4MigrationDetailsContent({<div className="flex flex-col gap-3"><div className="flex items-center justify-between gap-2"><div className="flex items-center gap-2 text-base font-bold">- <TriangleAlert className="h-4 w-4" /> What happens if I don't- update?+ <TriangleAlert className="h-4 w-4 shrink-0" /> What happens if I+ don't update?</div><ahref={V4_DOCS_URL}@@ -668,7 +680,7 @@ export function V4MigrationDetailsContent({<div className="flex flex-col gap-3"><div className="flex items-center gap-2 text-base font-bold">- <LifeBuoy className="h-4 w-4" /> Contact us+ <LifeBuoy className="h-4 w-4 shrink-0" /> Contact us</div><p className="text-muted-foreground text-sm">Need a hand with the update? We're here to help!diff --git a/web/src/features/v4-migration/V4MigrationModal.tsx b/web/src/features/v4-migration/V4MigrationModal.tsxindex dd5132961b..6ca929901e 100644--- a/web/src/features/v4-migration/V4MigrationModal.tsx+++ b/web/src/features/v4-migration/V4MigrationModal.tsx@@ -63,6 +63,8 @@ function V4MigrationModalContent({projectName={project.name}projectId={project.id}onNavigate={() => setOpen(false)}+ // Clear the dialog's floating fallback close button (top-right).+ titleRowClassName="pr-6"/><Separator className="my-6" /><div className="flex flex-col gap-6">