Skip to content

refactor(forms): one submit label, and a button dark enough to read - #505

Draft
alukach wants to merge 3 commits into
mainfrom
form-button-normalize
Draft

refactor(forms): one submit label, and a button dark enough to read#505
alukach wants to merge 3 commits into
mainfrom
form-button-normalize

Conversation

@alukach

@alukach alukach commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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. FormActions now 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.

Form Before After
Data connection (edit) Update Connection Save
Data connection (create) Create Connection Create
Product (edit) Update Product Save
Product (create) Create Product Create
Profile Save Changes Save
Account flags Update Save
Organization Create Organization Create
Invite member Send Invitation Send invitation
Onboarding Complete Profile Complete profile
Admin lookup Look up user unchanged

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.

highContrast fills with --accent-12 instead — #202020, about 15.9:1. Verified against Radix's own CSS rather than assumed:

.rt-BaseButton:where(.rt-variant-solid):where(.rt-high-contrast) {
  background-color: var(--accent-12);
  color: var(--gray-1);
}

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-8 defaults to --accent-8. Under accentColor="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 #cecece border it was supposed to stand out from, which is close to no focus indicator at all for keyboard users.

--focus-8: var(--accent-12);

#202020 here, 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-N token 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

tsc clean · jest 60 suites / 526 tests · next lint 0 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

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
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
source-coop-ui Ready Ready Preview Aug 28, 2026 12:53am
source-cooperative Ready Ready Preview Aug 28, 2026 12:53am

Request Review

@claude

claude Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Claude finished @alukach's task in 46s —— View job


✅ No blocking issues — safe to merge.

Reviewed the diff (origin/main...HEAD, 12 files). Traced the default-label change through FormActionsDynamicForm → all callers, and confirmed the three forms that keep custom verbs (AdminUserLookupForm, InviteMemberForm, OnboardingForm) still pass submitLabel/submitButtonText explicitly, so none of them silently fell back to "Save". No test hardcodes the old "Submit" default, consistent with the PR's stated test run.

  • Color fix is the documented Radix mechanism (highContrast fills with --accent-12; overriding --focus-8 is a supported token, not an internals override) and is applied consistently to FormActions' own submit button plus the three standalone primary buttons (New Connection ×2, Invite Member trigger) called out in the description.
  • The --focus-8: var(--accent-12) override lives under :root .radix-themes, so it's global and token-based (correctly follows light/dark via the token rather than hardcoding a literal).
  • No correctness or security issues found in the label/color changes themselves.

Simplify (ponytail)

Nothing to flag — this PR is itself a simplification (three forms lost a redundant submitLabel/submitButtonText prop, no new abstractions introduced).


💰 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant