-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Fixed spinner visibility in Share Profile copy button #25135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fixed spinner visibility in Share Profile copy button #25135
Conversation
closes TryGhost#24706 The LoadingIndicator spinner was barely visible due to poor contrast across different background modes. Added getSpinnerColorForButton() helper function to ensure optimal contrast by mapping background modes to appropriate spinner colors, improving user experience when copying profile images.
WalkthroughA new helper Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/admin-x-activitypub/src/views/Preferences/components/Profile.tsx (1)
40-56
: LGTM! Clear mapping logic.The helper function correctly maps each backgroundColor theme to the appropriate spinner color, ensuring visibility against the button background. The inline comments clearly explain the visual result for each case, and the switch statement with a default case is a solid approach.
Consider adding unit tests for this helper to document the expected behavior:
describe('getSpinnerColorForButton', () => { it('returns light spinner for light theme (dark button)', () => { expect(getSpinnerColorForButton('light')).toBe('light'); }); it('returns dark spinner for dark theme (white button)', () => { expect(getSpinnerColorForButton('dark')).toBe('dark'); }); it('returns light spinner for accent theme (dark button)', () => { expect(getSpinnerColorForButton('accent')).toBe('light'); }); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/admin-x-activitypub/src/views/Preferences/components/Profile.tsx
(2 hunks)
🔇 Additional comments (1)
apps/admin-x-activitypub/src/views/Preferences/components/Profile.tsx (1)
380-385
: LGTM! Fixes spinner visibility correctly.The LoadingIndicator now receives a dynamic color based on the button's background theme, ensuring the spinner is visible in all modes (light/dark/accent). The implementation directly addresses the contrast issue described in #24706.
Description
Brief summary of changes:
Fixed spinner color contrast issue in the Share Profile copy button where the LoadingIndicator was barely visible across different background modes. Added a helper function to ensure optimal spinner color selection based on actual button styling.
Related issue(s):
Fixes #24706
Type of change:
Testing
How has this been tested?
Test environment:
Screenshots (if applicable)
Before:
After:
Technical Implementation
Added
getSpinnerColorForButton()
helper function: