From 43b607f71572bd3778605d53557073d38d738dba Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Thu, 18 Jan 2024 18:26:27 +0100 Subject: [PATCH 1/4] [Backport staging] Fixed shield alignment on message Input (#12155) Co-authored-by: Manan Sadana --- res/css/views/rooms/_MessageComposer.pcss | 4 +++- src/components/views/rooms/MessageComposer.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/res/css/views/rooms/_MessageComposer.pcss b/res/css/views/rooms/_MessageComposer.pcss index 56a7da7ec6..b6e97fac39 100644 --- a/res/css/views/rooms/_MessageComposer.pcss +++ b/res/css/views/rooms/_MessageComposer.pcss @@ -79,7 +79,9 @@ limitations under the License. .mx_MessageComposer_composecontrols { width: 100%; } - +.mx_MessageComposer_e2eIconWrapper { + height: 12px; /* Match the height of the E2E icon for alignment */ +} .mx_MessageComposer_e2eIcon.mx_E2EIcon { position: absolute; left: 20px; diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 53e05e69a1..f9aae433fe 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -475,7 +475,9 @@ export class MessageComposer extends React.Component { public render(): React.ReactNode { const hasE2EIcon = Boolean(!this.state.isWysiwygLabEnabled && this.props.e2eStatus); const e2eIcon = hasE2EIcon && ( - +
+ +
); const controls: ReactNode[] = []; From 19867d85f4b928dc9b1da029d6af057573628071 Mon Sep 17 00:00:00 2001 From: ElementRobot Date: Fri, 19 Jan 2024 11:54:56 +0100 Subject: [PATCH 2/4] [Backport staging] Broaden support for matrix spec versions (#12159) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- src/Lifecycle.ts | 55 +++++++++++++++++++++++------------------- test/Lifecycle-test.ts | 5 +--- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 0f2435ffe8..1d6577ca39 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -23,7 +23,7 @@ import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { IEncryptedPayload } from "matrix-js-sdk/src/crypto/aes"; import { QueryDict } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; -import { MINIMUM_MATRIX_VERSION } from "matrix-js-sdk/src/version-support"; +import { MINIMUM_MATRIX_VERSION, SUPPORTED_MATRIX_VERSIONS } from "matrix-js-sdk/src/version-support"; import { IMatrixClientCreds, MatrixClientPeg } from "./MatrixClientPeg"; import SecurityCustomisations from "./customisations/Security"; @@ -635,7 +635,7 @@ export async function restoreFromLocalStorage(opts?: { ignoreGuest?: boolean }): }, false, ); - checkServerVersions(); + await checkServerVersions(); return true; } else { logger.log("No previous session found."); @@ -644,29 +644,34 @@ export async function restoreFromLocalStorage(opts?: { ignoreGuest?: boolean }): } async function checkServerVersions(): Promise { - MatrixClientPeg.get() - ?.getVersions() - .then((response) => { - if (!response.versions.includes(MINIMUM_MATRIX_VERSION)) { - const toastKey = "LEGACY_SERVER"; - ToastStore.sharedInstance().addOrReplaceToast({ - key: toastKey, - title: _t("unsupported_server_title"), - props: { - description: _t("unsupported_server_description", { - version: MINIMUM_MATRIX_VERSION, - brand: SdkConfig.get().brand, - }), - acceptLabel: _t("action|ok"), - onAccept: () => { - ToastStore.sharedInstance().dismissToast(toastKey); - }, - }, - component: GenericToast, - priority: 98, - }); - } - }); + const client = MatrixClientPeg.get(); + if (!client) return; + for (const version of SUPPORTED_MATRIX_VERSIONS) { + // Check if the server supports this spec version. (`isVersionSupported` caches the response, so this loop will + // only make a single HTTP request). + if (await client.isVersionSupported(version)) { + // we found a compatible spec version + return; + } + } + + const toastKey = "LEGACY_SERVER"; + ToastStore.sharedInstance().addOrReplaceToast({ + key: toastKey, + title: _t("unsupported_server_title"), + props: { + description: _t("unsupported_server_description", { + version: MINIMUM_MATRIX_VERSION, + brand: SdkConfig.get().brand, + }), + acceptLabel: _t("action|ok"), + onAccept: () => { + ToastStore.sharedInstance().dismissToast(toastKey); + }, + }, + component: GenericToast, + priority: 98, + }); } async function handleLoadSessionFailure(e: unknown): Promise { diff --git a/test/Lifecycle-test.ts b/test/Lifecycle-test.ts index b984549e9d..90dd0c5335 100644 --- a/test/Lifecycle-test.ts +++ b/test/Lifecycle-test.ts @@ -453,10 +453,7 @@ describe("Lifecycle", () => { it("should show a toast if the matrix server version is unsupported", async () => { const toastSpy = jest.spyOn(ToastStore.sharedInstance(), "addOrReplaceToast"); - mockClient.getVersions.mockResolvedValue({ - versions: ["r0.6.0"], - unstable_features: {}, - }); + mockClient.isVersionSupported.mockImplementation(async (version) => version == "r0.6.0"); initLocalStorageMock({ ...localStorageSession }); expect(await restoreFromLocalStorage()).toEqual(true); From abce0fdd2dfd7f22729fa048a108c54ae2c577fa Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 19 Jan 2024 13:48:45 +0000 Subject: [PATCH 3/4] Upgrade matrix-js-sdk to 31.1.0 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b8b6517406..430b139822 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "maplibre-gl": "^2.0.0", "matrix-encrypt-attachment": "^1.0.3", "matrix-events-sdk": "0.0.1", - "matrix-js-sdk": "31.0.0", + "matrix-js-sdk": "31.1.0", "matrix-widget-api": "^1.5.0", "memoize-one": "^6.0.0", "minimist": "^1.2.5", diff --git a/yarn.lock b/yarn.lock index 5354b14e54..5a9c3019dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7816,10 +7816,10 @@ matrix-events-sdk@0.0.1: resolved "https://registry.yarnpkg.com/matrix-events-sdk/-/matrix-events-sdk-0.0.1.tgz#c8c38911e2cb29023b0bbac8d6f32e0de2c957dd" integrity sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA== -matrix-js-sdk@31.0.0: - version "31.0.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-31.0.0.tgz#2aacab066466f33b0aa956b8a2c765bfe1bde384" - integrity sha512-2TqDwEK34NFS0uiOti02CBCupwJcAIxWarOSD0yIrgMpIwSVNB795jEnXxNXz+bgPKsepDmiqeg2DrlinIoW1w== +matrix-js-sdk@31.1.0: + version "31.1.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-31.1.0.tgz#d87a1ea86b6458bbfa1c6db81a7268dd58e4d7e1" + integrity sha512-3xtmepoCmvIJMDahIcbBdAKSCylgkffaRs9Y5/vOnbBxMi5uSO/MEY8uCUGB2B9M7P1mfgcWSkNeU7Oco521MQ== dependencies: "@babel/runtime" "^7.12.5" "@matrix-org/matrix-sdk-crypto-wasm" "^3.5.0" From 4681bbbfceb18d06f0245b7edc91b22f2b063e48 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 19 Jan 2024 13:48:46 +0000 Subject: [PATCH 4/4] v3.90.0 --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e0321e37..6092159b12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +Changes in [3.90.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.90.0) (2024-01-19) +===================================================================================================== +## ✨ Features + +* Broaden support for matrix spec versions ([#12159](https://github.com/matrix-org/matrix-react-sdk/pull/12159)). Contributed by @RiotRobot. + +## 🐛 Bug Fixes + +* Fixed shield alignment on message Input ([#12155](https://github.com/matrix-org/matrix-react-sdk/pull/12155)). Contributed by @RiotRobot. + + Changes in [3.89.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.89.0) (2024-01-16) ===================================================================================================== ## ✨ Features diff --git a/package.json b/package.json index 430b139822..b59ca0960e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.89.0", + "version": "3.90.0", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {