Skip to content

📩 fix: Restore Primary Action Button Visibility in Light Mode#12591

Merged
danny-avila merged 1 commit into
danny-avila:devfrom
UnicronBE:fix/light-mode-primary-button-visibility
Apr 9, 2026
Merged

📩 fix: Restore Primary Action Button Visibility in Light Mode#12591
danny-avila merged 1 commit into
danny-avila:devfrom
UnicronBE:fix/light-mode-primary-button-visibility

Conversation

@UnicronBE

Copy link
Copy Markdown
Contributor

Summary

Fixes #12590.

The default <Button> variant (bg-primary + text-primary-foreground) renders invisible in light mode on three primary action buttons:

  • Agent Marketplace detail modal — Start Chat (AgentDetail.tsx, AgentDetailContent.tsx)
  • Grant Access dialog — Save Changes (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 in packages/client/src/components/Button.tsx and uses the hardcoded bg-surface-submit text-white combination. The comment above the submit variant literally says:

// hardcoded text color because of WCAG contrast issues (text-white)
submit: 'bg-surface-submit text-white hover:bg-surface-submit-hover',

— 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change
  • This change requires a documentation update
  • Translation update

Testing

Manual verification:

  1. Check out this branch, npm run reinstall && npm run build && npm run backend
  2. Open the app in light mode
  3. Agent Marketplace → open any agent detail modal → the "Start Chat" button is now rendered as the green submit style with white text (previously invisible)
  4. Agent share dialog → open Grant Access for any agent, make any permission change → the "Save Changes" button is now rendered with the same green submit style
  5. Switch to dark mode and verify no visual regression (dark mode already rendered the default variant correctly; submit is also valid in dark mode — green on dark is fine)

Test Configuration

  • Node 22, latest main
  • Chrome + Edge

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code (n/a — three-line variant change)
  • I have made pertinent documentation changes (n/a)
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works (n/a — visual-only change; verified manually per the steps above)
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules (n/a)
  • A pull request for updating the documentation has been submitted (n/a)

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.
@danny-avila

Copy link
Copy Markdown
Owner

Thanks for the clean fix and thorough PR description — this is well done.

The change itself is correct: variant="submit" is exactly the right workaround for the broken bg-primary/text-primary-foreground contrast in light mode, and the scoping to just these three buttons is appropriate.

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: fix: use submit variant for primary action buttons in light mode — that's good as-is.

2. (Optional but appreciated) Add a regression guard in the existing test

client/src/components/Agents/tests/AgentDetail.spec.tsx already tests the Start Chat button. Adding a class assertion would prevent silent regressions:

// 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):

  • The root cause (bg-primary/text-primary-foreground token chain being broken in light mode) — that's a broader theme issue we'll track separately.
  • The AgentDetail.tsx / AgentDetailContent.tsx duplication — pre-existing, out of scope for this fix.
  • The formatContact() double-call — pre-existing, unrelated.

Looks good overall. Will merge once CI is green.

@danny-avila danny-avila changed the base branch from main to dev April 9, 2026 22:39
@danny-avila

Copy link
Copy Markdown
Owner

@UnicronBE disregard comment, trying out a new automated review

@danny-avila danny-avila changed the title fix: use submit variant for primary action buttons in light mode 📩 fix: Restore Primary Action Button Visibility in Light Mode Apr 9, 2026
@danny-avila danny-avila merged commit 46b529a into danny-avila:dev Apr 9, 2026
8 checks passed
yidianyiko pushed a commit to yidianyiko/LibreChat that referenced this pull request Apr 13, 2026
…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>
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
…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>
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.

[Bug]: Primary action buttons (Start Chat, Save Changes) invisible in light mode

2 participants