Skip to content

Fix TopBar User Setting Button: fix design to avoid strange oval overlay#1114

Open
sBouzols wants to merge 4 commits into
mainfrom
fix_design_topBar_userButton
Open

Fix TopBar User Setting Button: fix design to avoid strange oval overlay#1114
sBouzols wants to merge 4 commits into
mainfrom
fix_design_topBar_userButton

Conversation

@sBouzols
Copy link
Copy Markdown
Contributor

PR Summary

Before
dense:
image
image

!dense
image
image

After
dense :
image
image
image
image

!dense:
image
image
image
image

Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

Refactors the TopBar settings button: switches to MUI startIcon/endIcon pattern, replaces the styled Box with an Avatar+Typography for the user abbreviation, adjusts styling (styles.userButton, styles.avatar, styles.name), conditionally renders chevron in endIcon, and adds aria-label="User settings". (50 words)

Changes

Cohort / File(s) Summary
TopBar Button Styling
src/components/topBar/TopBar.tsx
Refactored settings/menu trigger: use MUI startIcon/endIcon; moved user abbreviation into startIcon as Avatar wrapping Typography; introduced styles.userButton and styles.avatar to size avatar by dense; simplified styles.name (theme primary text color, inherited font size); chevron moved to conditional endIcon (shown only when !dense, up/down based on menu anchor); added aria-label="User settings".
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: fixing the TopBar user settings button design to address the visual 'oval overlay' issue shown in before/after comparisons.
Description check ✅ Passed The description is clearly related to the changeset, providing detailed before/after UI comparisons across themes and dense/non-dense variants that demonstrate the button styling fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7c62433 and 34bb214.

📒 Files selected for processing (1)
  • src/components/topBar/TopBar.tsx

Comment thread 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>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 34bb214 and 5b7bd20.

📒 Files selected for processing (1)
  • src/components/topBar/TopBar.tsx

aria-controls="settings-menu"
aria-haspopup="true"
sx={styles.showHideMenu}
aria-label="User settings"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

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.

1 participant