📩 fix: Restore Primary Action Button Visibility in Light Mode#12591
Conversation
The default <Button> variant (bg-primary / text-primary-foreground) renders invisible in light mode on the Agent Marketplace 'Start Chat' button and the Grant Access dialog 'Save Changes' button, making these primary actions undiscoverable without hovering. Switch these three affirmative-action buttons to variant='submit', which uses the hardcoded 'bg-surface-submit text-white' combination already defined in the Button component specifically to avoid the contrast issues of the default variant (see the comment above the 'submit' variant in packages/client/src/components/Button.tsx). No visual change in dark mode; in light mode the buttons now render as the green submit color with white text, matching the semantic intent of the action.
|
Thanks for the clean fix and thorough PR description — this is well done. The change itself is correct: A couple of things to address before merge: 1. Squash into a single conventional commit When we merge we'll squash, but please make sure the final commit message follows the format already used in your commit: 2. (Optional but appreciated) Add a regression guard in the existing test
// In the existing "should render Start Chat button" test:
expect(startChatButton).toHaveClass('bg-surface-submit');This is a nice-to-have, not a blocker — the change is small enough that visual QA covers it. But if you're up for it, it's a one-liner. Not asking you to fix (for context):
Looks good overall. Will merge once CI is green. |
|
@UnicronBE disregard comment, trying out a new automated review |
…avila#12591) The default <Button> variant (bg-primary / text-primary-foreground) renders invisible in light mode on the Agent Marketplace 'Start Chat' button and the Grant Access dialog 'Save Changes' button, making these primary actions undiscoverable without hovering. Switch these three affirmative-action buttons to variant='submit', which uses the hardcoded 'bg-surface-submit text-white' combination already defined in the Button component specifically to avoid the contrast issues of the default variant (see the comment above the 'submit' variant in packages/client/src/components/Button.tsx). No visual change in dark mode; in light mode the buttons now render as the green submit color with white text, matching the semantic intent of the action. Co-authored-by: Timothy Look <timothy.look@pmv.eu>
…avila#12591) The default <Button> variant (bg-primary / text-primary-foreground) renders invisible in light mode on the Agent Marketplace 'Start Chat' button and the Grant Access dialog 'Save Changes' button, making these primary actions undiscoverable without hovering. Switch these three affirmative-action buttons to variant='submit', which uses the hardcoded 'bg-surface-submit text-white' combination already defined in the Button component specifically to avoid the contrast issues of the default variant (see the comment above the 'submit' variant in packages/client/src/components/Button.tsx). No visual change in dark mode; in light mode the buttons now render as the green submit color with white text, matching the semantic intent of the action. Co-authored-by: Timothy Look <timothy.look@pmv.eu>
Summary
Fixes #12590.
The default
<Button>variant (bg-primary+text-primary-foreground) renders invisible in light mode on three primary action buttons:AgentDetail.tsx,AgentDetailContent.tsx)GenericGrantAccessDialog.tsx)The buttons are still clickable, but users cannot see them (the pin/copy-link icon buttons next to Start Chat use
variant="outline"and are visible, which makes the missing primary action particularly confusing).This PR switches those three affirmative-action buttons to
variant="submit", which already exists inpackages/client/src/components/Button.tsxand uses the hardcodedbg-surface-submit text-whitecombination. The comment above thesubmitvariant literally says:— so the variant was explicitly introduced to sidestep contrast problems with the default variant. These three buttons are semantically "submit / confirm" actions and should have been using it already.
Scope: This is an intentionally minimal, surgical fix. It does not try to solve the underlying cascade/token issue behind the default variant's light-mode rendering (which is hard to reproduce reliably from source inspection alone). Other default-variant
<Button>instances in the app are not touched by this PR; they can be audited in a follow-up if needed.Change Type
Testing
Manual verification:
npm run reinstall && npm run build && npm run backendsubmitstyle with white text (previously invisible)submitstylesubmitis also valid in dark mode — green on dark is fine)Test Configuration
mainChecklist