Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/webapp/src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"accessibility.conversationDetailsActionGroupAdminLabel": "Set group admin",
"accessibility.conversationDetailsActionNotificationsLabel": "Show notifications settings",
"accessibility.conversationDetailsCloseLabel": "Close image details view",
"accessibility.conversationMuted": "Muted",
"accessibility.conversationOptionsMenu": "Open conversation options",
"accessibility.conversationOptionsMenuAccessKey": "Use right arrow key to focus on the conversation options menu",
"accessibility.conversationStatusMuted": "Muted conversation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ export const ConversationListCell = ({
const [focusContextMenu, setContextMenuFocus] = useState(false);
const [isContextMenuOpen, setContextMenuOpen] = useState(false);
const contextMenuKeyboardShortcut = `keyboard-shortcut-${conversation.id}`;
const unreadMessagesCount = unreadState.allMessages.length;
const isMutedConversation = !conversation.showNotificationsEverything();
const accessibilityParts = [displayName];

if (unreadMessagesCount > 0) {
accessibilityParts.push(`${unreadMessagesCount} ${t('conversationLabelUnread')}`);
}

if (isMutedConversation) {
accessibilityParts.push(t('accessibility.conversationMuted'));
}

const accessibilityConversationLabel = `${accessibilityParts.join(', ')}. ${t('accessibility.openConversation', {
name: displayName,
})}`;

// Ref for immediate synchronous protection from multiple clicks
const isJoiningCallRef = useRef(false);
Expand Down Expand Up @@ -133,7 +148,7 @@ export const ConversationListCell = ({
await onJoinCall(conversation, MediaType.AUDIO);
isJoiningCallRef.current = false;
});
} catch (error: unknown) {
} catch {
// Re-enable on error
isJoiningCallRef.current = false;
}
Expand Down Expand Up @@ -196,7 +211,7 @@ export const ConversationListCell = ({
onKeyDown={handleDivKeyDown}
data-uie-name="go-open-conversation"
tabIndex={isFocused ? TabIndex.FOCUSABLE : TabIndex.UNFOCUSABLE}
aria-label={t('accessibility.openConversation', {name: displayName})}
aria-label={accessibilityConversationLabel}
aria-describedby={contextMenuKeyboardShortcut}
>
<span id={contextMenuKeyboardShortcut} aria-label={t('accessibility.conversationOptionsMenuAccessKey')} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const StatusIcon = ({conversation}: Props) => {
className="conversation-list-cell-badge cell-badge-light conversation-muted"
data-uie-name="status-silence"
title={t('accessibility.conversationStatusMuted')}
aria-hidden="true"
>
<Icon.MuteIcon className="svg-icon" />
</span>
Expand Down
1 change: 1 addition & 0 deletions apps/webapp/src/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ declare module 'I18n/en-US.json' {
'accessibility.conversationDetailsActionGroupAdminLabel': `Set group admin`;
'accessibility.conversationDetailsActionNotificationsLabel': `Show notifications settings`;
'accessibility.conversationDetailsCloseLabel': `Close image details view`;
'accessibility.conversationMuted': `Muted`;
'accessibility.conversationOptionsMenu': `Open conversation options`;
'accessibility.conversationOptionsMenuAccessKey': `Use right arrow key to focus on the conversation options menu`;
'accessibility.conversationStatusMuted': `Muted conversation`;
Expand Down
Loading