Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Use strong over b for improved a11y semantics #41

Merged
merged 8 commits into from
Sep 26, 2024
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
2 changes: 1 addition & 1 deletion res/css/views/auth/_AuthBody.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please see LICENSE files in the repository root for full details.
padding: 25px 60px;
box-sizing: border-box;

b {
strong {
font-weight: var(--cpd-font-weight-semibold);
}

Expand Down
2 changes: 1 addition & 1 deletion src/IdentityAuthClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class IdentityAuthClient {
"terms|identity_server_no_terms_description_1",
{},
{
server: () => <b>{abbreviateUrl(identityServerUrl)}</b>,
server: () => <strong>{abbreviateUrl(identityServerUrl)}</strong>,
},
)}
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/RoomInvite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function showAnyInviteErrors(
"invite|room_failed_partial",
{},
{
RoomName: () => <b>{room.name}</b>,
RoomName: () => <strong>{room.name}</strong>,
},
)}
</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const CheckEmail: React.FC<CheckEmailProps> = ({
<EMailPromptIcon className="mx_AuthBody_emailPromptIcon--shifted" />
<h1>{_t("auth|uia|email_auth_header")}</h1>
<div className="mx_AuthBody_text">
<p>{_t("auth|check_email_explainer", { email: email }, { b: (t) => <b>{t}</b> })}</p>
<p>{_t("auth|check_email_explainer", { email: email }, { b: (t) => <strong>{t}</strong> })}</p>
<div className="mx_AuthBody_did-not-receive">
<span className="mx_VerifyEMailDialog_text-light">{_t("auth|check_email_wrong_email_prompt")}</span>
<AccessibleButton className="mx_AuthBody_resend-button" kind="link" onClick={onReEnterEmailClick}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const EnterEmail: React.FC<EnterEmailProps> = ({
<EmailIcon className="mx_AuthBody_icon" />
<h1>{_t("auth|enter_email_heading")}</h1>
<p className="mx_AuthBody_text">
{_t("auth|enter_email_explainer", { homeserver }, { b: (t) => <b>{t}</b> })}
{_t("auth|enter_email_explainer", { homeserver }, { b: (t) => <strong>{t}</strong> })}
</p>
<form onSubmit={onSubmit}>
<fieldset disabled={loading}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const VerifyEmailModal: React.FC<Props> = ({
email,
},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
)}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export class EmailIdentityAuthEntry extends React.Component<
/>
<p>
{_t("auth|uia|email", {
emailAddress: <b>{this.props.inputs.emailAddress}</b>,
emailAddress: <strong>{this.props.inputs.emailAddress}</strong>,
})}
</p>
{this.state.requesting ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/auth/LoginWithQRFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default class LoginWithQRFlow extends React.Component<XOR<Props, MSC3906P
</li>
<li>
{_t("auth|qr_code_login|select_qr_code", {
scanQRCode: <b>{_t("auth|qr_code_login|scan_qr_code")}</b>,
scanQRCode: <strong>{_t("auth|qr_code_login|scan_qr_code")}</strong>,
})}
</li>
<li>{_t("auth|qr_code_login|point_the_camera")}</li>
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const AnalyticsLearnMoreDialog: React.FC<IProps> = ({
{_t("analytics|pseudonymous_usage_data", { analyticsOwner })}
</div>
<ul className="mx_AnalyticsLearnMore_bullets">
<li>{_t("analytics|bullet_1", {}, { Bold: (sub) => <b>{sub}</b> })}</li>
<li>{_t("analytics|bullet_2", {}, { Bold: (sub) => <b>{sub}</b> })}</li>
<li>{_t("analytics|bullet_1", {}, { Bold: (sub) => <strong>{sub}</strong> })}</li>
<li>{_t("analytics|bullet_2", {}, { Bold: (sub) => <strong>{sub}</strong> })}</li>
<li>{_t("analytics|disable_prompt")}</li>
</ul>
{privacyPolicyLink}
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/dialogs/BugReportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
) {
warning = (
<p>
<b>{_t("bug_reporting|unsupported_browser")}</b>
<strong>{_t("bug_reporting|unsupported_browser")}</strong>
</p>
);
}
Expand All @@ -221,7 +221,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
{warning}
<p>{_t("bug_reporting|description")}</p>
<p>
<b>
<strong>
{_t(
"bug_reporting|before_submitting",
{},
Expand All @@ -237,7 +237,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
),
},
)}
</b>
</strong>
</p>

<div className="mx_BugReportDialog_download">
Expand Down
8 changes: 6 additions & 2 deletions src/components/views/dialogs/CreateRoomDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
"create_room|join_rule_restricted_label",
{},
{
SpaceName: () => <b>{this.props.parentSpace?.name ?? _t("common|unnamed_space")}</b>,
SpaceName: () => (
<strong>{this.props.parentSpace?.name ?? _t("common|unnamed_space")}</strong>
),
},
)}
&nbsp;
Expand All @@ -294,7 +296,9 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
"create_room|join_rule_public_parent_space_label",
{},
{
SpaceName: () => <b>{this.props.parentSpace?.name ?? _t("common|unnamed_space")}</b>,
SpaceName: () => (
<strong>{this.props.parentSpace?.name ?? _t("common|unnamed_space")}</strong>
),
},
)}
&nbsp;
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/CreateSubspaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
"create_space|subspace_join_rule_restricted_description",
{},
{
SpaceName: () => <b>{parentSpace.name}</b>,
SpaceName: () => <strong>{parentSpace.name}</strong>,
},
)}
</p>
Expand All @@ -107,7 +107,7 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
"create_space|subspace_join_rule_public_description",
{},
{
SpaceName: () => <b>{parentSpace.name}</b>,
SpaceName: () => <strong>{parentSpace.name}</strong>,
},
)}
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/LeaveSpaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const LeaveSpaceDialog: React.FC<IProps> = ({ space, onFinished }) => {
"space|leave_dialog_description",
{},
{
spaceName: () => <b>{space.name}</b>,
spaceName: () => <strong>{space.name}</strong>,
},
)}
&nbsp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const ManageRestrictedJoinRuleDialog: React.FC<IProps> = ({ room, selected = [],
"room_settings|security|join_rule_restricted_dialog_description",
{},
{
RoomName: () => <b>{room.name}</b>,
RoomName: () => <strong>{room.name}</strong>,
},
)}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function ManualDeviceKeyVerificationDialog({
<label>{_t("encryption|verification|manual_device_verification_device_key_label")}:</label>{" "}
<span>
<code>
<b>{key}</b>
<strong>{key}</strong>
</code>
</span>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const RegistrationEmailPromptDialog: React.FC<IProps> = ({ onFinished }) => {
"auth|registration|continue_without_email_description",
{},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
)}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
"room_settings|advanced|upgrade_warning_dialog_explainer",
{},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
)}
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/dialogs/UploadFailureDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
sizeOfThisFile: fileSize(this.props.badFiles[0].size),
},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
);
buttons = (
Expand All @@ -64,7 +64,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
limit: fileSize(this.props.contentMessages.getUploadLimit()!),
},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
);
buttons = (
Expand All @@ -82,7 +82,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
limit: fileSize(this.props.contentMessages.getUploadLimit()!),
},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
},
);
const howManyOthers = this.props.totalFiles - this.props.badFiles.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const EditSetting: React.FC<IEditSettingProps> = ({ setting, onBack }) => {
</h3>

<div className="mx_DevTools_SettingsExplorer_warning">
<b>{_t("devtools|caution_colon")}</b> {_t("devtools|use_at_own_risk")}
<strong>{_t("devtools|caution_colon")}</strong> {_t("devtools|use_at_own_risk")}
</div>

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
title = _t("restore_key_backup_dialog|enter_phrase_title");
content = (
<div>
<p>{_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => <b>{sub}</b> })}</p>
<p>
{_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => <strong>{sub}</strong> })}
</p>
<p>{_t("restore_key_backup_dialog|enter_phrase_description")}</p>

