Skip to content

fix(ui): pointer affordance for Checkbox and Toggle (#594 base family) - #646

Merged
LudoLoops merged 1 commit into
mainfrom
594-base-primitives-audit
Oct 24, 2026
Merged

LudoLoops merged 1 commit into
mainfrom
594-base-primitives-audit

Conversation

@LudoLoops

Copy link
Copy Markdown
Contributor

Family 1 — Base primitives, UI and layouts (#594)

First independently reviewable slice of the #594 audit (the issue asks for per-family PRs, not one mass rewrite). Scope: the 16 files under packages/svforge/templates/base/src/lib/components/svforge/{primitives,ui,layout}. Base route/reference screens and the addon families remain for later PRs.

Per-file disposition

File Disposition
primitives/Badge.svelte Already native — Skeleton badge + preset computed inline; unchanged
primitives/Checkbox.svelte Fixed — disabled-aware cursor on the clickable label; disabled explicitly forwarded
primitives/Input.svelte Already native — reused SSR-id/aria derivations; unchanged
primitives/Select.svelte Already native — same id/aria contract; unchanged
primitives/Textarea.svelte Already native — same id/aria contract; unchanged
primitives/Toggle.svelte Fixed — pointer/not-allowed on Skeleton Switch control + label
ui/Alert.svelte Already native (card + tonal preset); comment indentation fixed only
ui/Card.svelte Already native — variant map reused per variant; unchanged
ui/Logo.svelte Already native; unchanged
ui/Seo.svelte Derived URL/card state used multiple times; unchanged
ui/Table.svelte Specialized (row keys, dev contract warning, snippets); unchanged
ui/ThemeToggle.svelte Uses the shared Button pointer policy (#591); unchanged
layout/Navbar.svelte Shared Button + native anchors; unchanged
layout/Footer.svelte Native anchors only; unchanged
layout/AuthLayout.svelte ThemeToggle only; unchanged
layout/PageHeader.svelte No interactive control; unchanged

No custom CSS was added; no <style> blocks exist in this family. No derived state was inlined where it is reused (Input/Select/Textarea ids, Seo, Table).

Pointer contract (#594)

  • Button already owns the enabled/disabled cursor (fix(ui): show pointer cursor on navbar theme toggle #591).
  • Checkbox: the wrapping <label> (the click target) no longer advertises clickability when the input is disabled.
  • Toggle: Skeleton v5's Switch sets no pointer affordance; the control and its label now declare both states.

Verified on a real generated Base app (built, preview): computed cursor on desktop 1280 and mobile 390 →

checkbox enabled label   pointer      checkbox disabled label   not-allowed
toggle enabled control   pointer      toggle disabled control   not-allowed
toggle enabled label     pointer      toggle disabled label     not-allowed
theme toggle button       pointer      disabled checkbox input   disabled

Checks

  • bun run test (whole repo), bun run lint, bun run typecheck, bun run build:all, node scripts/check-generated.mjs — pass.
  • New jsdom regression tests/primitives-cursor-affordance.test.ts (enabled/disabled class contract for both controls; jsdom cannot compute the Tailwind stylesheet, the real-app run above covers the computed style).
  • bash scripts/test-scaffold.sh base — pass (build, svelte-check, design check, generated lint, tests).
  • Changeset added (svforge: patch); packages/svforge/src/templates.ts regenerated through prebuild; Graphify updated.

Remaining (#594 stays open)

  • Base route/reference screens (demo-ui, landing, layout) and Dashboard family.
  • Optional addons: OAuth buttons, NotificationsBell, TiptapToolbar, DnD, Graph, FileUpload, Blog, Audit, Chat, Toast.
  • #593 remains the dedicated shared-Button derivation cleanup; not touched here.

Refs #594 (family 1).

Audit of the Base primitives/ui/layout family (issue #594, family 1), with
only verified, behavior-preserving changes:

- Checkbox: the clickable label was always `cursor-pointer`, including when
  the input is disabled. The label now switches to `cursor-not-allowed` and
  the forwarded `disabled` state is explicit instead of riding in rest props.
- Toggle: Skeleton's Switch sets neither pointer nor discipline for the
  enabled state (only the global `:disabled` rule). The control and label now
  declare `cursor-pointer` when enabled and `cursor-not-allowed` when disabled.
- Alert: indentation of the existing preset comment (no behavior change).

The rest of the family was audited and left unchanged: Badge/Alert/Card
already compute their Skeleton preset inline, Input/Select/Textarea keep their
reused SSR-id/aria derivations, Table/Seo keep their multi-use derived state,
ThemeToggle and Navbar keep the shared Button (#591), and Footer/AuthLayout/
PageHeader have no non-native actionable control.

Tests: new jsdom regression for the enabled/disabled class contract of both
controls. Real generated Base app (desktop 1280 and mobile 390, computed
style): checkbox/toggle/theme-toggle enabled = pointer, disabled = not-allowed,
disabled input inert. Repo suite, lint, typecheck, build:all and
`test-scaffold.sh base` pass.

Refs #594 (family 1 of the audit; remaining families stay open).
@LudoLoops
LudoLoops merged commit 9083736 into main Oct 24, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 24, 2026
@LudoLoops
LudoLoops deleted the 594-base-primitives-audit branch October 26, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant