Fix TopBar User Setting Button: fix design to avoid strange oval overlay#1114
Fix TopBar User Setting Button: fix design to avoid strange oval overlay#1114sBouzols wants to merge 4 commits into
Conversation
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
📝 WalkthroughWalkthroughRefactors the TopBar settings button: switches to MUI Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/topBar/TopBar.tsx`:
- Around line 367-376: The Avatar startIcon in TopBar.tsx currently renders
empty initials when user.profile.name is undefined and the settings trigger has
no explicit accessible name; update the rendering in the startIcon (where Avatar
and Typography are used and abbreviationFromUserName is called) to compute a
non-empty fallback (e.g., use first letter of user.email or a default like "U")
and set an explicit aria-label (or aria-labelledby) on the settings button
element that opens the menu (the element that uses startIcon and endIcon) to a
descriptive string such as "User settings: {displayNameFallback}" so the control
always has a meaningful accessible name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4cfa81b3-e60d-43ec-bb16-8875f48e5014
📒 Files selected for processing (1)
src/components/topBar/TopBar.tsx
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
…ents inside the TopBar (for normal and dense version) Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/topBar/TopBar.tsx`:
- Line 370: The hardcoded aria-label on the user settings button should be
localized: in the TopBar component replace aria-label="User settings" with a
react-intl message (e.g. use intl.formatMessage({ id: 'topbar.userSettings',
defaultMessage: 'User settings' }) or a <FormattedMessage> wrapper) so screen
readers get the selected language; add the corresponding message id/key to your
locale messages (and provide sensible defaultMessage) and ensure the component
imports/uses injectIntl or useIntl where needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 58d410cf-850e-47e6-8dc2-3c9ab78871ed
📒 Files selected for processing (1)
src/components/topBar/TopBar.tsx
| aria-controls="settings-menu" | ||
| aria-haspopup="true" | ||
| sx={styles.showHideMenu} | ||
| aria-label="User settings" |
There was a problem hiding this comment.
Localize the button’s accessible name.
aria-label="User settings" is hardcoded English, so screen-reader text won’t follow the selected language. Prefer react-intl formatting here too.
💡 Suggested change
-import { FormattedMessage } from 'react-intl';
+import { FormattedMessage, useIntl } from 'react-intl';
...
export function TopBar({
...
}: PropsWithChildren<TopBarProps>) {
+ const intl = useIntl();
const styles = useMemo(() => getStyles(dense), [dense]);
...
- aria-label="User settings"
+ aria-label={intl.formatMessage({
+ id: 'top-bar/userSettings',
+ defaultMessage: 'Settings',
+ })}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| aria-label="User settings" | |
| import { FormattedMessage, useIntl } from 'react-intl'; | |
| ... | |
| export function TopBar({ | |
| ... | |
| }: PropsWithChildren<TopBarProps>) { | |
| const intl = useIntl(); | |
| const styles = useMemo(() => getStyles(dense), [dense]); | |
| ... | |
| <Button | |
| aria-controls="settings-menu" | |
| aria-haspopup="true" | |
| aria-label={intl.formatMessage({ | |
| id: 'top-bar/userSettings', | |
| defaultMessage: 'Settings', | |
| })} | |
| sx={styles.userButton} | |
| ... | |
| /> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/topBar/TopBar.tsx` at line 370, The hardcoded aria-label on
the user settings button should be localized: in the TopBar component replace
aria-label="User settings" with a react-intl message (e.g. use
intl.formatMessage({ id: 'topbar.userSettings', defaultMessage: 'User settings'
}) or a <FormattedMessage> wrapper) so screen readers get the selected language;
add the corresponding message id/key to your locale messages (and provide
sensible defaultMessage) and ensure the component imports/uses injectIntl or
useIntl where needed.



PR Summary
Before


dense:
!dense


After




dense :
!dense:



