diff --git a/solvway-admin-portal/app/components/ui/data-table.pinned.test.tsx b/solvway-admin-portal/app/components/ui/data-table.pinned.test.tsx new file mode 100644 index 0000000..0b49f9c --- /dev/null +++ b/solvway-admin-portal/app/components/ui/data-table.pinned.test.tsx @@ -0,0 +1,15 @@ +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; + +// refine-visitor-pages-and-shell: the pinned first column hides the left scroll cue, so it carries +// a divider on its right edge that shows where scrolled columns slide under it. +describe("pinned first column", () => { + const src = readFileSync(join(__dirname, "data-table.tsx"), "utf8"); + it("draws a token-coloured divider on the right edge of pinned head and body cells", () => { + for (const name of ["PINNED_HEAD", "PINNED_CELL"]) { + const value = src.match(new RegExp(`const ${name}\\s*=\\s*\\n?\\s*'([^']*)'`))?.[1] ?? ""; + expect(value, name).toContain("shadow-[inset_-1px_0_0_var(--border)]"); + } + }); +}); diff --git a/solvway-admin-portal/app/components/ui/data-table.tsx b/solvway-admin-portal/app/components/ui/data-table.tsx index 6eb1a12..7463b2a 100644 --- a/solvway-admin-portal/app/components/ui/data-table.tsx +++ b/solvway-admin-portal/app/components/ui/data-table.tsx @@ -42,12 +42,13 @@ declare module '@tanstack/react-table' { // The first column stays visible while a wide table scrolls sideways. Its cells need an opaque // background that follows the row's hover/focus/selected state, or scrolled cells show through. -const PINNED_HEAD = 'sticky left-0 z-[1] bg-table-head' +// The inset right divider stands in for the left scroll cue, which the opaque column covers. +const PINNED_HEAD = 'sticky left-0 z-[1] bg-table-head shadow-[inset_-1px_0_0_var(--border)]' // Clicks on these inside a row act on the control, not the row. const ROW_CONTROLS = 'a, button, input, select, textarea, label, [role="checkbox"]' const PINNED_CELL = - 'sticky left-0 z-[1] bg-card group-hover:bg-muted group-focus-visible:bg-muted group-aria-selected:bg-accent' + 'sticky left-0 z-[1] bg-card shadow-[inset_-1px_0_0_var(--border)] group-hover:bg-muted group-focus-visible:bg-muted group-aria-selected:bg-accent' /** * Data table for server-paginated, server-sorted result sets — which is what