From a6e98b0b6340c7782cf4d7f5c5370f23fea9ca84 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 13 Sep 2024 12:09:41 +0100 Subject: [PATCH 1/5] Use `strong` over `b` for improved a11y semantics Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/views/auth/_AuthBody.pcss | 2 +- src/IdentityAuthClient.tsx | 2 +- src/RoomInvite.tsx | 2 +- .../auth/forgot-password/CheckEmail.tsx | 2 +- .../auth/forgot-password/EnterEmail.tsx | 2 +- .../auth/forgot-password/VerifyEmailModal.tsx | 2 +- .../auth/InteractiveAuthEntryComponents.tsx | 2 +- src/components/views/auth/LoginWithQRFlow.tsx | 2 +- .../dialogs/AnalyticsLearnMoreDialog.tsx | 4 ++-- .../views/dialogs/BugReportDialog.tsx | 6 ++--- .../views/dialogs/CreateRoomDialog.tsx | 8 +++++-- .../views/dialogs/CreateSubspaceDialog.tsx | 4 ++-- .../views/dialogs/LeaveSpaceDialog.tsx | 2 +- .../ManageRestrictedJoinRuleDialog.tsx | 2 +- .../ManualDeviceKeyVerificationDialog.tsx | 2 +- .../dialogs/RegistrationEmailPromptDialog.tsx | 2 +- .../dialogs/RoomUpgradeWarningDialog.tsx | 2 +- .../views/dialogs/UploadFailureDialog.tsx | 6 ++--- .../dialogs/devtools/SettingExplorer.tsx | 2 +- .../security/RestoreKeyBackupDialog.tsx | 8 +++++-- src/components/views/rooms/NewRoomIntro.tsx | 4 ++-- .../views/rooms/RoomPreviewCard.tsx | 2 +- .../views/rooms/RoomSearchAuxPanel.tsx | 2 +- .../views/rooms/RoomUpgradeWarningBar.tsx | 2 +- .../views/settings/CryptographyPanel.tsx | 2 +- .../views/settings/JoinRuleSettings.tsx | 4 ++-- .../views/settings/SecureBackupPanel.tsx | 8 +++++-- src/components/views/settings/SetIdServer.tsx | 14 +++++------ .../views/settings/SetIntegrationManager.tsx | 2 +- .../tabs/room/AdvancedRoomSettingsTab.tsx | 2 +- .../tabs/room/SecurityRoomSettingsTab.tsx | 4 ++-- .../tabs/user/HelpUserSettingsTab.tsx | 2 +- .../spaces/SpaceSettingsVisibilityTab.tsx | 4 +++- src/utils/exportUtils/HtmlExport.tsx | 6 ++--- src/widgets/CapabilityText.tsx | 24 +++++++++---------- 35 files changed, 80 insertions(+), 66 deletions(-) diff --git a/res/css/views/auth/_AuthBody.pcss b/res/css/views/auth/_AuthBody.pcss index de2052cc82..6a7082fc87 100644 --- a/res/css/views/auth/_AuthBody.pcss +++ b/res/css/views/auth/_AuthBody.pcss @@ -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); } diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index 6a3a1b081d..3b78d9e570 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -141,7 +141,7 @@ export default class IdentityAuthClient { "terms|identity_server_no_terms_description_1", {}, { - server: () => {abbreviateUrl(identityServerUrl)}, + server: () => {abbreviateUrl(identityServerUrl)}, }, )}
diff --git a/src/RoomInvite.tsx b/src/RoomInvite.tsx index c4ab2c506f..d4f156c91d 100644 --- a/src/RoomInvite.tsx +++ b/src/RoomInvite.tsx @@ -145,7 +145,7 @@ export function showAnyInviteErrors( "invite|room_failed_partial", {}, { - RoomName: () => {room.name}, + RoomName: () => {room.name}, }, )} diff --git a/src/components/structures/auth/forgot-password/CheckEmail.tsx b/src/components/structures/auth/forgot-password/CheckEmail.tsx index 77127df5fa..af563a8fa2 100644 --- a/src/components/structures/auth/forgot-password/CheckEmail.tsx +++ b/src/components/structures/auth/forgot-password/CheckEmail.tsx @@ -46,7 +46,7 @@ export const CheckEmail: React.FC{_t("auth|check_email_explainer", { email: email }, { b: (t) => {t} })}
+{_t("auth|check_email_explainer", { email: email }, { b: (t) => {t} })}
- {_t("auth|enter_email_explainer", { homeserver }, { b: (t) => {t} })} + {_t("auth|enter_email_explainer", { homeserver }, { b: (t) => {t} })}
- {_t("bug_reporting|unsupported_browser")} + {_t("bug_reporting|unsupported_browser")}
); } @@ -221,7 +221,7 @@ export default class BugReportDialog extends React.Component{_t("bug_reporting|description")}
-
+
{_t(
"bug_reporting|before_submitting",
{},
@@ -237,7 +237,7 @@ export default class BugReportDialog extends React.Component
- {key}
+ {key}
diff --git a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx
index ffaf01189b..a02098d3ed 100644
--- a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx
+++ b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx
@@ -54,7 +54,7 @@ const RegistrationEmailPromptDialog: React.FC{_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => {sub} })}
++ {_t("restore_key_backup_dialog|key_backup_warning", {}, { b: (sub) => {sub} })} +
{_t("restore_key_backup_dialog|enter_phrase_description")}
{roomId}
-
+
);
}
},
@@ -209,7 +209,7 @@ export class CapabilityText {
eventType: eventCap.eventType,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
),
byline: CapabilityText.bylineFor(eventCap),
@@ -222,7 +222,7 @@ export class CapabilityText {
eventType: eventCap.eventType,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
),
byline: CapabilityText.bylineFor(eventCap),
@@ -238,7 +238,7 @@ export class CapabilityText {
eventType: eventCap.eventType,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
),
byline: CapabilityText.bylineFor(eventCap),
@@ -251,7 +251,7 @@ export class CapabilityText {
eventType: eventCap.eventType,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
),
byline: CapabilityText.bylineFor(eventCap),
@@ -266,7 +266,7 @@ export class CapabilityText {
"widget|capability|capability",
{ capability },
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
),
};
@@ -390,7 +390,7 @@ export class CapabilityText {
msgtype: eventCap.keyStr,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
);
} else {
@@ -400,7 +400,7 @@ export class CapabilityText {
msgtype: eventCap.keyStr,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
);
}
@@ -412,7 +412,7 @@ export class CapabilityText {
msgtype: eventCap.keyStr,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
);
} else {
@@ -422,7 +422,7 @@ export class CapabilityText {
msgtype: eventCap.keyStr,
},
{
- b: (sub) => {sub},
+ b: (sub) => {sub},
},
);
}
From 8044ce4c013a3b93ed522fc8833969c12e801f79 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Fri, 13 Sep 2024 12:34:15 +0100
Subject: [PATCH 2/5] Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
.../structures/__snapshots__/RoomView-test.tsx.snap | 12 ++++++------
.../InteractiveAuthEntryComponents-test.tsx.snap | 4 ++--
.../ManageRestrictedJoinRuleDialog-test.tsx.snap | 8 ++++----
.../ManualDeviceKeyVerificationDialog-test.tsx.snap | 8 ++++----
.../views/settings/CryptographyPanel-test.tsx | 2 +-
.../__snapshots__/SecureBackupPanel-test.tsx.snap | 4 ++--
.../SetIntegrationManager-test.tsx.snap | 4 ++--
.../__snapshots__/LoginWithQRFlow-test.tsx.snap | 4 ++--
.../SecurityRoomSettingsTab-test.tsx.snap | 4 ++--
.../SecurityUserSettingsTab-test.tsx.snap | 8 ++++----
.../SpaceSettingsVisibilityTab-test.tsx.snap | 4 ++--
.../__snapshots__/HTMLExport-test.ts.snap | 2 +-
12 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/test/components/structures/__snapshots__/RoomView-test.tsx.snap b/test/components/structures/__snapshots__/RoomView-test.tsx.snap
index 569fe3640c..2432e30a22 100644
--- a/test/components/structures/__snapshots__/RoomView-test.tsx.snap
+++ b/test/components/structures/__snapshots__/RoomView-test.tsx.snap
@@ -370,9 +370,9 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
Send your first message to invite - + @user:example.com - + to chat
@@ -625,9 +625,9 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =Send your first message to invite - + @user:example.com - + to chat
@@ -952,9 +952,9 @@ exports[`RoomView for a local room in state NEW that is encrypted should match tSend your first message to invite - + @user:example.com - + to chat
diff --git a/test/components/views/auth/__snapshots__/InteractiveAuthEntryComponents-test.tsx.snap b/test/components/views/auth/__snapshots__/InteractiveAuthEntryComponents-test.tsx.snap index 65f86a35d2..4e03a26f02 100644 --- a/test/components/views/auth/__snapshots__/InteractiveAuthEntryComponents-test.tsx.snap +++ b/test/components/views/auth/__snapshots__/InteractiveAuthEntryComponents-test.tsx.snap @@ -8,9 +8,9 @@ exports[`To create your account, open the link in the email we just sent to - + alice@example.xyz - + .
diff --git a/test/components/views/dialogs/__snapshots__/ManageRestrictedJoinRuleDialog-test.tsx.snap b/test/components/views/dialogs/__snapshots__/ManageRestrictedJoinRuleDialog-test.tsx.snap index 08f299fec7..cf01ac63b6 100644 --- a/test/components/views/dialogs/__snapshots__/ManageRestrictedJoinRuleDialog-test.tsx.snap +++ b/test/components/views/dialogs/__snapshots__/ManageRestrictedJoinRuleDialog-test.tsx.snap @@ -26,9 +26,9 @@ exports[`Decide which spaces can access this room. If a space is selected, its members can find and join - + !roomId:server - + .
@@ -176,9 +176,9 @@ exports[`Decide which spaces can access this room. If a space is selected, its members can find and join - + !roomId:server - + .
diff --git a/test/components/views/dialogs/__snapshots__/ManualDeviceKeyVerificationDialog-test.tsx.snap b/test/components/views/dialogs/__snapshots__/ManualDeviceKeyVerificationDialog-test.tsx.snap index 8d493a9655..1186f06f38 100644 --- a/test/components/views/dialogs/__snapshots__/ManualDeviceKeyVerificationDialog-test.tsx.snap +++ b/test/components/views/dialogs/__snapshots__/ManualDeviceKeyVerificationDialog-test.tsx.snap @@ -66,9 +66,9 @@ exports[`ManualDeviceKeyVerificationDialog should display the device 1`] = `
-
+
ABCD EFGH
-
+
@@ -181,9 +181,9 @@ exports[`ManualDeviceKeyVerificationDialog should display the device of another
-
+
ABCD EFGH
-
+
diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx
index a993829e37..712ca18b53 100644
--- a/test/components/views/settings/CryptographyPanel-test.tsx
+++ b/test/components/views/settings/CryptographyPanel-test.tsx
@@ -18,7 +18,7 @@ describe("CryptographyPanel", () => {
it("shows the session ID and key", () => {
const sessionId = "ABCDEFGHIJ";
const sessionKey = "AbCDeFghIJK7L/m4nOPqRSTUVW4xyzaBCDef6gHIJkl";
- const sessionKeyFormatted = "AbCD eFgh IJK7 L/m4 nOPq RSTU VW4x yzaB CDef 6gHI Jkl";
+ const sessionKeyFormatted = "AbCD eFgh IJK7 L/m4 nOPq RSTU VW4x yzaB CDef 6gHI Jkl";
TestUtils.stubClient();
const client: MatrixClient = MatrixClientPeg.safeGet();
diff --git a/test/components/views/settings/__snapshots__/SecureBackupPanel-test.tsx.snap b/test/components/views/settings/__snapshots__/SecureBackupPanel-test.tsx.snap
index 718df62fee..ca51d4dc59 100644
--- a/test/components/views/settings/__snapshots__/SecureBackupPanel-test.tsx.snap
+++ b/test/components/views/settings/__snapshots__/SecureBackupPanel-test.tsx.snap
@@ -79,9 +79,9 @@ exports[`
-
+
It's not recommended to make encrypted rooms public.
-
+
It will mean anyone can find and join the room, so anyone can read messages. You'll get none of the benefits of encryption. Encrypting messages in a public room will make receiving and sending messages slower.
diff --git a/test/components/views/settings/tabs/user/__snapshots__/SecurityUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/SecurityUserSettingsTab-test.tsx.snap
index 4ccca2a02c..8a01587e16 100644
--- a/test/components/views/settings/tabs/user/__snapshots__/SecurityUserSettingsTab-test.tsx.snap
+++ b/test/components/views/settings/tabs/user/__snapshots__/SecurityUserSettingsTab-test.tsx.snap
@@ -48,9 +48,9 @@ exports[`
-
+
<not supported>
-
+
Allow people to preview your space before they join.
-
+
Recommended for public spaces.
-
+
created this room.
This is the start of export of !myroom:example.org. Exported by @userId:matrix.org at 11/17/2022.
+ created this room.
This is the start of export of !myroom:example.org. Exported by @userId:matrix.org at 11/17/2022.
- + Warning - + : you should only set up key backup from a trusted computer.
@@ -129,9 +129,9 @@ exports[`- + Warning - + : you should only set up key backup from a trusted computer.
@@ -228,9 +228,9 @@ exports[`- + Warning - + : you should only set up key backup from a trusted computer.
From 9e4348e8f1b4bed5b129c2bc9ecad2c3a3442849 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 Sep 2024 17:27:42 +0100 Subject: [PATCH 4/5] Update test assertions Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/components/views/settings/CryptographyPanel-test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx index ed8b4dc26c..caaf813cdb 100644 --- a/test/components/views/settings/CryptographyPanel-test.tsx +++ b/test/components/views/settings/CryptographyPanel-test.tsx @@ -37,7 +37,7 @@ describe("CryptographyPanel", () => { expect(codes[0].innerHTML).toEqual(sessionId); // Initially a placeholder - expect(codes[1].innerHTML).toEqual("..."); + expect(codes[1].innerHTML).toEqual("..."); // Then the actual key await flushPromises(); @@ -60,7 +60,7 @@ describe("CryptographyPanel", () => { const codes = rendered.container.querySelectorAll("code"); // Initially a placeholder - expect(codes[1].innerHTML).toEqual("..."); + expect(codes[1].innerHTML).toEqual("..."); // Then "not supported key await flushPromises(); From e6404daf3c8fba0c27018bce559e00c2a2d8134b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 25 Sep 2024 17:34:06 +0100 Subject: [PATCH 5/5] Update test assertions Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/components/views/settings/CryptographyPanel-test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx index caaf813cdb..aa0442e65a 100644 --- a/test/components/views/settings/CryptographyPanel-test.tsx +++ b/test/components/views/settings/CryptographyPanel-test.tsx @@ -64,6 +64,6 @@ describe("CryptographyPanel", () => { // Then "not supported key await flushPromises(); - expect(codes[1].innerHTML).toEqual("<not supported>"); + expect(codes[1].innerHTML).toEqual("<not supported>"); }); });