Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(plan-list): drop checks column, lead with creator, widen title (#20375)
zchpeter6e79d961c8a4
diff --git a/frontend/src/react/pages/project/ProjectPlanDashboardPage.columns.test.ts b/frontend/src/react/pages/project/ProjectPlanDashboardPage.columns.test.tsnew file mode 100644index 0000000000..89f9988f56--- /dev/null+++ b/frontend/src/react/pages/project/ProjectPlanDashboardPage.columns.test.ts@@ -0,0 +1,77 @@+import { describe, expect, test } from "vitest";++import source from "./ProjectPlanDashboardPage.tsx?raw";++// Capture every `key: "..."` object-literal occurrence in this file's source.+// Only the columns array uses this syntax here, so the broad pattern forces any+// new column entry to be reflected in the expected-order assertion below. If+// the column definitions are ever extracted to a helper module, this test must+// be rewritten against the runtime value (or the helper's source).+const columnKeyOrder = (src: string): string[] => {+ return Array.from(src.matchAll(/key:\s*"(\w+)"/g), (m) => m[1]);+};++// Returns the slice of source bounded by `key: "<key>"` and the next column+// entry, or the close of the columns array (the `],` immediately followed by+// the `useMemo` deps `[`). Per-property assertions inside the slice are+// independent of property declaration order. The `\],\s*\[` boundary is more+// specific than a bare `\],` so it won't be cut short by an incidental inline+// `],` in a render's JSX.+const columnEntry = (src: string, key: string): string => {+ const re = new RegExp(`key:\\s*"${key}",[\\s\\S]*?(?=key:\\s*"|\\],\\s*\\[)`);+ const match = src.match(re);+ expect(match, `expected to find column entry for "${key}"`).not.toBeNull();+ return match?.[0] ?? "";+};++describe("plan list column composition", () => {+ test("renders five columns in priority order", () => {+ expect(columnKeyOrder(source)).toEqual([+ "name",+ "creator",+ "review",+ "stages",+ "updated",+ ]);+ });++ test("drops the checks column from the navigation surface", () => {+ expect(source).not.toContain('key: "checks"');+ });++ test("name carries the tuned default width for plan titles", () => {+ // P0 column for the navigation surface: holds UID + title + optional+ // lifecycle badge. 400px gives ~45 effective chars for the title with a+ // badge present, covering typical long plan titles before truncation.+ const entry = columnEntry(source, "name");+ expect(entry.match(/defaultWidth:\s*(\d+)/)?.[1]).toBe("400");+ expect(entry.match(/minWidth:\s*(\d+)/)?.[1]).toBe("200");+ });++ test("creator carries the tuned default width and min width", () => {+ const entry = columnEntry(source, "creator");+ expect(entry.match(/defaultWidth:\s*(\d+)/)?.[1]).toBe("160");+ expect(entry.match(/minWidth:\s*(\d+)/)?.[1]).toBe("100");+ });++ test("creator render truncates long titles on a block element", () => {+ // The full truncation contract: a block-level container fills the cell+ // width, then `truncate` clips with an ellipsis. If either piece is+ // missing, long creator names won't ellipsize cleanly. Anchor on `<span`+ // so the assertion stays on the truncating element even if a future+ // refactor wraps it with another element (e.g. a tooltip) that carries+ // its own `className`.+ const entry = columnEntry(source, "creator");+ const spanClass = entry.match(/<span\s+className="([^"]+)"/);+ expect(spanClass).not.toBeNull();+ expect(spanClass?.[1]).toContain("block");+ expect(spanClass?.[1]).toContain("truncate");+ });++ test("PlanRowContext does not carry check-summary plumbing", () => {+ // Once the column is gone, the per-row context shouldn't compute or carry+ // check summaries — that work is dead weight on the navigation surface.+ expect(source).not.toContain("checkSummary");+ expect(source).not.toContain("hasAnyCheck");+ });+});diff --git a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsxindex e5f8c7a418..b83f119b60 100644--- a/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx+++ b/frontend/src/react/pages/project/ProjectPlanDashboardPage.tsx@@ -1,6 +1,5 @@import { create as createProto } from "@bufbuild/protobuf";import {- AlertCircle,CheckCircle,Database as DatabaseIcon,FolderTree,@@ -389,13 +388,6 @@ interface PlanRowContext {creator: { title: string; name: string };updateTimeTs: number;approvalTag: { label: string; variant: ReviewBadge["variant"] } | undefined;- checkSummary: {- running: number;- success: number;- warning: number;- error: number;- };- hasAnyCheck: boolean;isDeleted: boolean;showDraftTag: boolean;environmentStore: ReturnType<typeof useEnvironmentV1Store>;@@ -418,7 +410,7 @@ function PlanTable({ plans, projectId }: { plans: Plan[]; projectId: string }) {{key: "name",title: t("issue.table.name"),- defaultWidth: 320,+ defaultWidth: 400,minWidth: 200,resizable: true,render: (plan, ctx) => (@@ -445,42 +437,14 @@ function PlanTable({ plans, projectId }: { plans: Plan[]; projectId: string }) {),},{- key: "checks",- title: t("plan.checks.self"),- defaultWidth: 200,- minWidth: 120,+ key: "creator",+ title: t("issue.table.creator"),+ defaultWidth: 160,+ minWidth: 100,resizable: true,- render: (_plan, ctx) =>- ctx.hasAnyCheck ? (- <div className="flex items-center gap-3 flex-wrap">- {ctx.checkSummary.running > 0 && (- <div className="flex items-center gap-1 text-control">- <Loader2 className="size-4 animate-spin" />- <span>{t("task.status.running")}</span>- </div>- )}- {ctx.checkSummary.error > 0 && (- <div className="flex items-center gap-1 text-error">- <XCircle className="size-4" />- <span>{ctx.checkSummary.error}</span>- </div>- )}- {ctx.checkSummary.warning > 0 && (- <div className="flex items-center gap-1 text-warning">- <AlertCircle className="size-4" />- <span>{ctx.checkSummary.warning}</span>- </div>- )}- {ctx.checkSummary.success > 0 && (- <div className="flex items-center gap-1 text-success">- <CheckCircle className="size-4" />- <span>{ctx.checkSummary.success}</span>- </div>- )}- </div>- ) : (- <span className="text-control-light">-</span>- ),+ render: (_plan, ctx) => (+ <span className="block truncate">{ctx.creator.title}</span>+ ),},{key: "review",@@ -549,20 +513,6 @@ function PlanTable({ plans, projectId }: { plans: Plan[]; projectId: string }) {</Tooltip>),},- {- key: "creator",- title: t("issue.table.creator"),- defaultWidth: 152,- minWidth: 100,- resizable: true,- render: (_plan, ctx) => (- <div className="flex items-center gap-x-1.5">- <span className="text-sm truncate min-w-0">- {ctx.creator.title}- </span>- </div>- ),- },],[t]);@@ -676,28 +626,10 @@ function PlanRow({return { label: t(badge.labelKey), variant: badge.variant };}, [plan.approvalStatus, plan.hasRollout, plan.issue, t]);- const checkSummary = useMemo(() => {- const statusCount = plan.planCheckRunStatusCount || {};- const running = statusCount["RUNNING"] || 0;- const success = statusCount["SUCCESS"] || 0;- const warning = statusCount["WARNING"] || 0;- const error = (statusCount["ERROR"] || 0) + (statusCount["FAILED"] || 0);- return { running, success, warning, error };- }, [plan.planCheckRunStatusCount]);-- const hasAnyCheck =- checkSummary.running +- checkSummary.success +- checkSummary.warning +- checkSummary.error >- 0;-const ctx: PlanRowContext = {creator,updateTimeTs,approvalTag,- checkSummary,- hasAnyCheck,isDeleted,showDraftTag,environmentStore,