-
Notifications
You must be signed in to change notification settings - Fork 794
fix: Adding support to read the title for server buttons. #3134
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: develop
Are you sure you want to change the base?
fix: Adding support to read the title for server buttons. #3134
Conversation
WalkthroughAn accessibility label is added to the server button component by setting the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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)
src/ui/components/SideBar/ServerButton.tsx (1)
107-120: Consider condensing tooltipContent for better screen reader experience.The template literal construction may produce extra internal whitespace when conditions are false, which screen readers might announce as awkward pauses. Consider using an array approach to avoid this.
Apply this diff to create a more concise format:
- const tooltipContent = ` - ${title} (${process.platform === 'darwin' ? '⌘' : '^'}+${shortcutNumber}) - ${ - hasUnreadMessages - ? ` - ${ - mentionCount && mentionCount > 1 - ? t('sidebar.tooltips.unreadMessages', { count: mentionCount }) - : t('sidebar.tooltips.unreadMessage', { count: mentionCount }) - }` - : '' - } - ${!userLoggedIn ? t('sidebar.tooltips.userNotLoggedIn') : ''} -`.trim(); + const tooltipContent = [ + `${title} (${process.platform === 'darwin' ? '⌘' : '^'}+${shortcutNumber})`, + hasUnreadMessages && + (mentionCount && mentionCount > 1 + ? t('sidebar.tooltips.unreadMessages', { count: mentionCount }) + : t('sidebar.tooltips.unreadMessage', { count: mentionCount })), + !userLoggedIn && t('sidebar.tooltips.userNotLoggedIn'), + ] + .filter(Boolean) + .join('. ');This produces a cleaner aria-label like: "ServerName (⌘1). 3 unread messages. Not logged in" instead of one with extra whitespace.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/ui/components/SideBar/ServerButton.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Follow existing TypeScript patterns with strict mode enabled
All new code must pass ESLint and TypeScript checks
Avoid unnecessary comments; only add comments for complex logic or non-obvious decisions
Files:
src/ui/components/SideBar/ServerButton.tsx
src/ui/**/*.tsx
📄 CodeRabbit inference engine (CLAUDE.md)
src/ui/**/*.tsx: Implement React UI with functional components and hooks
Use Fuselage components (Box, Button, TextInput, Modal, etc.) and import from@rocket.chat/fuselageinstead of raw HTML elements
For Fuselage theming, validate tokens againstTheme.d.tsand only use documented values
Name React component files in PascalCase; non-component files should follow camelCase naming
Files:
src/ui/components/SideBar/ServerButton.tsx
🔇 Additional comments (1)
src/ui/components/SideBar/ServerButton.tsx (1)
145-145: LGTM! Good accessibility improvement.Adding
aria-labelto the IconButton provides essential screen reader support for the server list, allowing users to identify servers and their keyboard shortcuts.
|
@antm-rp issue : bug fixed as it sees |
fix: Add support for screen readers to read the servers from left side server list. The fix uses the toolTipContent string, giving the user information about the serverr name as well as the shortcut combination.
Summary by CodeRabbit