Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: page layout (#20795)
ecmadao6d61e5bd4505
diff --git a/frontend/src/react/components/AuditLogTable.tsx b/frontend/src/react/components/AuditLogTable.tsxindex 35d3da36ca..a165760763 100644--- a/frontend/src/react/components/AuditLogTable.tsx+++ b/frontend/src/react/components/AuditLogTable.tsx@@ -13,7 +13,6 @@ import {type SearchParams,type ValueOption,} from "@/react/components/AdvancedSearch";-import { FeatureAttention } from "@/react/components/FeatureAttention";import { RouterLink } from "@/react/components/RouterLink";import { TimeRangePicker } from "@/react/components/TimeRangePicker";import { Button } from "@/react/components/ui/button";@@ -723,36 +722,33 @@ export function AuditLogTable({const pageSizeOptions = getPageSizeOptions();return (- <div className="flex flex-col">+ <div className="flex flex-col gap-y-4">{/* Header */}- <div className="px-4 py-4 flex flex-col gap-y-2">- <FeatureAttention feature={PlanFeature.FEATURE_AUDIT_LOG} />- <div className="flex items-center gap-x-2">- <AdvancedSearch- params={searchParams}- scopeOptions={scopeOptions}- onParamsChange={setSearchParams}+ <div className="flex items-center gap-x-2">+ <AdvancedSearch+ params={searchParams}+ scopeOptions={scopeOptions}+ onParamsChange={setSearchParams}+ />+ <TimeRangePicker+ params={searchParams}+ onParamsChange={setSearchParams}+ />+ {canExport && (+ <ExportDropdown+ disabled={!hasAuditLogFeature || !!disableExportTip || exporting}+ tooltip={disableExportTip}+ onExport={handleExport}/>- <TimeRangePicker- params={searchParams}- onParamsChange={setSearchParams}- />- {canExport && (- <ExportDropdown- disabled={!hasAuditLogFeature || !!disableExportTip || exporting}- tooltip={disableExportTip}- onExport={handleExport}- />- )}- </div>+ )}</div>{/* Table */}{hasAuditLogFeature ? (<div>- <div className="overflow-x-auto">+ <div className="overflow-x-auto rounded-sm border border-block-border"><Table- className="border-t border-block-border table-fixed"+ className="table-fixed"style={{ minWidth: `${totalWidth}px` }}><colgroup>@@ -817,7 +813,7 @@ export function AuditLogTable({</div>{/* Pagination footer */}- <div className="mt-4 mx-2">+ <div className="mt-4"><PagedTableFooterpageSize={pageSize}pageSizeOptions={pageSizeOptions}@@ -829,7 +825,7 @@ export function AuditLogTable({</div></div>) : (- <div className="mx-4 py-12 border rounded-sm flex items-center justify-center text-control-placeholder">+ <div className="py-12 border rounded-sm flex items-center justify-center text-control-placeholder">{t("common.no-data")}</div>)}diff --git a/frontend/src/react/components/DatabaseGroupTable.tsx b/frontend/src/react/components/DatabaseGroupTable.tsxindex 7dfc4063dd..27ec7555bb 100644--- a/frontend/src/react/components/DatabaseGroupTable.tsx+++ b/frontend/src/react/components/DatabaseGroupTable.tsx@@ -3,11 +3,13 @@ import { useEffect, useMemo, useState } from "react";import { useTranslation } from "react-i18next";import { DatabaseGroupDataTable } from "@/react/components/DatabaseGroupDataTable";import { SearchInput } from "@/react/components/ui/search-input";+import { cn } from "@/react/lib/utils";import { useAppStore } from "@/react/stores/app";import type { DatabaseGroup } from "@/types/proto-es/v1/database_group_service_pb";import { DatabaseGroupView } from "@/types/proto-es/v1/database_group_service_pb";type Props = {+ readonly className?: string;readonly projectName: string;readonly view: DatabaseGroupView;/** Leading caption shown to the left of the search box. */@@ -44,6 +46,7 @@ type Props = {* `DatabaseGroupDataTable`.*/export function DatabaseGroupTable({+ className,projectName,view,leadingLabel,@@ -101,7 +104,7 @@ export function DatabaseGroupTable({}, [sourceList, search]);return (- <div className="flex flex-col gap-y-3">+ <div className={cn("flex flex-col gap-y-3", className)}>{(leadingLabel || trailingAction) && (<div className="w-full flex flex-row justify-between items-center gap-x-2">{leadingLabel ? (diff --git a/frontend/src/react/components/ProjectPageLayout.tsx b/frontend/src/react/components/ProjectPageLayout.tsxnew file mode 100644index 0000000000..030e1e1cb5--- /dev/null+++ b/frontend/src/react/components/ProjectPageLayout.tsx@@ -0,0 +1,135 @@+import * as stylex from "@stylexjs/stylex";+import type { ComponentProps } from "react";+import { cn } from "@/react/lib/utils";+import { Alert, type AlertProps } from "./ui/alert";++const styles = stylex.create({+ root: {+ display: "flex",+ flexDirection: "column",+ overflowX: "hidden",+ paddingBlock: 16,+ paddingInline: 16,+ rowGap: 16,+ width: "100%",+ },+ content: {+ minWidth: 0,+ },+ footer: {+ marginTop: 16,+ },+ toolbar: {+ alignItems: "center",+ columnGap: 8,+ display: "flex",+ justifyContent: "space-between",+ },+ toolbarStart: {+ justifyContent: "flex-start",+ },+ toolbarEnd: {+ justifyContent: "flex-end",+ },+ toolbarBetween: {+ justifyContent: "space-between",+ },+});++function ProjectPageLayout({+ className,+ ref,+ style,+ ...props+}: ComponentProps<"div">) {+ const stylexProps = stylex.props(styles.root);+ return (+ <div+ ref={ref}+ data-slot="project-page-layout"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++type ProjectPageToolbarProps = ComponentProps<"div"> & {+ align?: "start" | "end" | "between";+};++function ProjectPageToolbar({+ align = "between",+ className,+ ref,+ style,+ ...props+}: ProjectPageToolbarProps) {+ const stylexProps = stylex.props(+ styles.toolbar,+ align === "start" && styles.toolbarStart,+ align === "end" && styles.toolbarEnd,+ align === "between" && styles.toolbarBetween+ );+ return (+ <div+ ref={ref}+ data-slot="project-page-toolbar"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++type ProjectPageInfoProps = Omit<AlertProps, "onDismiss" | "variant"> & {+ variant?: Extract<AlertProps["variant"], "info" | "warning" | "error">;+};++function ProjectPageInfo({ variant = "info", ...props }: ProjectPageInfoProps) {+ return <Alert variant={variant} {...props} />;+}++function ProjectPageContent({+ className,+ ref,+ style,+ ...props+}: ComponentProps<"div">) {+ const stylexProps = stylex.props(styles.content);+ return (+ <div+ ref={ref}+ data-slot="project-page-content"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++function ProjectPageFooter({+ className,+ ref,+ style,+ ...props+}: ComponentProps<"div">) {+ const stylexProps = stylex.props(styles.footer);+ return (+ <div+ ref={ref}+ data-slot="project-page-footer"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++export {+ ProjectPageContent,+ ProjectPageFooter,+ ProjectPageInfo,+ ProjectPageLayout,+ ProjectPageToolbar,+};diff --git a/frontend/src/react/components/WorkspacePageLayout.tsx b/frontend/src/react/components/WorkspacePageLayout.tsxnew file mode 100644index 0000000000..30c35d203a--- /dev/null+++ b/frontend/src/react/components/WorkspacePageLayout.tsx@@ -0,0 +1,148 @@+import * as stylex from "@stylexjs/stylex";+import type { ComponentProps } from "react";+import { cn } from "@/react/lib/utils";+import { Alert, type AlertProps } from "./ui/alert";++const styles = stylex.create({+ root: {+ display: "flex",+ flexDirection: "column",+ overflowX: "hidden",+ paddingBlock: 16,+ rowGap: 16,+ width: "100%",+ },+ pagePadding: {+ paddingInline: 16,+ },+ content: {+ minWidth: 0,+ },+ footer: {+ marginTop: 16,+ },+ toolbar: {+ alignItems: "center",+ columnGap: 8,+ display: "flex",+ justifyContent: "space-between",+ },+ toolbarStart: {+ justifyContent: "flex-start",+ },+ toolbarEnd: {+ justifyContent: "flex-end",+ },+ toolbarBetween: {+ justifyContent: "space-between",+ },+});++type WorkspacePageLayoutProps = ComponentProps<"div"> & {+ padding?: "page" | "flush";+};++function WorkspacePageLayout({+ className,+ padding = "page",+ ref,+ style,+ ...props+}: WorkspacePageLayoutProps) {+ const stylexProps = stylex.props(+ styles.root,+ padding === "page" && styles.pagePadding+ );+ return (+ <div+ ref={ref}+ data-slot="workspace-page-layout"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++type WorkspacePageToolbarProps = ComponentProps<"div"> & {+ align?: "start" | "end" | "between";+};++function WorkspacePageToolbar({+ align = "between",+ className,+ ref,+ style,+ ...props+}: WorkspacePageToolbarProps) {+ const stylexProps = stylex.props(+ styles.toolbar,+ align === "start" && styles.toolbarStart,+ align === "end" && styles.toolbarEnd,+ align === "between" && styles.toolbarBetween+ );+ return (+ <div+ ref={ref}+ data-slot="workspace-page-toolbar"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++function WorkspacePageContent({+ className,+ ref,+ style,+ ...props+}: ComponentProps<"div">) {+ const stylexProps = stylex.props(styles.content);+ return (+ <div+ ref={ref}+ data-slot="workspace-page-content"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++function WorkspacePageFooter({+ className,+ ref,+ style,+ ...props+}: ComponentProps<"div">) {+ const stylexProps = stylex.props(styles.footer);+ return (+ <div+ ref={ref}+ data-slot="workspace-page-footer"+ className={cn(stylexProps.className, className)}+ style={{ ...stylexProps.style, ...style }}+ {...props}+ />+ );+}++type WorkspacePageInfoProps = Omit<AlertProps, "onDismiss" | "variant"> & {+ variant?: Extract<AlertProps["variant"], "info" | "warning" | "error">;+};++function WorkspacePageInfo({+ variant = "info",+ ...props+}: WorkspacePageInfoProps) {+ return <Alert variant={variant} {...props} />;+}++export {+ WorkspacePageContent,+ WorkspacePageFooter,+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+};diff --git a/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx b/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsxindex 87dc1ed2a9..0ecb67b26e 100644--- a/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx+++ b/frontend/src/react/pages/project/ProjectAccessGrantsPage.tsx@@ -11,6 +11,12 @@ import {import { ComponentPermissionGuard } from "@/react/components/ComponentPermissionGuard";import { EngineIcon } from "@/react/components/EngineIcon";import { FeatureAttention } from "@/react/components/FeatureAttention";+import {+ ProjectPageContent,+ ProjectPageFooter,+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import { RouterLink } from "@/react/components/RouterLink";import { TimeRangePicker } from "@/react/components/TimeRangePicker";import { Badge } from "@/react/components/ui/badge";@@ -519,18 +525,15 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {}, [confirmAction, activateAccessGrant, revokeAccessGrant, t, paged]);return (- <div className="py-4 w-full flex flex-col">- <div className="mx-4 mb-2">- <FeatureAttention feature={PlanFeature.FEATURE_JIT} />- </div>+ <ProjectPageLayout>+ <FeatureAttention feature={PlanFeature.FEATURE_JIT} /><ComponentPermissionGuardpermissions={["bb.accessGrants.list"]}project={project}- className="mx-4"><>- <div className="px-4 pb-2 flex items-center gap-x-2">+ <ProjectPageToolbar align="start"><AdvancedSearchparams={searchParams}onParamsChange={setSearchParams}@@ -541,10 +544,10 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {params={searchParams}onParamsChange={setSearchParams}/>- </div>+ </ProjectPageToolbar>{!hasJITFeature ? (- <div className="mx-4 py-12 border rounded-sm flex items-center justify-center text-control-light">+ <div className="py-12 border rounded-sm flex items-center justify-center text-control-light">{t("common.no-data")}</div>) : paged.isLoading ? (@@ -556,7 +559,7 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {{t("common.no-data")}</div>) : (- <div ref={fitTableContainer} className="px-4">+ <ProjectPageContent ref={fitTableContainer}><div className="border rounded-sm overflow-x-auto"><TableclassName="w-auto table-fixed"@@ -620,7 +623,7 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {</Table></div>- <div className="mt-4">+ <ProjectPageFooter><PagedTableFooterpageSize={paged.pageSize}pageSizeOptions={paged.pageSizeOptions}@@ -629,8 +632,8 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {isFetchingMore={paged.isFetchingMore}onLoadMore={paged.loadMore}/>- </div>- </div>+ </ProjectPageFooter>+ </ProjectPageContent>)}</></ComponentPermissionGuard>@@ -670,7 +673,7 @@ export function ProjectAccessGrantsPage({ projectId }: { projectId: string }) {</div></DialogContent></Dialog>- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectAuditLogPage.tsx b/frontend/src/react/pages/project/ProjectAuditLogPage.tsxindex 9f76ec89fc..8848a083e0 100644--- a/frontend/src/react/pages/project/ProjectAuditLogPage.tsx+++ b/frontend/src/react/pages/project/ProjectAuditLogPage.tsx@@ -1,6 +1,10 @@import { useMemo } from "react";import { AuditLogTable } from "@/react/components/AuditLogTable";import { FeatureAttention } from "@/react/components/FeatureAttention";+import {+ ProjectPageContent,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import { useProjectByName } from "@/react/hooks/useProjectByName";import { useAppStore } from "@/react/stores/app";import { projectNamePrefix } from "@/store/modules/v1/common";@@ -24,15 +28,15 @@ export function ProjectAuditLogPage({ projectId }: { projectId: string }) {);return (- <div className="flex flex-col">- <div className="mx-4 mb-2">- <FeatureAttention feature={PlanFeature.FEATURE_AUDIT_LOG} />- </div>- <AuditLogTable- parent={projectName}- canExport={canExport}- readonlyScopes={readonlyScopes}- />- </div>+ <ProjectPageLayout className="gap-y-2">+ <FeatureAttention feature={PlanFeature.FEATURE_AUDIT_LOG} />+ <ProjectPageContent>+ <AuditLogTable+ parent={projectName}+ canExport={canExport}+ readonlyScopes={readonlyScopes}+ />+ </ProjectPageContent>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx b/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsxindex c4bfd57468..b82f326c69 100644--- a/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx+++ b/frontend/src/react/pages/project/ProjectDatabaseGroupsPage.tsx@@ -4,6 +4,10 @@ import { useTranslation } from "react-i18next";import { DatabaseGroupTable } from "@/react/components/DatabaseGroupTable";import { FeatureAttention } from "@/react/components/FeatureAttention";import { FeatureBadge } from "@/react/components/FeatureBadge";+import {+ ProjectPageContent,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import {AlertDialog,AlertDialogContent,@@ -102,13 +106,12 @@ export function ProjectDatabaseGroupsPage({}, [deleteTarget]);return (- <div className="py-4 flex flex-col gap-y-2">- <div className="px-4 flex flex-col gap-y-2">- <FeatureAttention feature={PlanFeature.FEATURE_DATABASE_GROUPS} />- </div>+ <ProjectPageLayout>+ <FeatureAttention feature={PlanFeature.FEATURE_DATABASE_GROUPS} />- <div className="px-4">+ <ProjectPageContent><DatabaseGroupTable+ className="gap-y-4"projectName={projectName}view={DatabaseGroupView.BASIC}externalList={dbGroupList}@@ -128,7 +131,7 @@ export function ProjectDatabaseGroupsPage({</Button>}/>- </div>+ </ProjectPageContent><AlertDialogopen={deleteTarget !== null}@@ -155,6 +158,6 @@ export function ProjectDatabaseGroupsPage({</AlertDialogFooter></AlertDialogContent></AlertDialog>- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx b/frontend/src/react/pages/project/ProjectDatabasesPage.tsxindex 782802cce4..1ea4baa2b3 100644--- a/frontend/src/react/pages/project/ProjectDatabasesPage.tsx+++ b/frontend/src/react/pages/project/ProjectDatabasesPage.tsx@@ -18,6 +18,10 @@ import {} from "@/react/components/database";import { EditEnvironmentSheet } from "@/react/components/EditEnvironmentSheet";import { PermissionGuard } from "@/react/components/PermissionGuard";+import {+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import {AlertDialog,AlertDialogContent,@@ -376,38 +380,36 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {}, [projectName, selectedDatabaseNames]);return (- <div className="py-4 flex flex-col">- <div className="px-4 flex flex-col gap-y-2 pb-2">- <div className="w-full flex flex-col sm:flex-row items-start sm:items-end justify-between gap-2">- <AdvancedSearch- params={searchParams}- onParamsChange={setSearchParams}- placeholder={t("database.filter-database")}- scopeOptions={scopeOptions}- />- <PermissionGuard- permissions={[- "bb.instances.list",- "bb.plans.create",- "bb.sheets.create",- ]}- project={project}+ <ProjectPageLayout>+ <ProjectPageToolbar className="flex-col items-start gap-2 sm:flex-row sm:items-end">+ <AdvancedSearch+ params={searchParams}+ onParamsChange={setSearchParams}+ placeholder={t("database.filter-database")}+ scopeOptions={scopeOptions}+ />+ <PermissionGuard+ permissions={[+ "bb.instances.list",+ "bb.plans.create",+ "bb.sheets.create",+ ]}+ project={project}+ >+ <Button+ disabled={+ !hasProjectPermission("bb.instances.list") ||+ !PERMISSIONS_FOR_DATABASE_CREATE_ISSUE.every((permission) =>+ hasProjectPermission(permission)+ )+ }+ onClick={() => setShowCreateDrawer(true)}>- <Button- disabled={- !hasProjectPermission("bb.instances.list") ||- !PERMISSIONS_FOR_DATABASE_CREATE_ISSUE.every(- hasProjectPermission- )- }- onClick={() => setShowCreateDrawer(true)}- >- <Plus className="size-4 mr-1" />- {t("common.create")}- </Button>- </PermissionGuard>- </div>- </div>+ <Plus className="size-4 mr-1" />+ {t("common.create")}+ </Button>+ </PermissionGuard>+ </ProjectPageToolbar><DatabaseTablefilter={filter}@@ -493,6 +495,6 @@ export function ProjectDatabasesPage({ projectId }: { projectId: string }) {</AlertDialogContent></AlertDialog>)}- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectGitOpsPage.tsx b/frontend/src/react/pages/project/ProjectGitOpsPage.tsxindex 1fafe3f4e3..772a6b80db 100644--- a/frontend/src/react/pages/project/ProjectGitOpsPage.tsx+++ b/frontend/src/react/pages/project/ProjectGitOpsPage.tsx@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";import gitopsWorkflowImage from "@/assets/gitops-workflow.svg";import { CreateWorkloadIdentitySheet } from "@/react/components/CreateWorkloadIdentitySheet";import { PermissionGuard } from "@/react/components/PermissionGuard";+import { ProjectPageLayout } from "@/react/components/ProjectPageLayout";import { RouterLink } from "@/react/components/RouterLink";import { Alert } from "@/react/components/ui/alert";import { Button, buttonVariants } from "@/react/components/ui/button";@@ -303,7 +304,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {selectedConfig.providerType !== WorkloadIdentityConfig_ProviderType.GITLAB;return (- <div className="w-full px-4 flex flex-col gap-y-1 py-4">+ <ProjectPageLayout className="gap-y-1">{/* Section 1: What is GitOps */}<div className="border border-gray-200 rounded-sm p-6 flex flex-col gap-y-3"><div className="flex flex-col gap-y-1">@@ -618,7 +619,7 @@ export function ProjectGitOpsPage({ projectId }: { projectId: string }) {onClose={() => setShowCreateDrawer(false)}onCreated={handleWorkloadIdentityCreated}/>- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectIssueDashboardPage.tsx b/frontend/src/react/pages/project/ProjectIssueDashboardPage.tsxindex 89820e9e1f..b50bce76aa 100644--- a/frontend/src/react/pages/project/ProjectIssueDashboardPage.tsx+++ b/frontend/src/react/pages/project/ProjectIssueDashboardPage.tsx@@ -10,7 +10,12 @@ import {PresetButtons,useIssueSearchScopeOptions,} from "@/react/components/IssueTable";-import { Alert } from "@/react/components/ui/alert";+import {+ ProjectPageContent,+ ProjectPageFooter,+ ProjectPageInfo,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import { useCurrentUser } from "@/react/hooks/useAppState";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { refreshIssueList } from "@/react/lib/issue/issueListRefresh";@@ -42,15 +47,6 @@ export function ProjectIssueDashboardPage({const projectName = `${projectNamePrefix}${projectId}`;- // Hint- const HINT_KEY = "issue.hint-dismissed";- const hideHint = useAppStore((s) => s.getIntroStateByKey(HINT_KEY));- const dismissHint = useCallback(() => {- useAppStore- .getState()- .saveIntroStateByKey({ key: HINT_KEY, newState: true });- }, []);-// Read-only scopesconst readonlyScopes: VueSearchScope[] = useMemo(() => [{ id: "project", value: projectId, readonly: true }],@@ -236,11 +232,9 @@ export function ProjectIssueDashboardPage({}, [paged]);return (- <div className="py-4 flex flex-col">- <div className="px-4 flex flex-col gap-y-2">- {!hideHint && (- <Alert description={t("issue.subtitle")} onDismiss={dismissHint} />- )}+ <ProjectPageLayout>+ <div className="flex flex-col gap-y-2">+ <ProjectPageInfo description={t("issue.subtitle")} /><IssueSearchBarparams={searchParams}onParamsChange={setSearchParams}@@ -251,7 +245,7 @@ export function ProjectIssueDashboardPage({<PresetButtons params={searchParams} onParamsChange={setSearchParams} /></div>- <div className="mt-2">+ <ProjectPageContent>{paged.isLoading ? (<div className="flex justify-center py-8 text-control-light"><Loader2 className="w-5 h-5 animate-spin" />@@ -272,7 +266,7 @@ export function ProjectIssueDashboardPage({)))}{paged.dataList.length > 0 && (- <div className="mt-4 mx-2">+ <ProjectPageFooter><PagedTableFooterpageSize={paged.pageSize}pageSizeOptions={paged.pageSizeOptions}@@ -281,9 +275,9 @@ export function ProjectIssueDashboardPage({isFetchingMore={paged.isFetchingMore}onLoadMore={paged.loadMore}/>- </div>+ </ProjectPageFooter>)}- </div>+ </ProjectPageContent>{selectedIssues.length > 0 && (<BatchActionBar@@ -304,6 +298,6 @@ export function ProjectIssueDashboardPage({onClose={() => setBatchAction(undefined)}onUpdated={handleBatchUpdated}/>- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectPageLayout.test.ts b/frontend/src/react/pages/project/ProjectPageLayout.test.tsnew file mode 100644index 0000000000..748020d85a--- /dev/null+++ b/frontend/src/react/pages/project/ProjectPageLayout.test.ts@@ -0,0 +1,182 @@+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { describe, expect, test } from "vitest";++const projectDir = import.meta.dirname;+const settingsDir = join(projectDir, "../settings");+const componentsDir = join(projectDir, "../../components");++const projectListPages = [+ "ProjectAccessGrantsPage.tsx",+ "ProjectAuditLogPage.tsx",+ "ProjectDatabaseGroupsPage.tsx",+ "ProjectDatabasesPage.tsx",+ "ProjectGitOpsPage.tsx",+ "ProjectIssueDashboardPage.tsx",+ "ProjectPlanDashboardPage.tsx",+ "ProjectReleaseDashboardPage.tsx",+ "ProjectWebhooksPage.tsx",+] as const;++const projectInfoPages = [+ "ProjectIssueDashboardPage.tsx",+ "ProjectPlanDashboardPage.tsx",+ "ProjectReleaseDashboardPage.tsx",+ "ProjectSyncSchemaPage.tsx",+] as const;++const projectReusableSettingsPages = [+ "MembersPage.tsx",+ "ServiceAccountsPage.tsx",+ "WorkloadIdentitiesPage.tsx",+] as const;++function readProjectPage(+ file: (typeof projectListPages)[number] | (typeof projectInfoPages)[number]+) {+ return readFileSync(join(projectDir, file), "utf8");+}++function readReusableSettingsPage(+ file: (typeof projectReusableSettingsPages)[number]+) {+ return readFileSync(join(settingsDir, file), "utf8");+}++describe("project page layout", () => {+ test("keeps the project shell page rhythm", () => {+ const source = readFileSync(+ join(componentsDir, "ProjectPageLayout.tsx"),+ "utf8"+ );++ expect(source).toContain("paddingBlock: 16");+ expect(source).toContain("paddingInline: 16");+ expect(source).toContain("rowGap: 16");+ expect(source).not.toContain("paddingBottom: 8");+ });++ test("uses the shared project layout shell instead of page-local padding", () => {+ for (const file of projectListPages) {+ const source = readProjectPage(file);++ expect(source, file).toContain("@/react/components/ProjectPageLayout");+ expect(source, file).toContain("<ProjectPageLayout");+ expect(source, file).not.toContain('className="py-4 flex flex-col"');+ expect(source, file).not.toContain(+ 'className="py-4 w-full flex flex-col"'+ );+ expect(source, file).not.toContain(+ 'className="w-full px-4 flex flex-col gap-y-1 py-4"'+ );+ }+ });++ test("uses project layout when project routes reuse settings pages", () => {+ for (const file of projectReusableSettingsPages) {+ const source = readReusableSettingsPage(file);++ expect(source, file).toContain("ProjectPageLayout");+ expect(source, file).toContain("ProjectPageToolbar");+ expect(source, file).toContain(+ "const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout"+ );+ expect(source, file).toContain(+ "const PageToolbar = projectName ? ProjectPageToolbar : WorkspacePageToolbar"+ );+ expect(source, file).toContain("<PageLayout>");+ }+ });++ test("does not reserve top gap for hidden access grants feature attention", () => {+ const source = readProjectPage("ProjectAccessGrantsPage.tsx");++ expect(source).toContain(+ "<FeatureAttention feature={PlanFeature.FEATURE_JIT} />"+ );+ expect(source).not.toContain('<div className="mb-2">');+ });++ test("keeps database groups on the shared page vertical rhythm", () => {+ const source = readProjectPage("ProjectDatabaseGroupsPage.tsx");+ const databaseGroupTable = readFileSync(+ join(componentsDir, "DatabaseGroupTable.tsx"),+ "utf8"+ );++ expect(source).not.toContain('<ProjectPageLayout className="gap-y-');+ expect(source).toContain("<DatabaseGroupTable");+ expect(source).toContain('className="gap-y-4"');+ expect(databaseGroupTable).toContain("readonly className?: string");+ expect(databaseGroupTable).toContain(+ 'className={cn("flex flex-col gap-y-3", className)}'+ );+ });++ test("uses shared project info surfaces for persistent page descriptions", () => {+ for (const file of projectInfoPages) {+ const source = readProjectPage(file);++ expect(source, file).toContain("ProjectPageInfo");+ expect(source, file).not.toContain("onDismiss={dismissHint}");+ }+ });++ test("does not stack page-local spacing on top of shared page rhythm", () => {+ for (const file of [+ "ProjectIssueDashboardPage.tsx",+ "ProjectPlanDashboardPage.tsx",+ "ProjectReleaseDashboardPage.tsx",+ "ProjectSyncSchemaPage.tsx",+ ] as const) {+ const source = readProjectPage(file);++ expect(source, file).not.toContain(+ '<ProjectPageContent className="mt-2">'+ );+ expect(source, file).not.toContain("flex flex-col gap-y-2 pb-2");+ expect(source, file).not.toContain(+ 'className="pt-4 flex-1 overflow-hidden flex flex-col gap-y-4"'+ );+ }+ });++ test("uses explicit toolbar alignment instead of Tailwind overrides", () => {+ const webhooks = readProjectPage("ProjectWebhooksPage.tsx");+ const accessGrants = readProjectPage("ProjectAccessGrantsPage.tsx");++ expect(webhooks).toContain('<ProjectPageToolbar align="end">');+ expect(webhooks).not.toContain('className="justify-end"');+ expect(accessGrants).toContain('<ProjectPageToolbar align="start">');+ expect(accessGrants).not.toContain('className="justify-start"');+ });++ test("keeps audit log table free of page-level layout", () => {+ const projectAuditLogPage = readProjectPage("ProjectAuditLogPage.tsx");+ const auditLogTable = readFileSync(+ join(componentsDir, "AuditLogTable.tsx"),+ "utf8"+ );++ expect(projectAuditLogPage).toContain("ProjectPageContent");+ expect(auditLogTable).not.toContain("FeatureAttention");+ expect(auditLogTable).not.toContain('className="px-4 py-4');+ expect(auditLogTable).not.toContain('className="mx-4');+ expect(auditLogTable).not.toContain('className="mt-4 mx-2"');+ });++ test("uses bordered table surfaces inside padded project pages", () => {+ const projectPlanPage = readProjectPage("ProjectPlanDashboardPage.tsx");+ const auditLogTable = readFileSync(+ join(componentsDir, "AuditLogTable.tsx"),+ "utf8"+ );++ expect(projectPlanPage).toContain(+ 'className="overflow-x-auto rounded-sm border border-block-border"'+ );+ expect(auditLogTable).toContain(+ 'className="overflow-x-auto rounded-sm border border-block-border"'+ );+ });+});diff --git a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsxindex e8cdf31495..c1a53c510a 100644--- a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx+++ b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx@@ -23,8 +23,13 @@ import {PermissionGuard,usePermissionCheck,} from "@/react/components/PermissionGuard";+import {+ ProjectPageContent,+ ProjectPageFooter,+ ProjectPageInfo,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import { TaskStatusIcon } from "@/react/components/TaskStatusIcon";-import { Alert } from "@/react/components/ui/alert";import { Badge } from "@/react/components/ui/badge";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -118,15 +123,6 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {const [showAddSpecDrawer, setShowAddSpecDrawer] = useState(false);- // Hint dismissal- const HINT_KEY = "plan.hint-dismissed";- const hideHint = useAppStore((s) => s.getIntroStateByKey(HINT_KEY));- const dismissHint = useCallback(() => {- useAppStore- .getState()- .saveIntroStateByKey({ key: HINT_KEY, newState: true });- }, []);-// Searchconst defaultSearchParams = useCallback((): SearchParams => ({@@ -297,11 +293,9 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {);return (- <div className="py-4 w-full flex flex-col">- <div className="px-4 flex flex-col gap-y-2 pb-2">- {!hideHint && (- <Alert description={t("plan.subtitle")} onDismiss={dismissHint} />- )}+ <ProjectPageLayout>+ <div className="flex flex-col gap-y-2">+ <ProjectPageInfo description={t("plan.subtitle")} /><div className="w-full flex flex-col lg:flex-row items-start lg:items-center justify-between gap-2"><div className="w-full flex flex-1 items-center justify-between gap-x-2"><AdvancedSearch@@ -326,7 +320,7 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {</div>{/* Plan list */}- <div className="mt-2">+ <ProjectPageContent>{paged.isLoading ? (<div className="flex justify-center py-8 text-control-light"><Loader2 className="size-5 animate-spin" />@@ -340,7 +334,7 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {)}{paged.dataList.length > 0 && (- <div className="mt-4 mx-2">+ <ProjectPageFooter><PagedTableFooterpageSize={paged.pageSize}pageSizeOptions={paged.pageSizeOptions}@@ -349,9 +343,9 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {isFetchingMore={paged.isFetchingMore}onLoadMore={paged.loadMore}/>- </div>+ </ProjectPageFooter>)}- </div>+ </ProjectPageContent><AddSpecDraweropen={showAddSpecDrawer}@@ -360,7 +354,7 @@ export function ProjectPlanDashboardPage({ projectId }: { projectId: string }) {onCreated={handleSpecCreated}title={t("plan.new-plan")}/>- </div>+ </ProjectPageLayout>);}@@ -524,7 +518,7 @@ function PlanTable({ plans, projectId }: { plans: Plan[]; projectId: string }) {}, [isMobile, columns, setWidths]);return (- <div className="overflow-x-auto">+ <div className="overflow-x-auto rounded-sm border border-block-border"><Table className="table-fixed" style={{ minWidth: `${totalWidth}px` }}><colgroup>{widths.map((w, i) => (diff --git a/frontend/src/react/pages/project/ProjectReleaseDashboardPage.tsx b/frontend/src/react/pages/project/ProjectReleaseDashboardPage.tsxindex 46546544d3..ef9807e8de 100644--- a/frontend/src/react/pages/project/ProjectReleaseDashboardPage.tsx+++ b/frontend/src/react/pages/project/ProjectReleaseDashboardPage.tsx@@ -5,7 +5,12 @@ import { useTranslation } from "react-i18next";import { releaseServiceClientConnect } from "@/connect";import { HumanizeTs } from "@/react/components/HumanizeTs";import { LearnMoreLink } from "@/react/components/LearnMoreLink";-import { Alert } from "@/react/components/ui/alert";+import {+ ProjectPageContent,+ ProjectPageFooter,+ ProjectPageInfo,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import { Button } from "@/react/components/ui/button";import {Table,@@ -95,10 +100,9 @@ export function ProjectReleaseDashboardPage({});return (- <div className="py-4 w-full flex flex-col">- <div className="px-4 flex flex-col gap-y-2 pb-2">- <Alert- variant="info"+ <ProjectPageLayout>+ <div className="flex flex-col gap-y-2">+ <ProjectPageInfodescription={<><span>{t("release.usage-description")}</span>@@ -131,7 +135,7 @@ export function ProjectReleaseDashboardPage({</div>{/* Release table */}- <div className="mt-2">+ <ProjectPageContent>{paged.isLoading ? (<div className="flex justify-center py-8 text-control-light"><Loader2 className="size-5 animate-spin" />@@ -145,7 +149,7 @@ export function ProjectReleaseDashboardPage({)}{paged.dataList.length > 0 && (- <div className="mt-4 mx-2">+ <ProjectPageFooter><PagedTableFooterpageSize={paged.pageSize}pageSizeOptions={paged.pageSizeOptions}@@ -154,10 +158,10 @@ export function ProjectReleaseDashboardPage({isFetchingMore={paged.isFetchingMore}onLoadMore={paged.loadMore}/>- </div>+ </ProjectPageFooter>)}- </div>- </div>+ </ProjectPageContent>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectSettingsPage.tsx b/frontend/src/react/pages/project/ProjectSettingsPage.tsxindex 4b03781cc5..51d1411b71 100644--- a/frontend/src/react/pages/project/ProjectSettingsPage.tsx+++ b/frontend/src/react/pages/project/ProjectSettingsPage.tsx@@ -666,7 +666,7 @@ export function ProjectSettingsPage() {// Render// -----------------------------------------------------------------------return (- <div className="w-full flex flex-col gap-y-0 pt-4 px-4">+ <div className="w-full flex flex-col gap-y-0 px-4"><div className="divide-y divide-block-border">{/* ============================================================= */}{/* Section 1: General */}diff --git a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsxindex 65fe193715..c6beb8f7a3 100644--- a/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx+++ b/frontend/src/react/pages/project/ProjectSyncSchemaPage.tsx@@ -23,6 +23,11 @@ import {loadMonacoEditor,setMonacoModelLanguage,} from "@/react/components/monaco/core";+import {+ ProjectPageContent,+ ProjectPageInfo,+ ProjectPageLayout,+} from "@/react/components/ProjectPageLayout";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";import { Combobox, type ComboboxOption } from "@/react/components/ui/combobox";@@ -428,21 +433,25 @@ export function ProjectSyncSchemaPage({ projectId }: { projectId: string }) {if (!project) return null;return (- <div className="w-full h-full overflow-hidden flex flex-col px-4 py-4">- <p className="text-sm text-control-light">- {t("database.sync-schema.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/change-database/synchronize-schema?source=console"- className="normal-link"- />- </p>+ <ProjectPageLayout className="h-full">+ <ProjectPageInfo+ description={+ <>+ {t("database.sync-schema.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/change-database/synchronize-schema?source=console"+ className="text-accent"+ />+ </>+ }+ />{isLoading ? (<div className="flex items-center justify-center py-2 text-control-placeholder text-sm"><div className="animate-spin rounded-full size-5 border-b-2 border-control-placeholder" /></div>) : (- <div className="pt-4 flex-1 overflow-hidden flex flex-col gap-y-4">+ <ProjectPageContent className="flex-1 overflow-hidden flex flex-col gap-y-4">{/* Step indicator */}<StepIndicator steps={stepList} currentIndex={currentStep} />@@ -507,7 +516,7 @@ export function ProjectSyncSchemaPage({ projectId }: { projectId: string }) {)}</div></div>- </div>+ </ProjectPageContent>)}{/* Confirm revert dialog */}@@ -525,7 +534,7 @@ export function ProjectSyncSchemaPage({ projectId }: { projectId: string }) {</div></DialogContent></Dialog>- </div>+ </ProjectPageLayout>);}diff --git a/frontend/src/react/pages/project/ProjectWebhooksPage.tsx b/frontend/src/react/pages/project/ProjectWebhooksPage.tsxindex 33adbedcd6..d5ca680181 100644--- a/frontend/src/react/pages/project/ProjectWebhooksPage.tsx+++ b/frontend/src/react/pages/project/ProjectWebhooksPage.tsx@@ -2,6 +2,11 @@ import { EllipsisVertical, Plus } from "lucide-react";import { useCallback, useMemo, useState } from "react";import { useTranslation } from "react-i18next";import { PermissionGuard } from "@/react/components/PermissionGuard";+import {+ ProjectPageContent,+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import {AlertDialog,AlertDialogContent,@@ -108,22 +113,24 @@ export function ProjectWebhooksPage({ projectId }: { projectId: string }) {}, [deleteTarget, project, deleteProjectWebhook, t]);return (- <div className="py-4 flex flex-col">- <div className="px-4 pb-2 flex items-center justify-end">+ <ProjectPageLayout>+ <ProjectPageToolbar align="end"><PermissionGuard permissions={["bb.projects.update"]} project={project}><Button disabled={!allowEdit} onClick={handleAdd}><Plus className="size-4 mr-1" />{t("common.create")}</Button></PermissionGuard>- </div>+ </ProjectPageToolbar>- <WebhookTable- webhooks={webhooks}- allowEdit={allowEdit}- onRowClick={handleRowClick}- onDelete={setDeleteTarget}- />+ <ProjectPageContent>+ <WebhookTable+ webhooks={webhooks}+ allowEdit={allowEdit}+ onRowClick={handleRowClick}+ onDelete={setDeleteTarget}+ />+ </ProjectPageContent><AlertDialogopen={deleteTarget !== null}@@ -152,7 +159,7 @@ export function ProjectWebhooksPage({ projectId }: { projectId: string }) {</AlertDialogFooter></AlertDialogContent></AlertDialog>- </div>+ </ProjectPageLayout>);}@@ -172,82 +179,77 @@ function WebhookTable({const activityItemList = projectWebhookV1ActivityItemList();return (- <div className="px-4">- <div className="border rounded-sm overflow-hidden">- <Table>- <TableHeader>- <TableRow className="bg-control-bg">- <TableHead className="w-60">{t("common.name")}</TableHead>- <TableHead>URL</TableHead>- <TableHead>{t("project.webhook.triggering-activity")}</TableHead>- {allowEdit && <TableHead className="w-12" />}+ <div className="border rounded-sm overflow-hidden">+ <Table>+ <TableHeader>+ <TableRow className="bg-control-bg">+ <TableHead className="w-60">{t("common.name")}</TableHead>+ <TableHead>URL</TableHead>+ <TableHead>{t("project.webhook.triggering-activity")}</TableHead>+ {allowEdit && <TableHead className="w-12" />}+ </TableRow>+ </TableHeader>+ <TableBody>+ {webhooks.length === 0 ? (+ <TableRow>+ <TableCell+ colSpan={allowEdit ? 4 : 3}+ className="py-8 text-center text-control-light"+ >+ {t("common.no-data")}+ </TableCell></TableRow>- </TableHeader>- <TableBody>- {webhooks.length === 0 ? (- <TableRow>- <TableCell- colSpan={allowEdit ? 4 : 3}- className="py-8 text-center text-control-light"- >- {t("common.no-data")}- </TableCell>- </TableRow>- ) : (- webhooks.map((webhook) => {- const activityTitles = webhook.notificationTypes.map(- (activity) => {- const item = activityItemList.find(- (item) => item.activity === activity- );- return item- ? item.title- : Activity_Type[activity] || `ACTIVITY_${activity}`;- }- );+ ) : (+ webhooks.map((webhook) => {+ const activityTitles = webhook.notificationTypes.map(+ (activity) => {+ const item = activityItemList.find(+ (item) => item.activity === activity+ );+ return item+ ? item.title+ : Activity_Type[activity] || `ACTIVITY_${activity}`;+ }+ );- return (- <TableRow- key={webhook.name}- className="cursor-pointer"- onClick={(e) => onRowClick(e, webhook)}- >- <TableCell>- <div className="flex items-center gap-x-2">- <WebhookTypeIcon- type={webhook.type}- className="size-5"- />- {webhook.title}- </div>- </TableCell>- <TableCell className="truncate max-w-xs text-control-light">- {webhook.url}- </TableCell>+ return (+ <TableRow+ key={webhook.name}+ className="cursor-pointer"+ onClick={(e) => onRowClick(e, webhook)}+ >+ <TableCell>+ <div className="flex items-center gap-x-2">+ <WebhookTypeIcon type={webhook.type} className="size-5" />+ {webhook.title}+ </div>+ </TableCell>+ <TableCell className="truncate max-w-xs text-control-light">+ {webhook.url}+ </TableCell>+ <TableCell>+ <div className="flex flex-wrap gap-2">+ {activityTitles.map((title) => (+ <span+ key={title}+ className="inline-block px-2 py-0.5 text-xs rounded-xs bg-control-bg text-control"+ >+ {title}+ </span>+ ))}+ </div>+ </TableCell>+ {allowEdit && (<TableCell>- <div className="flex flex-wrap gap-2">- {activityTitles.map((title) => (- <span- key={title}- className="inline-block px-2 py-0.5 text-xs rounded-xs bg-control-bg text-control"- >- {title}- </span>- ))}- </div>+ <ActionDropdown webhook={webhook} onDelete={onDelete} /></TableCell>- {allowEdit && (- <TableCell>- <ActionDropdown webhook={webhook} onDelete={onDelete} />- </TableCell>- )}- </TableRow>- );- })- )}- </TableBody>- </Table>- </div>+ )}+ </TableRow>+ );+ })+ )}+ </TableBody>+ </Table></div>);}diff --git a/frontend/src/react/pages/settings/AuditLogPage.tsx b/frontend/src/react/pages/settings/AuditLogPage.tsxindex 0094486197..8438d44c38 100644--- a/frontend/src/react/pages/settings/AuditLogPage.tsx+++ b/frontend/src/react/pages/settings/AuditLogPage.tsx@@ -1,11 +1,22 @@import { AuditLogTable } from "@/react/components/AuditLogTable";+import { FeatureAttention } from "@/react/components/FeatureAttention";+import {+ WorkspacePageContent,+ WorkspacePageLayout,+} from "@/react/components/WorkspacePageLayout";import { projectNamePrefix } from "@/store/modules/v1/common";+import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";import { hasWorkspacePermissionV2 } from "@/utils";export function AuditLogPage() {const canExport = hasWorkspacePermissionV2("bb.auditLogs.export");return (- <AuditLogTable parent={`${projectNamePrefix}-`} canExport={canExport} />+ <WorkspacePageLayout className="gap-y-2">+ <FeatureAttention feature={PlanFeature.FEATURE_AUDIT_LOG} />+ <WorkspacePageContent>+ <AuditLogTable parent={`${projectNamePrefix}-`} canExport={canExport} />+ </WorkspacePageContent>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/CustomApprovalPage.tsx b/frontend/src/react/pages/settings/CustomApprovalPage.tsxindex f9c12b2ef7..9ea25704dc 100644--- a/frontend/src/react/pages/settings/CustomApprovalPage.tsx+++ b/frontend/src/react/pages/settings/CustomApprovalPage.tsx@@ -4,7 +4,10 @@ import { useTranslation } from "react-i18next";import { RulesSection } from "@/react/components/CustomApproval/RulesSection";import { APPROVAL_SOURCES } from "@/react/components/CustomApproval/utils";import { FeatureAttention } from "@/react/components/FeatureAttention";-import { Alert } from "@/react/components/ui/alert";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+} from "@/react/components/WorkspacePageLayout";import { useAppStore } from "@/react/stores/app";import {useWorkspaceApprovalSettingStore,@@ -37,13 +40,13 @@ export function CustomApprovalPage() {}, []);return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4 text-sm">- <div ref={featureAttentionRef}>+ <WorkspacePageLayout className="gap-y-4 text-sm">+ <div ref={featureAttentionRef} className="empty:hidden"><FeatureAttention feature={PlanFeature.FEATURE_APPROVAL_WORKFLOW} /></div>{hasFeature && (- <Alert variant="info">+ <WorkspacePageInfo><ul className="flex flex-col gap-y-1 list-disc pl-5"><li>{t(@@ -55,7 +58,7 @@ export function CustomApprovalPage() {</li><li>{t("custom-approval.rule.approval-rule-matching.priority")}</li></ul>- </Alert>+ </WorkspacePageInfo>)}{!ready ? (@@ -76,7 +79,7 @@ export function CustomApprovalPage() {))}</div>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/DataClassificationPage.tsx b/frontend/src/react/pages/settings/DataClassificationPage.tsxindex 3c0a8ec025..837cce8ba5 100644--- a/frontend/src/react/pages/settings/DataClassificationPage.tsx+++ b/frontend/src/react/pages/settings/DataClassificationPage.tsx@@ -8,6 +8,11 @@ import { ClassificationTree } from "@/react/components/ClassificationTree";import { FeatureAttention } from "@/react/components/FeatureAttention";import { LearnMoreLink } from "@/react/components/LearnMoreLink";import { Button } from "@/react/components/ui/button";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import classificationExample from "@/react/lib/sensitive-data/classification-example.json";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";@@ -286,21 +291,25 @@ export function DataClassificationPage() {if (!loaded) return null;return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4">+ <WorkspacePageLayout className="gap-y-4">{!hasClassificationFeature && (<FeatureAttention feature={PlanFeature.FEATURE_DATA_CLASSIFICATION} />)}- <div className="flex items-center justify-between">- <div className="text-sm text-control-light">- {t("database.classification.description")}- <LearnMoreLink- href="https://docs.bytebase.com/security/data-masking/data-classification?source=console"- className="ml-1 text-accent"- />- </div>+ <WorkspacePageInfo+ description={+ <>+ {t("database.classification.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/security/data-masking/data-classification?source=console"+ className="text-accent"+ />+ </>+ }+ />- {allowEdit && (+ {allowEdit && (+ <WorkspacePageToolbar align="end"><div className="flex items-center justify-end gap-x-2 shrink-0">{editing ? (<>@@ -371,8 +380,8 @@ export function DataClassificationPage() {</>)}</div>- )}- </div>+ </WorkspacePageToolbar>+ )}{editing && (<>@@ -406,6 +415,6 @@ export function DataClassificationPage() {)}{!editing && !emptyConfig && <ClassificationTree config={formerConfig} />}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/DatabasesPage.tsx b/frontend/src/react/pages/settings/DatabasesPage.tsxindex 28ea80f650..4a69111550 100644--- a/frontend/src/react/pages/settings/DatabasesPage.tsx+++ b/frontend/src/react/pages/settings/DatabasesPage.tsx@@ -22,6 +22,10 @@ import { EngineIcon } from "@/react/components/EngineIcon";import { EnvironmentLabel } from "@/react/components/EnvironmentLabel";import { PermissionGuard } from "@/react/components/PermissionGuard";import { Button } from "@/react/components/ui/button";+import {+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import type { DatabaseFilter } from "@/react/lib/databaseFilter";import { router } from "@/react/router";import { useAppStore } from "@/react/stores/app";@@ -495,8 +499,8 @@ export function DatabasesPage() {);return (- <div className="py-4 flex flex-col relative">- <div className="w-full px-4 pb-2 flex flex-col sm:flex-row items-start sm:items-end justify-between gap-2">+ <WorkspacePageLayout padding="flush" className="relative">+ <WorkspacePageToolbar className="px-4 flex-col items-start gap-2 sm:flex-row sm:items-end"><AdvancedSearchparams={searchParams}onParamsChange={setSearchParams}@@ -517,7 +521,7 @@ export function DatabasesPage() {{t("common.create")}</Button></PermissionGuard>- </div>+ </WorkspacePageToolbar><DatabaseTablefilter={filter}@@ -570,6 +574,6 @@ export function DatabasesPage() {onClose={() => setShowTransferDrawer(false)}onTransfer={handleTransferProject}/>- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/GlobalMaskingPage.tsx b/frontend/src/react/pages/settings/GlobalMaskingPage.tsxindex 10a931c8c9..2b02c6d958 100644--- a/frontend/src/react/pages/settings/GlobalMaskingPage.tsx+++ b/frontend/src/react/pages/settings/GlobalMaskingPage.tsx@@ -21,7 +21,6 @@ import {import { ExprEditor, type OptionConfig } from "@/react/components/ExprEditor";import { FeatureAttention } from "@/react/components/FeatureAttention";import { LearnMoreLink } from "@/react/components/LearnMoreLink";-import { Alert } from "@/react/components/ui/alert";import { Button } from "@/react/components/ui/button";import { Input } from "@/react/components/ui/input";import {@@ -31,6 +30,11 @@ import {SelectTrigger,SelectValue,} from "@/react/components/ui/select";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import {factorOperatorOverrideMap,getClassificationLevelOptions,@@ -560,17 +564,25 @@ export function GlobalMaskingPage() {};return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4">+ <WorkspacePageLayout className="gap-y-4"><FeatureAttention feature={PlanFeature.FEATURE_DATA_MASKING} />- {hasSensitiveDataFeature && (- <Alert- variant="info"- description={t("custom-approval.rule.first-match-wins")}- />- )}- {/* Toolbar */}- <div className="flex flex-row items-center justify-end">+ <WorkspacePageInfo+ description={+ <>+ {hasSensitiveDataFeature && (+ <>{t("custom-approval.rule.first-match-wins")} </>+ )}+ {t("settings.sensitive-data.global-rules.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/security/data-masking/overview/?source=console"+ className="text-accent"+ />+ </>+ }+ />++ <WorkspacePageToolbar align="end">{reorderRules ? (<div className="flex items-center gap-x-2"><Button@@ -622,16 +634,7 @@ export function GlobalMaskingPage() {</Button></div>)}- </div>-- {/* Description */}- <div className="textinfolabel">- {t("settings.sensitive-data.global-rules.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/security/data-masking/overview/?source=console"- className="text-accent hover:underline"- />- </div>+ </WorkspacePageToolbar>{/* Empty state */}{items.length === 0 && (@@ -702,6 +705,6 @@ export function GlobalMaskingPage() {</div></div>))}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/GroupsPage.tsx b/frontend/src/react/pages/settings/GroupsPage.tsxindex 816c56b550..d5cffd8fac 100644--- a/frontend/src/react/pages/settings/GroupsPage.tsx+++ b/frontend/src/react/pages/settings/GroupsPage.tsx@@ -57,6 +57,11 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageFooter,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useCurrentUser } from "@/react/hooks/useAppState";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { cn } from "@/react/lib/utils";@@ -1200,9 +1205,9 @@ export function GroupsPage() {};return (- <div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">+ <WorkspacePageLayout>{/* Action bar */}- <div className="flex items-center justify-between gap-x-2 mb-4">+ <WorkspacePageToolbar><SearchInputplaceholder={t("common.filter-by-name")}value={groupSearchText}@@ -1267,7 +1272,7 @@ export function GroupsPage() {</Button>)}</div>- </div>+ </WorkspacePageToolbar>{/* Groups table */}<ComponentPermissionGuard permissions={["bb.groups.list"]}>@@ -1283,7 +1288,7 @@ export function GroupsPage() {onGroupSelected={handleGroupSelected}onGroupDeleted={handleGroupDeleted}/>- <div className="mt-4">+ <WorkspacePageFooter><PagedTableFooterpageSize={groupPaged.pageSize}pageSizeOptions={groupPaged.pageSizeOptions}@@ -1292,7 +1297,7 @@ export function GroupsPage() {isFetchingMore={groupPaged.isFetchingMore}onLoadMore={groupPaged.loadMore}/>- </div>+ </WorkspacePageFooter></>)}</ComponentPermissionGuard>@@ -1318,6 +1323,6 @@ export function GroupsPage() {open={showAadSyncDrawer}onClose={() => setShowAadSyncDrawer(false)}/>- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/IDPDetailPage.tsx b/frontend/src/react/pages/settings/IDPDetailPage.tsxindex d64b22eca1..6d28be3adb 100644--- a/frontend/src/react/pages/settings/IDPDetailPage.tsx+++ b/frontend/src/react/pages/settings/IDPDetailPage.tsx@@ -23,6 +23,10 @@ import {} from "@/react/components/ui/dialog";import { Input } from "@/react/components/ui/input";import { RadioGroup, RadioGroupItem } from "@/react/components/ui/radio-group";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+} from "@/react/components/WorkspacePageLayout";import { router, useCurrentRoute } from "@/react/router";import { WORKSPACE_ROUTE_IDENTITY_PROVIDERS } from "@/react/router/handles";import { useAppStore } from "@/react/stores/app";@@ -1420,14 +1424,18 @@ export function IDPDetailPage() {const ProviderIcon = getProviderIcon(localIdp.type);return (- <div className="w-full px-4 py-4 flex flex-col gap-y-6">- <div className="textinfolabel">- {t("settings.sso.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/administration/sso/overview?source=console"- className="text-accent"- />- </div>+ <WorkspacePageLayout className="gap-y-6">+ <WorkspacePageInfo+ description={+ <>+ {t("settings.sso.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/administration/sso/overview?source=console"+ className="text-accent"+ />+ </>+ }+ /><div className="divide-y divide-block-border">{/* General Section */}@@ -1583,6 +1591,6 @@ export function IDPDetailPage() {onCancel={() => setShowDeleteConfirm(false)}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/IDPsPage.tsx b/frontend/src/react/pages/settings/IDPsPage.tsxindex 44b5c2718d..48adc7644c 100644--- a/frontend/src/react/pages/settings/IDPsPage.tsx+++ b/frontend/src/react/pages/settings/IDPsPage.tsx@@ -53,6 +53,11 @@ import {TableHeader,TableRow,} from "@/react/components/ui/table";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useIdentityProviderList } from "@/react/hooks/useAppState";import { writeTextToClipboard } from "@/react/lib/clipboard";import { router } from "@/react/router";@@ -2054,18 +2059,22 @@ export function IDPsPage() {};return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4">+ <WorkspacePageLayout className="gap-y-4"><FeatureAttention feature={PlanFeature.FEATURE_GOOGLE_AND_GITHUB_SSO} />- <div className="textinfolabel">- {t("settings.sso.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/administration/sso/overview?source=console"- className="text-accent"- />- </div>+ <WorkspacePageInfo+ description={+ <>+ {t("settings.sso.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/administration/sso/overview?source=console"+ className="text-accent"+ />+ </>+ }+ />- <div className="w-full flex justify-end">+ <WorkspacePageToolbar align="end"><PermissionGuard permissions={["bb.identityProviders.create"]}><Button disabled={!canCreate} onClick={handleCreateSSO}><FeatureBadge@@ -2077,7 +2086,7 @@ export function IDPsPage() {{t("common.create")}</Button></PermissionGuard>- </div>+ </WorkspacePageToolbar>{ready ? (<div className="border rounded-sm overflow-hidden">@@ -2135,6 +2144,6 @@ export function IDPsPage() {onCreated={handleProviderCreated}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/IMPage.tsx b/frontend/src/react/pages/settings/IMPage.tsxindex 5d3df9fb2c..38c72f8c73 100644--- a/frontend/src/react/pages/settings/IMPage.tsx+++ b/frontend/src/react/pages/settings/IMPage.tsx@@ -27,6 +27,10 @@ import {SelectTrigger,SelectValue,} from "@/react/components/ui/select";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+} from "@/react/components/WorkspacePageLayout";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";import { WebhookType } from "@/types/proto-es/v1/common_pb";@@ -399,7 +403,7 @@ export function IMPage() {if (settingsView.length === 0) {return (- <div className="w-full px-4 flex flex-col gap-y-4 py-4">+ <WorkspacePageLayout className="gap-y-4"><Description /><div className="py-12 border rounded-sm flex flex-col items-center justify-center gap-y-4 text-control-light"><span>{t("common.no-data")}</span>@@ -415,12 +419,12 @@ export function IMPage() {</PermissionGuard>)}</div>- </div>+ </WorkspacePageLayout>);}return (- <div className="w-full px-4 flex flex-col gap-y-4 py-4">+ <WorkspacePageLayout className="gap-y-4"><Description />{settingsView.map((item, i) => (@@ -515,20 +519,24 @@ export function IMPage() {</PermissionGuard></div>)}- </div>+ </WorkspacePageLayout>);}function Description() {const { t } = useTranslation();return (- <div className="textinfolabel">- {t("settings.im-integration.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/change-database/webhook?source=console"- className="text-accent hover:underline"- />- </div>+ <WorkspacePageInfo+ description={+ <>+ {t("settings.im-integration.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/change-database/webhook?source=console"+ className="text-accent"+ />+ </>+ }+ />);}diff --git a/frontend/src/react/pages/settings/InstancesPage.tsx b/frontend/src/react/pages/settings/InstancesPage.tsxindex 36e2d018d2..b39e87df36 100644--- a/frontend/src/react/pages/settings/InstancesPage.tsx+++ b/frontend/src/react/pages/settings/InstancesPage.tsx@@ -58,6 +58,12 @@ import {TableHeader,TableRow,} from "@/react/components/ui/table";+import {+ WorkspacePageContent,+ WorkspacePageFooter,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useColumnWidths } from "@/react/hooks/useColumnWidths";import { PagedTableFooter } from "@/react/hooks/usePagedData";import {@@ -1091,12 +1097,12 @@ export function InstancesPage() {const { widths, totalWidth, onResizeStart } = useColumnWidths(columns);return (- <div className="py-4 flex flex-col">+ <WorkspacePageLayout padding="flush">{/* Instance count warning */}{quotaExhausted && (<Alertvariant="warning"- className="mx-4 mb-4"+ className="mb-4"title={t("subscription.usage.instance-count.title")}description={t("subscription.usage.instance-count.runoutof", {total: instanceCountLimit,@@ -1105,7 +1111,7 @@ export function InstancesPage() {)}{/* Header: Search + Create */}- <div className="flex items-center justify-between px-4 pb-2 gap-x-2">+ <WorkspacePageToolbar className="px-4"><AdvancedSearchparams={searchParams}scopeOptions={scopeOptions}@@ -1118,9 +1124,9 @@ export function InstancesPage() {{t("common.create")}</Button></PermissionGuard>- </div>+ </WorkspacePageToolbar>- <div className="overflow-x-auto border rounded-sm">+ <WorkspacePageContent className="overflow-x-auto border rounded-sm"><Table className="table-fixed" style={{ minWidth: `${totalWidth}px` }}><colgroup>{widths.map((w, i) => (@@ -1205,9 +1211,9 @@ export function InstancesPage() {)}</TableBody></Table>- </div>+ </WorkspacePageContent>- <div className="mt-4 mx-2">+ <WorkspacePageFooter><PagedTableFooterpageSize={pageSize}pageSizeOptions={pageSizeOptions}@@ -1216,7 +1222,7 @@ export function InstancesPage() {isFetchingMore={isFetchingMore}onLoadMore={loadMore}/>- </div>+ </WorkspacePageFooter>{/* Batch operations bar (sticky at bottom; rendered after thetable so selection doesn't shift table position) */}@@ -1291,6 +1297,6 @@ export function InstancesPage() {onUpdated={handleRowAction}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/MembersPage.tsx b/frontend/src/react/pages/settings/MembersPage.tsxindex 85db84ad68..992fbe8795 100644--- a/frontend/src/react/pages/settings/MembersPage.tsx+++ b/frontend/src/react/pages/settings/MembersPage.tsx@@ -34,6 +34,11 @@ import { ExprEditor, type OptionConfig } from "@/react/components/ExprEditor";import { FeatureBadge } from "@/react/components/FeatureBadge";import { LearnMoreLink } from "@/react/components/LearnMoreLink";import { PermissionGuard } from "@/react/components/PermissionGuard";+import {+ ProjectPageInfo,+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import { RoleSelect } from "@/react/components/RoleSelect";import { DDLWarningCallout } from "@/react/components/role-grant/DDLWarningCallout";import { UserCell } from "@/react/components/UserCell";@@ -69,6 +74,10 @@ import {TabsTrigger,} from "@/react/components/ui/tabs";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useCurrentUser } from "@/react/hooks/useAppState";import { useEscapeKey } from "@/react/hooks/useEscapeKey";import { useProjectByName } from "@/react/hooks/useProjectByName";@@ -2246,8 +2255,11 @@ export function MembersPage({ projectId }: { projectId?: string }) {[project]);+ const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout;+ const PageToolbar = projectName ? ProjectPageToolbar : WorkspacePageToolbar;+return (- <div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">+ <PageLayout>{!projectName && remainingUserCount <= 3 && (<Alertvariant="warning"@@ -2269,16 +2281,21 @@ export function MembersPage({ projectId }: { projectId?: string }) {/>)}{projectName && (- <div className="textinfolabel mb-4">- {t("project.members.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/administration/roles/?source=console#project-roles"- className="text-accent"- />- </div>+ <ProjectPageInfo+ className="mb-2"+ description={+ <>+ {t("project.members.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/administration/roles/?source=console#project-roles"+ className="text-accent"+ />+ </>+ }+ />)}- <div className="flex items-center justify-between gap-x-2 mb-4">+ <PageToolbar><SearchInputplaceholder={t("settings.members.search-member")}value={memberSearchText}@@ -2352,7 +2369,7 @@ export function MembersPage({ projectId }: { projectId?: string }) {</PermissionGuard>))}</div>- </div>+ </PageToolbar><Tabsvalue={memberViewTab}@@ -2410,6 +2427,6 @@ export function MembersPage({ projectId }: { projectId?: string }) {}}/>)}- </div>+ </PageLayout>);}diff --git a/frontend/src/react/pages/settings/ProjectsPage.tsx b/frontend/src/react/pages/settings/ProjectsPage.tsxindex d2d5ce449a..235262fa48 100644--- a/frontend/src/react/pages/settings/ProjectsPage.tsx+++ b/frontend/src/react/pages/settings/ProjectsPage.tsx@@ -27,6 +27,12 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from "@/react/components/ui/dropdown-menu";+import {+ WorkspacePageContent,+ WorkspacePageFooter,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { PagedTableFooter } from "@/react/hooks/usePagedData";import {getPageSizeOptions,@@ -607,9 +613,9 @@ export function ProjectsPage() {const pageSizeOptions = getPageSizeOptions();return (- <div className="py-4 flex flex-col">+ <WorkspacePageLayout padding="flush">{/* Header: Search + Create */}- <div className="flex items-center justify-between px-4 pb-2 gap-x-2">+ <WorkspacePageToolbar className="px-4"><AdvancedSearchparams={searchParams}scopeOptions={scopeOptions}@@ -625,9 +631,9 @@ export function ProjectsPage() {{t("common.create")}</Button></PermissionGuard>- </div>+ </WorkspacePageToolbar>- <div className="overflow-x-auto border rounded-sm">+ <WorkspacePageContent className="overflow-x-auto border rounded-sm"><ProjectTableclassName="min-w-[700px]"projectList={projects}@@ -650,9 +656,9 @@ export function ProjectsPage() {onSortChange={(key) => toggleSort(key)}onRowClick={(project, e) => handleRowClick(project, e)}/>- </div>+ </WorkspacePageContent>- <div className="mt-4 mx-2">+ <WorkspacePageFooter><PagedTableFooterpageSize={pageSize}pageSizeOptions={pageSizeOptions}@@ -661,7 +667,7 @@ export function ProjectsPage() {isFetchingMore={isFetchingMore}onLoadMore={loadMore}/>- </div>+ </WorkspacePageFooter>{/* Batch operations bar (sticky at bottom; rendered after thetable so selection doesn't shift table position) */}@@ -749,6 +755,6 @@ export function ProjectsPage() {</div></div></ConfirmDialog>- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/RiskAssessmentPage.tsx b/frontend/src/react/pages/settings/RiskAssessmentPage.tsxindex 24d04e4d9c..af52424395 100644--- a/frontend/src/react/pages/settings/RiskAssessmentPage.tsx+++ b/frontend/src/react/pages/settings/RiskAssessmentPage.tsx@@ -1,18 +1,20 @@import { useTranslation } from "react-i18next";import { FeatureAttention } from "@/react/components/FeatureAttention";import { Badge } from "@/react/components/ui/badge";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+} from "@/react/components/WorkspacePageLayout";import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";export function RiskAssessmentPage() {const { t } = useTranslation();return (- <div className="w-full px-4 py-4 flex flex-col gap-y-6 text-sm">+ <WorkspacePageLayout className="gap-y-6 text-sm"><FeatureAttention feature={PlanFeature.FEATURE_RISK_ASSESSMENT} />- <div className="textinfolabel">- {t("custom-approval.risk.description")}- </div>+ <WorkspacePageInfo description={t("custom-approval.risk.description")} /><div className="flex flex-col gap-6"><div>@@ -65,6 +67,6 @@ export function RiskAssessmentPage() {</p></div></div>- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/RolesPage.tsx b/frontend/src/react/pages/settings/RolesPage.tsxindex a1d53d13e6..ae6c848609 100644--- a/frontend/src/react/pages/settings/RolesPage.tsx+++ b/frontend/src/react/pages/settings/RolesPage.tsx@@ -52,6 +52,11 @@ import {} from "@/react/components/ui/table";import { Textarea } from "@/react/components/ui/textarea";import { BlockTooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import {displayRoleDescriptionFromList,displayRoleTitleFromList,@@ -777,20 +782,24 @@ export function RolesPage() {};return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4">+ <WorkspacePageLayout className="gap-y-4">{showFeatureModal && (<FeatureAttention feature={PlanFeature.FEATURE_CUSTOM_ROLES} />)}- <div className="textinfolabel">- {t("role.setting.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/administration/roles?source=console"- className="text-accent"- />- </div>+ <WorkspacePageInfo+ description={+ <>+ {t("role.setting.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/administration/roles?source=console"+ className="text-accent"+ />+ </>+ }+ />- <div className="w-full flex justify-end">+ <WorkspacePageToolbar align="end"><PermissionGuard permissions={["bb.roles.create"]}><Button disabled={!canCreate} onClick={addRole}><FeatureBadge@@ -802,7 +811,7 @@ export function RolesPage() {{t("common.create")}</Button></PermissionGuard>- </div>+ </WorkspacePageToolbar>{/* Roles Table */}{ready ? (@@ -900,6 +909,6 @@ export function RolesPage() {onCancel={() => setDeleteTarget(undefined)}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/SQLReviewPage.tsx b/frontend/src/react/pages/settings/SQLReviewPage.tsxindex 84d1766d03..747199113e 100644--- a/frontend/src/react/pages/settings/SQLReviewPage.tsx+++ b/frontend/src/react/pages/settings/SQLReviewPage.tsx@@ -17,6 +17,11 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { router } from "@/react/router";import {WORKSPACE_ROUTE_SQL_REVIEW_CREATE,@@ -278,16 +283,20 @@ export function SQLReviewPage() {);return (- <div className="px-4 py-4 mx-auto flex flex-col gap-y-4">- <div className="textinfolabel">- {t("sql-review.description")}{" "}- <LearnMoreLink- href="https://docs.bytebase.com/sql-review/review-rules?source=console"- className="normal-link"- />- </div>+ <WorkspacePageLayout className="gap-y-4">+ <WorkspacePageInfo+ description={+ <>+ {t("sql-review.description")}{" "}+ <LearnMoreLink+ href="https://docs.bytebase.com/sql-review/review-rules?source=console"+ className="text-accent"+ />+ </>+ }+ />- <div className="flex justify-end items-center gap-x-2">+ <WorkspacePageToolbar align="end"><SearchInputvalue={searchText}onChange={(e) => setSearchText(e.target.value)}@@ -301,7 +310,7 @@ export function SQLReviewPage() {{t("common.create")}</Button>)}- </div>+ </WorkspacePageToolbar>{policyList.length > 0 ? (<PolicyTable@@ -320,6 +329,6 @@ export function SQLReviewPage() {)}</div>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/SemanticTypesPage.tsx b/frontend/src/react/pages/settings/SemanticTypesPage.tsxindex 381dd16358..e0abd57485 100644--- a/frontend/src/react/pages/settings/SemanticTypesPage.tsx+++ b/frontend/src/react/pages/settings/SemanticTypesPage.tsx@@ -30,6 +30,11 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageInfo,+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useAppStore } from "@/react/stores/app";import { pushNotification } from "@/store";import { getSemanticTemplateList } from "@/types";@@ -338,9 +343,13 @@ export function SemanticTypesPage() {};return (- <div className="w-full px-4 py-4 flex flex-col gap-y-4">+ <WorkspacePageLayout><FeatureAttention feature={PlanFeature.FEATURE_DATA_MASKING} />- <div className="flex justify-end">+ <WorkspacePageInfo+ description={t("settings.sensitive-data.semantic-types.label")}+ />++ <WorkspacePageToolbar align="end"><div className="flex items-center gap-x-2"><Buttonappearance="outline"@@ -354,11 +363,7 @@ export function SemanticTypesPage() {{t("common.create")}</Button></div>- </div>-- <p className="text-sm text-control-placeholder">- {t("settings.sensitive-data.semantic-types.label")}- </p>+ </WorkspacePageToolbar><div className="border rounded-sm overflow-hidden"><Table>@@ -432,7 +437,7 @@ export function SemanticTypesPage() {onDismiss={() => setAlgorithmDrawer(null)}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/ServiceAccountsPage.tsx b/frontend/src/react/pages/settings/ServiceAccountsPage.tsxindex 3c1fa6fa57..8d4657f45f 100644--- a/frontend/src/react/pages/settings/ServiceAccountsPage.tsx+++ b/frontend/src/react/pages/settings/ServiceAccountsPage.tsx@@ -4,6 +4,10 @@ import { Copy, KeyRound, Plus, Trash2, Undo2 } from "lucide-react";import { useCallback, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { PermissionGuard } from "@/react/components/PermissionGuard";+import {+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import { RoleSelect } from "@/react/components/RoleSelect";import { UserCell } from "@/react/components/UserCell";import { Badge } from "@/react/components/ui/badge";@@ -28,6 +32,10 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { useProjectByName } from "@/react/hooks/useProjectByName";import { writeTextToClipboard } from "@/react/lib/clipboard";@@ -739,10 +747,13 @@ export function ServiceAccountsPage({ projectId }: { projectId?: string }) {activeData.updateCache([serviceAccountToUser(sa)]);};+ const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout;+ const PageToolbar = projectName ? ProjectPageToolbar : WorkspacePageToolbar;+return (- <div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">+ <PageLayout>{/* Header */}- <div className="flex items-center justify-between mb-4">+ <PageToolbar><h2 className="text-lg font-medium leading-7 text-main">{t("settings.members.service-accounts")}</h2>@@ -766,7 +777,7 @@ export function ServiceAccountsPage({ projectId }: { projectId?: string }) {{t("common.create")}</Button></PermissionGuard>- </div>+ </PageToolbar><div className="flex flex-col gap-y-4">{/* Active list */}@@ -847,6 +858,6 @@ export function ServiceAccountsPage({ projectId }: { projectId?: string }) {onCreated={handleCreated}onUpdated={handleUpdated}/>- </div>+ </PageLayout>);}diff --git a/frontend/src/react/pages/settings/SubscriptionPage.tsx b/frontend/src/react/pages/settings/SubscriptionPage.tsxindex 3be53b47b6..01f775e0d6 100644--- a/frontend/src/react/pages/settings/SubscriptionPage.tsx+++ b/frontend/src/react/pages/settings/SubscriptionPage.tsx@@ -16,6 +16,7 @@ import {} from "@/react/components/ui/form";import { Input } from "@/react/components/ui/input";import { Textarea } from "@/react/components/ui/textarea";+import { WorkspacePageLayout } from "@/react/components/WorkspacePageLayout";import {useNotify,useServerState,@@ -168,9 +169,9 @@ export function SubscriptionPage({};return (- <div className="w-full px-4 py-4 mx-auto">+ <WorkspacePageLayout>{/* Plan stats grid */}- <div className="w-full grid grid-cols-2 gap-6 lg:grid-cols-3 3xl:grid-cols-4 my-4">+ <div className="w-full grid grid-cols-2 gap-6 lg:grid-cols-3 3xl:grid-cols-4 mb-4">{/* Current plan */}<div className="flex flex-col text-left"><div className="flex items-center text-main">@@ -378,7 +379,7 @@ export function SubscriptionPage({onOpenChange={setShowInstanceAssignmentSheet}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/UsersPage.tsx b/frontend/src/react/pages/settings/UsersPage.tsxindex 7193450050..0067970d41 100644--- a/frontend/src/react/pages/settings/UsersPage.tsx+++ b/frontend/src/react/pages/settings/UsersPage.tsx@@ -41,6 +41,10 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { useCurrentUser } from "@/react/hooks/useAppState";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { cn } from "@/react/lib/utils";@@ -1006,9 +1010,9 @@ export function UsersPage() {};return (- <div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">+ <WorkspacePageLayout>{/* Action bar */}- <div className="flex items-center justify-between gap-x-2 mb-4">+ <WorkspacePageToolbar><SearchInputplaceholder={t("common.filter-by-name")}value={userSearchText}@@ -1038,7 +1042,7 @@ export function UsersPage() {{t("common.create")}</Button></div>- </div>+ </WorkspacePageToolbar><div className="flex flex-col gap-y-4"><ComponentPermissionGuard permissions={["bb.users.list"]}>@@ -1145,6 +1149,6 @@ export function UsersPage() {open={showAadSyncDrawer}onClose={() => setShowAadSyncDrawer(false)}/>- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx b/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsxindex 057f1430cf..44154dda86 100644--- a/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx+++ b/frontend/src/react/pages/settings/WorkloadIdentitiesPage.tsx@@ -3,6 +3,10 @@ import { useCallback, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { CreateWorkloadIdentitySheet } from "@/react/components/CreateWorkloadIdentitySheet";import { PermissionGuard } from "@/react/components/PermissionGuard";+import {+ ProjectPageLayout,+ ProjectPageToolbar,+} from "@/react/components/ProjectPageLayout";import { UserCell } from "@/react/components/UserCell";import { Button } from "@/react/components/ui/button";import { Checkbox } from "@/react/components/ui/checkbox";@@ -16,6 +20,10 @@ import {TableRow,} from "@/react/components/ui/table";import { Tooltip } from "@/react/components/ui/tooltip";+import {+ WorkspacePageLayout,+ WorkspacePageToolbar,+} from "@/react/components/WorkspacePageLayout";import { PagedTableFooter, usePagedData } from "@/react/hooks/usePagedData";import { useProjectByName } from "@/react/hooks/useProjectByName";import { cn } from "@/react/lib/utils";@@ -345,10 +353,13 @@ export function WorkloadIdentitiesPage({ projectId }: { projectId?: string }) {setShowDrawer(true);};+ const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout;+ const PageToolbar = projectName ? ProjectPageToolbar : WorkspacePageToolbar;+return (- <div className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4">+ <PageLayout>{/* Header */}- <div className="flex items-center justify-between mb-4">+ <PageToolbar><p className="text-lg font-medium leading-7 text-main">{t("settings.members.workload-identities")}</p>@@ -375,7 +386,7 @@ export function WorkloadIdentitiesPage({ projectId }: { projectId?: string }) {{t("common.create")}</Button></PermissionGuard>- </div>+ </PageToolbar><div className="flex flex-col gap-y-4">{activeData.isLoading && activeData.dataList.length === 0 ? (@@ -458,6 +469,6 @@ export function WorkloadIdentitiesPage({ projectId }: { projectId?: string }) {activeData.updateCache([workloadIdentityToUser(wi)]);}}/>- </div>+ </PageLayout>);}diff --git a/frontend/src/react/pages/settings/WorkspacePageLayout.test.ts b/frontend/src/react/pages/settings/WorkspacePageLayout.test.tsnew file mode 100644index 0000000000..aaed02167e--- /dev/null+++ b/frontend/src/react/pages/settings/WorkspacePageLayout.test.ts@@ -0,0 +1,155 @@+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { describe, expect, test } from "vitest";++const settingsDir = import.meta.dirname;+const componentsDir = join(settingsDir, "../../components");++const workspaceListPages = [+ "AuditLogPage.tsx",+ "DatabasesPage.tsx",+ "GroupsPage.tsx",+ "InstancesPage.tsx",+ "MembersPage.tsx",+ "ProjectsPage.tsx",+ "SemanticTypesPage.tsx",+ "ServiceAccountsPage.tsx",+ "UsersPage.tsx",+ "WorkloadIdentitiesPage.tsx",+] as const;++const workspaceInfoPages = [+ "RolesPage.tsx",+ "IDPsPage.tsx",+ "IDPDetailPage.tsx",+ "SQLReviewPage.tsx",+ "RiskAssessmentPage.tsx",+ "CustomApprovalPage.tsx",+ "DataClassificationPage.tsx",+ "GlobalMaskingPage.tsx",+ "SemanticTypesPage.tsx",+ "IMPage.tsx",+] as const;++const workspaceRhythmPages = [+ "general/GeneralPage.tsx",+ "SubscriptionPage.tsx",+ "CustomApprovalPage.tsx",+] as const;++const adaptiveWorkspaceListPages = [+ "MembersPage.tsx",+ "ServiceAccountsPage.tsx",+ "WorkloadIdentitiesPage.tsx",+] as const;++const flushWorkspaceListPages = [+ "DatabasesPage.tsx",+ "InstancesPage.tsx",+ "ProjectsPage.tsx",+] as const;++function readSettingsPage(+ file:+ | (typeof workspaceListPages)[number]+ | (typeof workspaceInfoPages)[number]+ | (typeof workspaceRhythmPages)[number]+) {+ return readFileSync(join(settingsDir, file), "utf8");+}++describe("workspace list page layout", () => {+ test("supports explicit workspace shell padding modes", () => {+ const source = readFileSync(+ join(componentsDir, "WorkspacePageLayout.tsx"),+ "utf8"+ );++ expect(source).toContain("paddingBlock: 16");+ expect(source).toContain("rowGap: 16");+ expect(source).toContain('padding?: "page" | "flush"');+ expect(source).toContain('padding = "page"');+ expect(source).toContain("pagePadding");+ expect(source).toContain("paddingInline: 16");+ expect(source).not.toContain("paddingBottom: 8");+ });++ test("uses the shared workspace layout shell instead of page-local padding", () => {+ for (const file of workspaceListPages) {+ const source = readSettingsPage(file);++ expect(source, file).toContain("@/react/components/WorkspacePageLayout");+ if (+ adaptiveWorkspaceListPages.includes(+ file as (typeof adaptiveWorkspaceListPages)[number]+ )+ ) {+ expect(source, file).toContain(+ "const PageLayout = projectName ? ProjectPageLayout : WorkspacePageLayout"+ );+ expect(source, file).toContain("<PageLayout>");+ } else {+ expect(source, file).toContain("<WorkspacePageLayout");+ }+ if (+ flushWorkspaceListPages.includes(+ file as (typeof flushWorkspaceListPages)[number]+ )+ ) {+ expect(source, file).toContain('padding="flush"');+ expect(source, file).toContain('<WorkspacePageToolbar className="px-4');+ }+ expect(source, file).not.toContain(+ 'className="w-full px-4 overflow-x-hidden flex flex-col pt-2 pb-4"'+ );+ expect(source, file).not.toContain('className="py-4 flex flex-col"');+ expect(source, file).not.toContain(+ 'className="py-4 flex flex-col relative"'+ );+ }+ });++ test("uses shared workspace info surfaces for persistent page descriptions", () => {+ for (const file of workspaceInfoPages) {+ const source = readSettingsPage(file);++ expect(source, file).toContain("WorkspacePageInfo");+ }+ });++ test("uses shared workspace shell instead of page-local top spacing", () => {+ for (const file of workspaceRhythmPages) {+ const source = readSettingsPage(file);++ expect(source, file).toContain("<WorkspacePageLayout");+ expect(source, file).not.toContain('className="w-full px-4 py-4');+ expect(source, file).not.toContain('className="px-4 py-4');+ }+ });++ test("does not stack page top padding with general settings form sections", () => {+ const source = readSettingsPage("general/GeneralPage.tsx");++ expect(source).toContain(+ '<WorkspacePageLayout className="py-0 divide-y divide-block-border">'+ );+ });++ test("does not reserve top gap for hidden custom approval feature attention", () => {+ const source = readSettingsPage("CustomApprovalPage.tsx");++ expect(source).toContain(+ '<div ref={featureAttentionRef} className="empty:hidden">'+ );+ });++ test("combines global masking info into one shared info surface", () => {+ const source = readSettingsPage("GlobalMaskingPage.tsx");++ expect(source).not.toContain("@/react/components/ui/alert");+ expect(source).toContain("custom-approval.rule.first-match-wins");+ expect(source).toContain(+ "settings.sensitive-data.global-rules.description"+ );+ });+});diff --git a/frontend/src/react/pages/settings/general/GeneralPage.tsx b/frontend/src/react/pages/settings/general/GeneralPage.tsxindex f0cc15d6b6..dfd197dddb 100644--- a/frontend/src/react/pages/settings/general/GeneralPage.tsx+++ b/frontend/src/react/pages/settings/general/GeneralPage.tsx@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";import { PermissionGuard } from "@/react/components/PermissionGuard";import { Button } from "@/react/components/ui/button";import { StickyActionFooter } from "@/react/components/ui/sticky-action-footer";+import { WorkspacePageLayout } from "@/react/components/WorkspacePageLayout";import { useServerState } from "@/react/hooks/useAppState";import { useUnsavedChangesGuard } from "@/react/hooks/useUnsavedChangesGuard";import { pushNotification } from "@/store";@@ -144,7 +145,7 @@ export function GeneralPage() {}, []);return (- <div className="px-4 divide-y divide-block-border py-4">+ <WorkspacePageLayout className="py-0 divide-y divide-block-border"><GeneralSectionref={generalRef}title={t("common.general")}@@ -218,6 +219,6 @@ export function GeneralPage() {right={<Button onClick={handleUpdate}>{t("common.update")}</Button>}/>)}- </div>+ </WorkspacePageLayout>);}diff --git a/frontend/src/react/pages/settings/general/GeneralPageLayout.test.ts b/frontend/src/react/pages/settings/general/GeneralPageLayout.test.tsindex 3cd7d262bf..c55f1c2705 100644--- a/frontend/src/react/pages/settings/general/GeneralPageLayout.test.ts+++ b/frontend/src/react/pages/settings/general/GeneralPageLayout.test.ts@@ -44,6 +44,12 @@ describe("GeneralPage section layout", () => {expect(source).not.toContain(`type=${JSON.stringify("radio")}`);});+ test("does not add top padding to the first general settings section", () => {+ const source = readFileSync(join(sectionDir, "GeneralSection.tsx"), "utf8");++ expect(source).toContain("style={{ paddingTop: 8 }}");+ });+test("uses merged form field props for migrated field headings", () => {for (const file of configurableSections) {const source = readFileSync(join(sectionDir, file), "utf8");diff --git a/frontend/src/react/pages/settings/general/GeneralSection.tsx b/frontend/src/react/pages/settings/general/GeneralSection.tsxindex ea8c819695..eef4ed0da9 100644--- a/frontend/src/react/pages/settings/general/GeneralSection.tsx+++ b/frontend/src/react/pages/settings/general/GeneralSection.tsx@@ -130,7 +130,7 @@ export const GeneralSection = forwardRef<SectionHandle, GeneralSectionProps>(return (<>- <FormSection title={title}>+ <FormSection title={title} style={{ paddingTop: 8 }}><PermissionGuardpermissions={["bb.settings.setWorkspaceProfile"]}display="block"