Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/(dashboard)/pool-decommission/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)}
Expand Down
4 changes: 4 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 12 additions & 0 deletions tests/lib/button-cursor-source.test.js
Original file line number Diff line number Diff line change
@@ -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;/,
)
})
9 changes: 9 additions & 0 deletions tests/lib/pool-decommission-page.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(/<div\s+key=\{row\.pool\.id\}\s+role="button"([\s\S]*?)>/)?.[1] ?? ""

assert.match(card, /selectionLocked && "cursor-default"/)
assert.doesNotMatch(card, /aria-disabled=/)
assert.match(card, /tabIndex=\{selectionLocked \? undefined : 0\}/)
})