diff --git a/app/(dashboard)/pool-decommission/page.tsx b/app/(dashboard)/pool-decommission/page.tsx index 93ac0a53..a12efab6 100644 --- a/app/(dashboard)/pool-decommission/page.tsx +++ b/app/(dashboard)/pool-decommission/page.tsx @@ -720,6 +720,7 @@ export default function PoolDecommissionPage() { aria-pressed={isSelected} className={cn( "space-y-3 border p-3", + selectionLocked && "cursor-default", isSelected && "border-primary/40 bg-primary/5", row.displayState === "failed" && "border-destructive/40 bg-destructive/5", )} diff --git a/app/globals.css b/app/globals.css index 546954e7..4878007c 100644 --- a/app/globals.css +++ b/app/globals.css @@ -52,6 +52,10 @@ [role="button"] { touch-action: manipulation !important; } + /* Tailwind v4 preflight gives buttons the default cursor; links already show a pointer. */ + :is(button, [role="button"]):not(:disabled, [aria-disabled="true"]) { + cursor: pointer; + } [data-slot="tabs-list"] { min-height: 2.25rem; } diff --git a/tests/lib/button-cursor-source.test.js b/tests/lib/button-cursor-source.test.js new file mode 100644 index 00000000..22a3b8dc --- /dev/null +++ b/tests/lib/button-cursor-source.test.js @@ -0,0 +1,12 @@ +import test from "node:test" +import assert from "node:assert/strict" +import fs from "node:fs" + +const css = fs.readFileSync("app/globals.css", "utf8").replace(/\r\n/g, "\n") + +test("enabled buttons show a pointer cursor like links do", () => { + assert.match( + css, + /@layer base \{[\s\S]*:is\(button, \[role="button"\]\):not\(:disabled, \[aria-disabled="true"\]\) \{\s*cursor: pointer;/, + ) +}) diff --git a/tests/lib/pool-decommission-page.test.js b/tests/lib/pool-decommission-page.test.js index 5342134f..d335ff18 100644 --- a/tests/lib/pool-decommission-page.test.js +++ b/tests/lib/pool-decommission-page.test.js @@ -48,3 +48,12 @@ test("pool decommission page gates start, cancel, and clear by decommission stat assert.match(source, /dialog\.warning\(/) assert.match(source, /dialog\.error\(/) }) + +test("locked mobile pool cards keep a default cursor without disabling task actions", () => { + const source = fs.readFileSync("app/(dashboard)/pool-decommission/page.tsx", "utf8") + const card = source.match(//)?.[1] ?? "" + + assert.match(card, /selectionLocked && "cursor-default"/) + assert.doesNotMatch(card, /aria-disabled=/) + assert.match(card, /tabIndex=\{selectionLocked \? undefined : 0\}/) +})