Skip to content

feat: add accessibility string for profile icon [WPB-21213] - #21831

Open
e-maad wants to merge 4 commits into
mainfrom
feat/add-accessibiloty-string-for-profile-WPB-21213
Open

feat: add accessibility string for profile icon [WPB-21213]#21831
e-maad wants to merge 4 commits into
mainfrom
feat/add-accessibiloty-string-for-profile-WPB-21213

Conversation

@e-maad

@e-maad e-maad commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
TaskWPB-21213 [Web] Conversation list - No text alternative for status indicator icon and missing output of available actions

Description

Add accessibility string for profile link

@sonarqubecloud

Copy link
Copy Markdown

@screendriver screendriver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add tests for the newly constructed accessible name. At minimum, cover the availability status, combined MLS and Proteus verification, and the EXPIRES_SOON translation. The current expired/expiring-soon mistake would have been caught by such a test.

Comment thread apps/webapp/src/script/page/leftSidebar/userDetails/userDetails.tsx Outdated
Comment thread apps/webapp/src/script/page/leftSidebar/userDetails/userDetails.tsx Outdated
Comment thread apps/webapp/src/script/page/leftSidebar/userDetails/userDetails.tsx
@screendriver
screendriver changed the base branch from dev to main July 14, 2026 11:40
@e-maad
e-maad requested a review from screendriver July 15, 2026 21:19
hasPendingLegalHold,
} = useKoSubscribableChildren(user, ['hasPendingLegalHold', 'isOnLegalHold', 'name', 'username']);
} = useKoSubscribableChildren(user, ['availability', 'hasPendingLegalHold', 'isOnLegalHold', 'name', 'username']);
const verificationStatus = useUserVerificationStatus({user, groupId, isSelfUser: isTeam});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This still causes useUserVerificationStatus to run twice. UserDetailsComponent calls it here, but the UserVerificationBadges rendered below calls the same hook again internally. The team-user path therefore still performs the identity lookup and registers the device-status listener twice.

Please calculate the verification status once and pass the resulting mlsStatus and isProteusVerified values to the rendered badges.

});
});

describe('getUserVerificationBadgeLabel', () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These tests cover getUserVerificationBadgeLabel in isolation, but they do not test the newly constructed accessible name assigned to the button in UserDetails.

Please add component tests that render UserDetails and verify the button鈥檚 accessible name. At minimum, cover the availability status, combined MLS and Proteus verification, and the EXPIRES_SOON translation. Otherwise, the integration between the status values and the actual accessible name remains untested.

<AvailabilityStateButtonWrapper
isTeam={isTeam}
ariaLabel={avatarAriaLabel}
showAvailabilityContextMenu={showAvailabilityContextMenu}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The other button that invokes showAvailabilityContextMenu still does not expose aria-haspopup="menu". Please add aria-haspopup="menu" to both buttons that open the availability menu.

): string | undefined => {
const labels: string[] = [];

match(mlsStatus)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getUserVerificationBadgeLabel has only one production caller, which passes the result of useUserVerificationStatus. That hook can only return MLSStatuses.VALID or undefined as mlsStatus.

The EXPIRED, EXPIRES_SOON, REVOKED, and NOT_ACTIVATED branches are therefore unreachable in production; they are exercised only by tests that manually pass values the real caller cannot provide.

Please limit this function and its tests to the states its actual caller can provide.

const mlsStatus =
mlsStatuses && mlsStatuses.length > 0 && mlsStatuses.every(status => status === MLSStatuses.VALID)
? MLSStatuses.VALID
: undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we avoid undefined?

export const getUserVerificationBadgeLabel = (
translate: RootContextValue['translate'],
{mlsStatus, isProteusVerified}: {mlsStatus?: MLSStatuses; isProteusVerified?: boolean},
): string | undefined => {

@screendriver screendriver Jul 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we avoid undefined and use Maybe instead?

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.

2 participants