refactor(forms): one submit label, and a button dark enough to read - #505
refactor(forms): one submit label, and a button dark enough to read#505alukach wants to merge 3 commits into
Conversation
LABELS Every form had invented its own verb for the same act — "Update Connection", "Update Product", "Save Changes", "Update". They all save; the noun after the verb only repeats the page you are already on. FormActions now defaults to "Save", and the forms that were saying it their own way say nothing. Not everything became "Save". Creating something that does not exist yet is not saving it, so those say "Create"; and a lookup, an invitation and onboarding are different acts entirely, so they keep their verbs — normalising those would have made the button lie. Those three are sentence-cased to match. COLOUR The submit was mid-grey, because the theme sets accentColor="gray" and a solid Radix button fills with --accent-9 — #8d8d8d, which is 3.31:1 against its own white label and fails WCAG AA for text. `highContrast` fills with --accent-12 instead: near-black, about 15.9:1, and Radix's own answer rather than an override of its internals. The three primary buttons sitting beside these forms — both New Connection links and the Invite Member trigger — get it too, so the page does not end up with a black submit next to a grey call to action. The marketing page keeps its own look. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mnsg8m1dXZ5z5ig5xMtkE
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @alukach's task in 46s —— View job ✅ No blocking issues — safe to merge. Reviewed the diff (
Simplify (ponytail)Nothing to flag — this PR is itself a simplification (three forms lost a redundant 💰 Estimated review cost: $0.26 · 0m45s · 17 turns |
Every Radix focus outline is `2px solid var(--focus-8)`, and --focus-8 defaults to --accent-8. With accentColor="gray" that is #bbbbbb — about 1.9:1 against a white page, where WCAG 2.1 asks 3:1 of a focus indicator. On an input it sat a shade away from the #cecece border it was meant to stand out from. Same root cause as the grey submit button in this PR: a gray accent, used where the scale assumes a colour. --accent-12 instead: #202020 here, roughly 15:1, and near-white in dark mode because it is a token rather than a literal. Overriding a --focus-N token is Radix's documented way to recolour focus, so this stays out of its internals. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mnsg8m1dXZ5z5ig5xMtkE
Cross-cutting and independent of the data-connection PRs — every form in the app, off main.
Labels
Each form had invented its own verb for the same act: "Update Connection", "Update Product", "Save Changes", "Update". They all save, and the noun after the verb only repeats the page you're already on.
FormActionsnow defaults to "Save", and the forms that were saying it their own way say nothing.Not everything became "Save." Creating something that doesn't exist yet isn't saving it, so those say "Create". And three forms do something else entirely — a user lookup, an invitation, onboarding — so they keep their verbs; renaming those to "Save" would have made the button lie. Those three are sentence-cased to match the rest.
Colour
The submit button was mid-grey. That's not a style choice — the theme sets
accentColor="gray", so a solid Radix button fills with--accent-9(#8d8d8d), which is 3.31:1 against its own white label and fails WCAG AA for text. I flagged this a while back as a pre-existing, app-wide problem needing its own change; this is that change, for the primary buttons at least.highContrastfills with--accent-12instead —#202020, about 15.9:1. Verified against Radix's own CSS rather than assumed:That's Radix's own answer, not an override of its internals.
Three primary buttons sitting beside these forms get it too — both New Connection links and the Invite Member trigger — so a page doesn't end up with a black submit next to a grey call to action. The marketing page keeps its own look.
The focus ring, same root cause
Added to this PR rather than split out, because it is the same bug wearing a different hat: a gray accent used where the scale assumes a colour.
Every Radix focus outline is
2px solid var(--focus-8), and--focus-8defaults to--accent-8. UnderaccentColor="gray"that resolves to#bbbbbb— roughly 1.9:1 against a white page, where WCAG 2.1 asks 3:1 of a focus indicator. On a text input it landed a shade away from the#cececeborder it was supposed to stand out from, which is close to no focus indicator at all for keyboard users.#202020here, about 15:1 — and because it's a token rather than a literal it inverts to near-white in dark mode instead of needing a second rule. Overriding a--focus-Ntoken is Radix's documented way to recolour focus; nothing here reaches into its internals.Not covered
Destructive buttons stay red, and secondary/ghost buttons are untouched.
Verification
tscclean · jest 60 suites / 526 tests ·next lint0 errors.Both changes are visual and neither is test-covered — the focus ring especially wants a keyboard pass on the preview (tab through a form, check the outline against an input's own border) rather than trust in a green check.
🤖 Generated with Claude Code
https://claude.ai/code/session_011mnsg8m1dXZ5z5ig5xMtkE