From 282d2263f29b8b14b9b8b990fae4d8e979e2851a Mon Sep 17 00:00:00 2001 From: ngqile Date: Tue, 1 Dec 2026 23:22:31 +0800 Subject: [PATCH] fix: divider on the pinned table column where the left scroll cue is hidden Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- .../app/components/ui/data-table.pinned.test.tsx | 15 +++++++++++++++ .../app/components/ui/data-table.tsx | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 solvway-admin-portal/app/components/ui/data-table.pinned.test.tsx 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