From 8f5a45ef517f3b3a8543b10b3a5dcfe98536ed0a Mon Sep 17 00:00:00 2001 From: Keith Avery Date: Sun, 26 Apr 2026 07:46:03 -0400 Subject: [PATCH] ux(chargen): add pencil icon and hover state to row Edit affordances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chargen confirmation sheet's per-row "Edit" links rendered as bare text in `text-muted-foreground` against a dark card background — pale, small, and easy to miss. ux-observer flagged this in playtest 2026-04-26 (see sq-playtest-pingpong "[UX] Edit affordances on the chargen sheet are too pale to discover"); especially impactful on the stats and equipment rows where the row's own content is dense. Two-pronged upgrade, each one independently improving discoverability: - `lucide-react` `Pencil` icon next to the visible "Edit" text. Makes the affordance obvious without requiring hover (better for first- timers and touch users; serves Sebastien who scans for mechanical controls per CLAUDE.md playgroup rubric). - Row-level named-group hover (`group/edit-row`) brightens the row background and the Edit button's border on hover. Elegant cue for mouse users; doesn't demand attention until the user moves toward it. Accessibility preserved: icon is `aria-hidden`, the button still carries `aria-label="Edit "`, and the visible "Edit" text is retained alongside the icon (not icon-only). Dark aesthetic kept — all colors are existing theme tokens (muted-foreground, border, card). No behavior change — the click handler still emits `{action: "edit", target_step: index}` exactly as before. Tests: - `CharacterCreation.edit-affordance.test.tsx` — 5 unit assertions (icon renders per row, accessible name preserved, "Edit" text kept, icon aria-hidden, row-hover Tailwind class wiring) + 1 wiring test asserting App.tsx still imports + mounts CharacterCreation in the `creation` session phase. Refs: sq-playtest-pingpong 2026-04-26 — UX section. --- .../CharacterCreation/CharacterCreation.tsx | 9 +- ...CharacterCreation.edit-affordance.test.tsx | 128 ++++++++++++++++++ 2 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 src/components/CharacterCreation/__tests__/CharacterCreation.edit-affordance.test.tsx diff --git a/src/components/CharacterCreation/CharacterCreation.tsx b/src/components/CharacterCreation/CharacterCreation.tsx index 65c1245..5031f94 100644 --- a/src/components/CharacterCreation/CharacterCreation.tsx +++ b/src/components/CharacterCreation/CharacterCreation.tsx @@ -1,4 +1,5 @@ import { useState } from "react"; +import { Pencil } from "lucide-react"; import { toRoman } from "@/lib/utils"; interface CreationChoice { @@ -132,7 +133,7 @@ export function CharacterCreation({ scene, loading, onRespond }: CharacterCreati
{key} @@ -140,10 +141,12 @@ export function CharacterCreation({ scene, loading, onRespond }: CharacterCreati
)) diff --git a/src/components/CharacterCreation/__tests__/CharacterCreation.edit-affordance.test.tsx b/src/components/CharacterCreation/__tests__/CharacterCreation.edit-affordance.test.tsx new file mode 100644 index 0000000..68b166d --- /dev/null +++ b/src/components/CharacterCreation/__tests__/CharacterCreation.edit-affordance.test.tsx @@ -0,0 +1,128 @@ +import { readFileSync } from "node:fs"; +import { resolve } from "node:path"; +import { describe, expect, it } from "vitest"; +import { render, screen } from "@testing-library/react"; +import { CharacterCreation } from "../CharacterCreation"; + +/** + * Playtest 2026-04-26 sq-playtest-pingpong section + * `[UX] Edit affordances on the chargen sheet are too pale to discover`. + * + * The original "Edit" link was a bare text-only `