Skip to content

Conversation

@antm-rp
Copy link

@antm-rp antm-rp commented Oct 23, 2025

fix: Add screen reader support to read encrypted channel icon

Proposed changes (including videos or screenshots)

Add support for screen readers to properly announce the encrypted icon indicating a channel is encrypted.

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced accessibility for encrypted channel indicators with improved keyboard navigation and screen reader support.
  • Style

    • Updated the visual appearance of the encrypted indicator with a refined color scheme.
  • New Features

    • Added localization support for encrypted channel notifications that now display the specific room name.

@antm-rp antm-rp requested a review from a team as a code owner October 23, 2025 08:52
@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2025

⚠️ No Changeset found

Latest commit: 294f5d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 23, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@antm-rp antm-rp changed the title Add screen reader support to read encrypted channel icon fix: Add screen reader support to read encrypted channel icon Oct 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

Walkthrough

Updated the Encrypted room header icon with improved accessibility attributes (ARIA labels, roles, tabindex) and changed icon color from g500 to g800. Added a new localization string for displaying encrypted room status with the room name.

Changes

Cohort / File(s) Summary
Encrypted UI Component Updates
apps/meteor/client/views/room/Header/icons/Encrypted.tsx
Refactored inline conditional rendering with expanded HeaderState element; added ARIA/accessibility attributes (aria-hidden, aria-live, role, tabindex, aria-label); updated icon color from g500 to g800
Localization Additions
packages/i18n/src/locales/en.i18n.json
Added new i18n entry for Encrypted_channel with message template "{{roomName}} is encrypted"

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris
  • cardoso

Poem

🐰 With ARIA wings and labels so clear,
The encrypted room's status is now quite dear,
A touch of g800, accessibility's art,
And i18n strings straight from the heart! ✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: Add screen reader support to read encrypted channel icon" accurately and specifically describes the main objective of the changeset. The modifications to the Encrypted.tsx component add ARIA accessibility attributes (aria-label, aria-hidden, aria-live, role, tabindex) combined with a new i18n localization string to enable screen readers to properly announce the encrypted channel icon. The title is concise, clear, and uses descriptive language that directly conveys the primary change without vague or generic terms.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link

@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: 2

🧹 Nitpick comments (1)
apps/meteor/client/views/room/Header/icons/Encrypted.tsx (1)

17-17: Remove redundant aria-hidden={false}.

Setting aria-hidden={false} is redundant since elements are visible to assistive technologies by default unless explicitly hidden. This line can be safely removed.

Apply this diff:

 		<HeaderState
 			title={t('Encrypted')}
 			icon='key'
 			color={colors.g800}
-			aria-hidden={false}
 			aria-live='polite'
 			role='img'
 			tabindex={0}
 			aria-label={t('Encrypted_channel', { roomName: room.name })}
 		/>
📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 45ee12e and 3df65e5.

📒 Files selected for processing (2)
  • apps/meteor/client/views/room/Header/icons/Encrypted.tsx (1 hunks)
  • packages/i18n/src/locales/en.i18n.json (1 hunks)
🔇 Additional comments (1)
packages/i18n/src/locales/en.i18n.json (1)

1931-1931: LGTM — new string fits the existing pattern.

The added localization key reuses the {{roomName}} placeholder consistently with neighboring entries. No further changes needed.

Comment on lines +12 to +23
return e2eEnabled && room?.encrypted ? (
<HeaderState
title={t('Encrypted')}
icon='key'
color={colors.g800}
aria-hidden={false}
aria-live='polite'
role='img'
tabindex={0}
aria-label={t('Encrypted_channel', { roomName: room.name })}
/>
) : null;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that HeaderState component supports ARIA props.

Ensure that the HeaderState component properly forwards the ARIA attributes (aria-hidden, aria-live, role, aria-label) to the underlying DOM element. If these props aren't supported, they won't have any effect on accessibility.

Run the following script to check the HeaderState component implementation:


🏁 Script executed:

#!/bin/bash
# Description: Locate and examine the HeaderState component to verify ARIA prop support

# Find the HeaderState component file
fd -t f "HeaderState" -e ts -e tsx -e js -e jsx | head -5

# Search for the component definition and prop spreading
rg -A 20 "export.*HeaderState" --type tsx --type ts

Length of output: 196


🏁 Script executed:

#!/bin/bash
# Find the import statement in Encrypted.tsx to identify which HeaderState is used
cat apps/meteor/client/views/room/Header/icons/Encrypted.tsx

Length of output: 750


🏁 Script executed:

#!/bin/bash
# Examine the HeaderState component that is imported in Encrypted.tsx
cat apps/meteor/client/components/Header/HeaderState.tsx

Length of output: 563


🏁 Script executed:

#!/bin/bash
# Examine the underlying HeaderStateComponent from ui-client
cat packages/ui-client/src/components/Header/HeaderState.tsx

echo "---"

# Also examine HeaderV2State
cat packages/ui-client/src/components/HeaderV2/HeaderState.tsx

Length of output: 1465


Fix the tabindex prop to use camelCase tabIndex.

The HeaderState component properly forwards ARIA attributes (aria-hidden, aria-live, role, aria-label) through prop spreading and its AllHTMLAttributes type definition. However, in the Encrypted component, the attribute is incorrectly specified as tabindex={0} instead of tabIndex={0}. React normalizes HTML attributes to camelCase, so the lowercase version will not be applied to the DOM element.

tabIndex={0}
🤖 Prompt for AI Agents
In apps/meteor/client/views/room/Header/icons/Encrypted.tsx around lines 12 to
23, the JSX uses the incorrect lowercase prop `tabindex={0}` which React will
not apply to the DOM; change it to the camelCase `tabIndex={0}` so the attribute
is forwarded and applied correctly (no other changes needed).

aria-hidden={false}
aria-live='polite'
role='img'
tabindex={0}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove tabindex={0} from non-interactive icon.

Adding tabindex={0} makes this static icon keyboard-focusable, creating an unnecessary tab stop. Screen readers can already access elements with role='img' and aria-label without requiring keyboard focus. This degrades the keyboard navigation experience by adding a focusable element that has no associated action.

Apply this diff to remove the tabindex:

 		<HeaderState
 			title={t('Encrypted')}
 			icon='key'
 			color={colors.g800}
 			aria-hidden={false}
 			aria-live='polite'
 			role='img'
-			tabindex={0}
 			aria-label={t('Encrypted_channel', { roomName: room.name })}
 		/>
📝 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
tabindex={0}
<HeaderState
title={t('Encrypted')}
icon='key'
color={colors.g800}
aria-hidden={false}
aria-live='polite'
role='img'
aria-label={t('Encrypted_channel', { roomName: room.name })}
/>
🤖 Prompt for AI Agents
In apps/meteor/client/views/room/Header/icons/Encrypted.tsx around line 20,
remove the unnecessary tabindex={0} on the static icon element so it is not
included in the keyboard tab order; keep role="img" and aria-label for screen
reader access and ensure no other interactive handlers require keyboard
focus—just delete the tabindex prop from the JSX.

Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

adding tabIndex to an icon is a bad pattern, we can find another way to warn the user that is a encrypted room

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.

3 participants