fix: divider on the pinned table column where the left scroll cue is hidden
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
372cd7244e
commit
282d2263f2
2 files changed
+18
-2
No files matched your search
@@ -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)]");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user