Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(ui): remove legacy page header after final consumers migrate (#8429)

Andrew Huangce45af926e1d
diff --git a/.greptile/config.json b/.greptile/config.json
index 100b1b2968..dfc8a73f0d 100644
--- a/.greptile/config.json
+++ b/.greptile/config.json
@@ -22,7 +22,7 @@
},
{
"id": "no-design-system-style-overrides",
- "rule": "New UI must not override or deviate from the default styling of v3 design-system components (frontend/src/components/v3). Follow DESIGN.md. Flag: legacy v2 color tokens (e.g. mineshaft-*, bunker-*) instead of semantic tokens like bg-org or text-danger; casing changes such as uppercase text; className overrides of component defaults like height or border; and hex colors not defined in frontend/src/index.css. Inline styling must be a deliberate exception, not a default. If the same inline style is repeated across call sites, suggest a new component variant or a component update instead. Do not use v2 components for new code when a v3 equivalent exists (PageHeader is the known exception).",
+ "rule": "New UI must not override or deviate from the default styling of v3 design-system components (frontend/src/components/v3). Follow DESIGN.md. Flag: legacy v2 color tokens (e.g. mineshaft-*, bunker-*) instead of semantic tokens like bg-org or text-danger; casing changes such as uppercase text; className overrides of component defaults like height or border; and hex colors not defined in frontend/src/index.css. Inline styling must be a deliberate exception, not a default. If the same inline style is repeated across call sites, suggest a new component variant or a component update instead. Do not use v2 components for new code when a v3 equivalent exists.",
"severity": "medium",
"scope": ["frontend/src/**"]
},
diff --git a/frontend/src/components/COMPONENT_LIFECYCLE.md b/frontend/src/components/COMPONENT_LIFECYCLE.md
index 406d61cdbe..873dfe33c3 100644
--- a/frontend/src/components/COMPONENT_LIFECYCLE.md
+++ b/frontend/src/components/COMPONENT_LIFECYCLE.md
@@ -12,7 +12,7 @@ The [V3 migration ledger](V3_MIGRATION.md) tracks source removal, coverage, and
| `Button`, `Card`, `Checkbox`, `EmptyState`, `IconButton`, `Input`, `Pagination`, `Select`, `Switch`, `TextArea`, `Tooltip` | Ready for focused deprecation | Supported V3 replacements exist. Check representative consumers before adding component-specific guidance. |
| `Accordion`, `Alert`, `CopyButton`, `Dropdown`, `HoverCardv2`, `Skeleton`, `Spinner`, `Table`, `Tabs` | Blocked | Composition, interaction, or state parity still needs verification. |
| `ConfirmActionModal`, `DeleteActionModal`, `Modal` | Blocked | Verify confirmation, menu-item, nested-overlay, and close behavior before directing consumers to V3 overlays. |
-| `ContentLoader`, `FormControl`, `GenericFieldLabel`, `PageHeader`, `Tag` | Blocked | The V3 replacements require consumer-specific composition or accessibility changes. |
+| `ContentLoader`, `FormControl`, `GenericFieldLabel`, `Tag` | Blocked | The V3 replacements require consumer-specific composition or accessibility changes. |
| `SecretInput`, `SecretPathInput` | Blocked | Security-sensitive or specialist behavior needs workflow-level parity validation. |
| `NoticeBannerV2` | Blocked | Verify that V3 `Alert` covers existing layout and action requirements. |
diff --git a/frontend/src/components/v2/PageHeader/PageHeader.tsx b/frontend/src/components/v2/PageHeader/PageHeader.tsx
deleted file mode 100644
index 2923d8ca86..0000000000
--- a/frontend/src/components/v2/PageHeader/PageHeader.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import { createElement } from "react";
-import { ReactNode } from "@tanstack/react-router";
-import { LucideIcon } from "lucide-react";
-import { twMerge } from "tailwind-merge";
-
-import { InstanceIcon, OrgIcon, ProjectIcon, SubOrgIcon } from "@app/components/v3";
-import { ProjectType } from "@app/hooks/api/projects/types";
-
-type Props = {
- title: ReactNode;
- description?: ReactNode;
- children?: ReactNode;
- className?: string;
- scope: "org" | "namespace" | "instance" | ProjectType | null;
- icon?: LucideIcon;
-};
-
-const SCOPE_BADGE: Record<NonNullable<Props["scope"]>, { icon: LucideIcon; className: string }> = {
- org: { className: "text-org", icon: OrgIcon },
- [ProjectType.SecretManager]: { className: "text-project", icon: ProjectIcon },
- [ProjectType.CertificateManager]: { className: "text-project", icon: ProjectIcon },
- [ProjectType.KMS]: { className: "text-project", icon: ProjectIcon },
- [ProjectType.PAM]: { className: "text-product-pam", icon: ProjectIcon },
- [ProjectType.AgentVault]: { className: "text-product-av", icon: ProjectIcon },
- [ProjectType.SecretScanning]: { className: "text-project", icon: ProjectIcon },
- namespace: { className: "text-sub-org", icon: SubOrgIcon },
- instance: { className: "text-neutral", icon: InstanceIcon }
-};
-
-export const PageHeader = ({ title, description, children, className, scope, icon }: Props) => {
- const resolvedIcon = icon ?? (scope ? SCOPE_BADGE[scope].icon : null);
- const iconClassName = scope ? SCOPE_BADGE[scope].className : "";
- return (
- <div className={twMerge("mb-10 w-full", className)}>
- <div className="flex w-full justify-between">
- <div className="mr-4 flex min-w-0 flex-1 items-center">
- <h1
- className={twMerge(
- "truncate font-alliance text-2xl font-normal text-foreground-inverse underline underline-offset-4",
- scope === "org" && "decoration-org/90",
- scope === "instance" && "decoration-neutral/90",
- scope === "namespace" && "decoration-sub-org/90",
- scope === ProjectType.PAM && "decoration-product-pam/90",
- scope === ProjectType.AgentVault && "decoration-product-av/90",
- scope !== ProjectType.PAM &&
- scope !== ProjectType.AgentVault &&
- Object.values(ProjectType).includes((scope as ProjectType) ?? "") &&
- "decoration-project/90",
- !scope && "no-underline"
- )}
- >
- {resolvedIcon &&
- createElement(resolvedIcon, {
- size: 26,
- className: twMerge(iconClassName, "mr-3 mb-1 inline-block")
- })}
- {title}
- </h1>
- </div>
- <div className="flex items-center gap-2">{children}</div>
- </div>
- <div className="mt-1.5 text-label">{description}</div>
- </div>
- );
-};
diff --git a/frontend/src/components/v2/PageHeader/index.tsx b/frontend/src/components/v2/PageHeader/index.tsx
deleted file mode 100644
index 275351a53a..0000000000
--- a/frontend/src/components/v2/PageHeader/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { PageHeader } from "./PageHeader";
diff --git a/frontend/src/components/v2/index.tsx b/frontend/src/components/v2/index.tsx
index 8b536044bb..5e96fd4891 100644
--- a/frontend/src/components/v2/index.tsx
+++ b/frontend/src/components/v2/index.tsx
@@ -17,7 +17,6 @@ export * from "./IconButton";
export * from "./Input";
export * from "./Modal";
export * from "./NoticeBannerV2";
-export * from "./PageHeader";
export * from "./Pagination";
export * from "./SecretInput";
export * from "./Select";
diff --git a/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx b/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
index 022e08a8d4..ad5efa72c6 100644
--- a/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
+++ b/frontend/src/pages/organization/BillingV2Page/BillingV2Page.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { PageHeader } from "@app/components/v2";
+import { PageHeader } from "@app/components/v3/platform";
import {
OrgPermissionBillingActions,
OrgPermissionSubjects,
diff --git a/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx b/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
index 25c8c7384f..50146cfae9 100644
--- a/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
+++ b/frontend/src/pages/organization/IdentityDetailsByIDPage/IdentityDetailsByIDPage.tsx
@@ -6,7 +6,7 @@ import { ChevronLeftIcon, EllipsisIcon } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal, PageHeader } from "@app/components/v2";
+import { DeleteActionModal } from "@app/components/v2";
import {
Alert,
AlertDescription,
@@ -28,6 +28,7 @@ import {
DropdownMenuTrigger,
OrgIcon
} from "@app/components/v3";
+import { PageHeader } from "@app/components/v3/platform";
import { ROUTE_PATHS } from "@app/const/routes";
import {
OrgPermissionActions,
diff --git a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/ProductSettingsPage.tsx b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/ProductSettingsPage.tsx
index 5ccfcb2909..931693b4da 100644
--- a/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/ProductSettingsPage.tsx
+++ b/frontend/src/pages/organization/ProductSettingsPage/SecretsManagement/ProductSettingsPage.tsx
@@ -4,7 +4,6 @@ import { KeyRound } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { PageHeader } from "@app/components/v2";
import {
Card,
CardContent,
@@ -18,6 +17,7 @@ import {
FieldTitle,
Toggle
} from "@app/components/v3";
+import { PageHeader } from "@app/components/v3/platform";
import {
OrgPermissionActions,
OrgPermissionSubjects,
diff --git a/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx b/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
index 9f04822d7c..6865a181f6 100644
--- a/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
+++ b/frontend/src/pages/organization/SecretInsightsPage/SecretInsightsPage.tsx
@@ -6,7 +6,6 @@ import { FileTextIcon, LockIcon } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { OrgPermissionCan } from "@app/components/permissions";
-import { PageHeader } from "@app/components/v2";
import {
Alert,
AlertDescription,
@@ -18,6 +17,7 @@ import {
TooltipProvider,
TooltipTrigger
} from "@app/components/v3";
+import { PageHeader } from "@app/components/v3/platform";
import {
OrgPermissionSubjects,
useOrganization,
diff --git a/frontend/src/pages/organization/UserDetailsByIDPage/UserDetailsByIDPage.tsx b/frontend/src/pages/organization/UserDetailsByIDPage/UserDetailsByIDPage.tsx
index 238c79eab9..e2f675129f 100644
--- a/frontend/src/pages/organization/UserDetailsByIDPage/UserDetailsByIDPage.tsx
+++ b/frontend/src/pages/organization/UserDetailsByIDPage/UserDetailsByIDPage.tsx
@@ -6,7 +6,7 @@ import { ChevronLeftIcon, EllipsisIcon } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal, PageHeader } from "@app/components/v2";
+import { DeleteActionModal } from "@app/components/v2";
import {
Button,
DropdownMenu,
@@ -14,6 +14,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from "@app/components/v3";
+import { PageHeader } from "@app/components/v3/platform";
import { ROUTE_PATHS } from "@app/const/routes";
import {
OrgPermissionMemberActions,