From fff07ada83071a219dce2cb237618b7f18a64030 Mon Sep 17 00:00:00 2001 From: zipg Date: Mon, 10 Aug 2026 10:32:46 +0800 Subject: [PATCH] fix(grid): remove inline NULL badge from result header Co-authored-by: zipg <4047349+zipg@users.noreply.github.com> --- apps/desktop/src/components/grid/DataGridColumnHeader.vue | 5 +---- .../components/grid/__tests__/DataGridSurfaces.spec.ts | 8 +++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGridColumnHeader.vue b/apps/desktop/src/components/grid/DataGridColumnHeader.vue index 6589ff2e68..9fc1f0bc99 100644 --- a/apps/desktop/src/components/grid/DataGridColumnHeader.vue +++ b/apps/desktop/src/components/grid/DataGridColumnHeader.vue @@ -75,10 +75,7 @@ const emit = defineEmits<{ - - {{ name }} - NULL - + {{ name }} {{ columnType }} {{ columnComment diff --git a/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts b/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts index 3b4dae4139..b3ebf55e71 100644 --- a/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts +++ b/apps/desktop/src/components/grid/__tests__/DataGridSurfaces.spec.ts @@ -387,7 +387,7 @@ describe("DataGridColumnHeader", () => { expect(findAll(mounted.root, (node) => node.props["data-grid-header-comment-line"] === "")).toHaveLength(0); }); - it("marks nullable columns without marking required columns", () => { + it("shows column nullability in the header tooltip without an inline badge", () => { const baseProps = { name: "nickname", actualColumnIndex: 1, @@ -406,12 +406,10 @@ describe("DataGridColumnHeader", () => { }; const nullable = mountComponent(DataGridColumnHeader, { ...baseProps, columnNullability: "nullable" }); const required = mountComponent(DataGridColumnHeader, { ...baseProps, columnNullability: "required" }); - const badge = findOne(nullable.root, (node) => node.props["data-grid-header-nullable"] === ""); - expect(hostText(badge).trim()).toBe("NULL"); - expect(badge.props.title).toBe("nullable"); - expect(hostText(nullable.root)).toContain("nullableyes"); + expect(findAll(nullable.root, (node) => node.props["data-grid-header-nullable"] === "")).toHaveLength(0); expect(findAll(required.root, (node) => node.props["data-grid-header-nullable"] === "")).toHaveLength(0); + expect(hostText(nullable.root)).toContain("nullableyes"); expect(hostText(required.root)).toContain("nullableno"); }); });