<form className="mx_RestoreKeyBackupDialog_primaryContainer">
Expand Down Expand Up @@ -467,7 +469,9 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,

content = (
<div>
<p>{_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => <b>{sub}</b> })}</p>
<p>
{_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => <strong>{sub}</strong> })}
</p>
<p>{_t("restore_key_backup_dialog|enter_key_description")}</p>

<div className="mx_RestoreKeyBackupDialog_primaryContainer">
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/rooms/NewRoomIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const NewRoomIntro: React.FC = () => {
introMessage,
{},
{
displayName: () => <b>{displayName}</b>,
displayName: () => <strong>{displayName}</strong>,
},
)}
</p>
Expand Down Expand Up @@ -241,7 +241,7 @@ const NewRoomIntro: React.FC = () => {
"room|intro|start_of_room",
{},
{
roomName: () => <b>{room.name}</b>,
roomName: () => <strong>{room.name}</strong>,
},
)}
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
"room|invites_you_text",
{},
{
inviter: () => <b>{inviter?.name || inviteSender}</b>,
inviter: () => <strong>{inviter?.name || inviteSender}</strong>,
},
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomSearchAuxPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const RoomSearchAuxPanel: React.FC<Props> = ({ searchInfo, isRoomEncrypted, onSe
_t(
"room|search|summary",
{ count: searchInfo.count },
{ query: () => <b>{searchInfo.term}</b> },
{ query: () => <strong>{searchInfo.term}</strong> },
)
) : (
<InlineSpinner />
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomUpgradeWarningBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class RoomUpgradeWarningBar extends React.PureComponent<IProps, I
"room_settings|advanced|room_upgrade_warning",
{},
{
b: (sub) => <b>{sub}</b>,
b: (sub) => <strong>{sub}</strong>,
i: (sub) => <i>{sub}</i>,
},
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/CryptographyPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class CryptographyPanel extends React.Component<IProps, IState> {
<th scope="row">{_t("settings|security|session_key")}</th>
<td>
<code>
<b>{identityKey}</b>
<strong>{identityKey}</strong>
</code>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/settings/JoinRuleSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
"room_settings|security|join_rule_restricted_description_active_space",
{},
{
spaceName: () => <b>{SpaceStore.instance.activeSpaceRoom!.name}</b>,
spaceName: () => <strong>{SpaceStore.instance.activeSpaceRoom!.name}</strong>,
},
);
} else {
Expand Down Expand Up @@ -349,7 +349,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
(roomId) => !cli.getRoom(roomId)?.currentState.maySendStateEvent(EventType.SpaceChild, userId),
);
if (unableToUpdateSomeParents) {
warning = <b>{_t("room_settings|security|join_rule_restricted_upgrade_warning")}</b>;
warning = <strong>{_t("room_settings|security|join_rule_restricted_upgrade_warning")}</strong>;
}

upgradeRequiredDialog(
Expand Down
8 changes: 6 additions & 2 deletions src/components/views/settings/SecureBackupPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
statusDescription = (
<>
<SettingsSubsectionText>
{_t("settings|security|key_backup_inactive", {}, { b: (sub) => <b>{sub}</b> })}
{_t("settings|security|key_backup_inactive", {}, { b: (sub) => <strong>{sub}</strong> })}
</SettingsSubsectionText>
<SettingsSubsectionText>
{_t("settings|security|key_backup_connect_prompt")}
Expand Down Expand Up @@ -336,7 +336,11 @@ export default class SecureBackupPanel extends React.PureComponent<{}, IState> {
statusDescription = (
<>
<SettingsSubsectionText>
{_t("settings|security|key_backup_inactive_warning", {}, { b: (sub) => <b>{sub}</b> })}
{_t(
"settings|security|key_backup_inactive_warning",
{},
{ b: (sub) => <strong>{sub}</strong> },
)}
</SettingsSubsectionText>
<SettingsSubsectionText>{_t("encryption|setup_secure_backup|explainer")}</SettingsSubsectionText>
</>
Expand Down
Loading
Loading