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

Commit

Permalink
Merge branch 'refs/heads/develop' into florianduros/fix/reply-line
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Aug 27, 2024
2 parents 8d18e5b + 5b91dd8 commit a79a2e0
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Switch js-sdk to release mode
working-directory: node_modules/matrix-js-sdk
run: |
scripts/switch_package_to_release.js
scripts/switch_package_to_release.cjs
yarn install
yarn run build:compile
yarn run build:types
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
Changes in [3.108.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.108.0) (2024-08-27)
=======================================================================================================
## ✨ Features

* Message Pinning: rework the message pinning list in the right panel ([#12825](https://github.com/matrix-org/matrix-react-sdk/pull/12825)). Contributed by @florianduros.
* Tweak UIA postMessage check to work cross-origin ([#12878](https://github.com/matrix-org/matrix-react-sdk/pull/12878)). Contributed by @t3chguy.
* Delayed events (Futures) / MSC4140 for call widget ([#12714](https://github.com/matrix-org/matrix-react-sdk/pull/12714)). Contributed by @AndrewFerr.
* Stop the ongoing ring if another device joins the call session. ([#12866](https://github.com/matrix-org/matrix-react-sdk/pull/12866)). Contributed by @toger5.
* Rich text Editor: Auto-replace plain text emoticons with emoji ([#12828](https://github.com/matrix-org/matrix-react-sdk/pull/12828)). Contributed by @langleyd.
* Clean up editor drafts for unknown rooms ([#12850](https://github.com/matrix-org/matrix-react-sdk/pull/12850)). Contributed by @langleyd.
* Rename general user settings to account ([#12841](https://github.com/matrix-org/matrix-react-sdk/pull/12841)). Contributed by @dbkr.
* Update settings tab icons ([#12867](https://github.com/matrix-org/matrix-react-sdk/pull/12867)). Contributed by @dbkr.
* Disable jump to read receipt button instead of hiding when nothing to jump to ([#12863](https://github.com/matrix-org/matrix-react-sdk/pull/12863)). Contributed by @t3chguy.

## 🐛 Bug Fixes

* Ensure elements on Login page are disabled when in-flight ([#12895](https://github.com/matrix-org/matrix-react-sdk/pull/12895)). Contributed by @t3chguy.
* Hide pinned messages when grouped in timeline when feature pinning is disabled ([#12888](https://github.com/matrix-org/matrix-react-sdk/pull/12888)). Contributed by @florianduros.
* Add chat button on new room header for maximised widgets ([#12882](https://github.com/matrix-org/matrix-react-sdk/pull/12882)). Contributed by @t3chguy.
* Show spinner whilst initial search request is in progress ([#12883](https://github.com/matrix-org/matrix-react-sdk/pull/12883)). Contributed by @t3chguy.
* Fix user menu font ([#12879](https://github.com/matrix-org/matrix-react-sdk/pull/12879)). Contributed by @florianduros.
* Allow selecting text in the right panel topic ([#12870](https://github.com/matrix-org/matrix-react-sdk/pull/12870)). Contributed by @t3chguy.
* Add missing presence indicator to new room header ([#12865](https://github.com/matrix-org/matrix-react-sdk/pull/12865)). Contributed by @t3chguy.


Changes in [3.107.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.107.0) (2024-08-20)
=======================================================================================================
* No changes
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matrix-react-sdk",
"version": "3.107.0",
"version": "3.108.0",
"description": "SDK for matrix.org using React",
"author": "matrix.org",
"repository": {
Expand Down Expand Up @@ -68,8 +68,7 @@
"jwt-decode": "4.0.0",
"@floating-ui/react": "0.26.11",
"@radix-ui/react-id": "1.1.0",
"caniuse-lite": "1.0.30001643",
"electron-to-chromium": "1.5.2"
"caniuse-lite": "1.0.30001643"
},
"dependencies": {
"@babel/runtime": "^7.12.5",
Expand All @@ -95,7 +94,6 @@
"css-tree": "^2.3.1",
"diff-dom": "^5.0.0",
"diff-match-patch": "^1.0.5",
"electron-to-chromium": "^1.5.2",
"emojibase-regex": "15.3.2",
"escape-html": "^1.0.3",
"file-saver": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion playwright/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.45.3-jammy
FROM mcr.microsoft.com/playwright:v1.46.1-jammy

WORKDIR /work/matrix-react-sdk
VOLUME ["/work/element-web/node_modules"]
Expand Down
1 change: 1 addition & 0 deletions src/IConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface IConfigOptions {
integrations_ui_url?: string;
integrations_rest_url?: string;
integrations_widgets_urls?: string[];
default_widget_container_height?: number; // height in pixels

show_labs_settings: boolean;
features?: Record<string, boolean>; // <FeatureName, EnabledBool>
Expand Down
15 changes: 6 additions & 9 deletions src/SupportedBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.

import { logger } from "matrix-js-sdk/src/logger";
import browserlist from "browserslist";
import electronToChromium from "electron-to-chromium/versions";
import PopOutIcon from "@vector-im/compound-design-tokens/assets/web/icons/pop-out";

import { DeviceType, parseUserAgent } from "./utils/device/parseUserAgent";
Expand Down Expand Up @@ -46,14 +45,6 @@ function onDismissClick(): void {
function getBrowserNameVersion(browser: string): [name: string, version: number] {
const [browserName, browserVersion] = browser.split(" ");
const browserNameLc = browserName.toLowerCase();
if (browserNameLc === "electron") {
// The electron-to-chromium map is keyed by the major and minor version of Electron
const chromiumVersion = electronToChromium[browserVersion.split(".").slice(0, 2).join(".")];
if (chromiumVersion) {
return ["chrome", parseInt(chromiumVersion, 10)];
}
}

return [browserNameLc, parseInt(browserVersion, 10)];
}

Expand All @@ -80,6 +71,12 @@ export function getBrowserSupport(): boolean {
}

if (details.client) {
// We don't care about the browser version for desktop devices
// We ship our own browser (electron) for desktop devices
if (details.deviceType === DeviceType.Desktop) {
return supported;
}

const [browserName, browserVersion] = getBrowserNameVersion(details.client);
const minimumVersion = minimumBrowserVersions.get(browserName);
// Check both with the sub-version cut off and without as some browsers have less granular versioning e.g. Safari
Expand Down
3 changes: 2 additions & 1 deletion src/components/views/rooms/AppsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { clamp, percentageOf, percentageWithin } from "../../../utils/numbers";
import UIStore from "../../../stores/UIStore";
import { ActionPayload } from "../../../dispatcher/payloads";
import Spinner from "../elements/Spinner";
import SdkConfig from "../../../SdkConfig";

interface IProps {
userId: string;
Expand Down Expand Up @@ -335,7 +336,7 @@ const PersistentVResizer: React.FC<IPersistentResizerProps> = ({
defaultHeight = clamp(defaultHeight, 0, 100);
defaultHeight = percentageWithin(defaultHeight / 100, minHeight, maxHeight);
} else {
defaultHeight = 280;
defaultHeight = SdkConfig.get().default_widget_container_height ?? 280;
}

return (
Expand Down
84 changes: 84 additions & 0 deletions test/components/views/rooms/AppsDrawer-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Copyright 2024 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import React from "react";
import { MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import { render } from "@testing-library/react";

import { stubClient } from "../../../test-utils";
import AppsDrawer from "../../../../src/components/views/rooms/AppsDrawer";
import SdkConfig from "../../../../src/SdkConfig";
import ResizeNotifier from "../../../../src/utils/ResizeNotifier";
import { WidgetLayoutStore } from "../../../../src/stores/widgets/WidgetLayoutStore";
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";

const ROOM_ID = "!room:id";

describe("AppsDrawer", () => {
let client: MatrixClient;
let room: Room;
let dummyResizeNotifier: ResizeNotifier;

beforeEach(async () => {
client = stubClient();
room = new Room(ROOM_ID, client, client.getUserId()!, {
pendingEventOrdering: PendingEventOrdering.Detached,
});
dummyResizeNotifier = new ResizeNotifier();
});

afterEach(() => {
jest.restoreAllMocks();
});

it("honours default_widget_container_height", () => {
jest.spyOn(SdkConfig, "get").mockImplementation((key) => {
if (!key) {
return {
default_widget_container_height: 500,
};
}
});
jest.spyOn(WidgetLayoutStore.instance, "getContainerWidgets").mockImplementation((room, container) => {
if (container === "top") {
return [
{
id: "testwidget",
creatorUserId: client.getUserId()!,
type: "test",
url: "https://nowhere.dummy/notawidget",
},
];
}
return [];
});

const { container } = render(
<AppsDrawer
userId={client.getUserId()!}
room={room}
resizeNotifier={dummyResizeNotifier}
showApps={true}
/>,
{
wrapper: ({ ...rest }) => <MatrixClientContext.Provider value={client} {...rest} />,
},
);

const appsDrawerResizer = container.getElementsByClassName("mx_AppsDrawer_resizer")[0] as HTMLElement;
expect(appsDrawerResizer.style.height).toBe("500px");
});
});
11 changes: 8 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4389,11 +4389,16 @@ ee-first@1.1.1:
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@1.5.2, electron-to-chromium@^1.4.820, electron-to-chromium@^1.5.2, electron-to-chromium@^1.5.4:
electron-to-chromium@^1.4.820:
version "1.5.2"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz#6126ad229ce45e781ec54ca40db0504787f23d19"
integrity sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==

electron-to-chromium@^1.5.4:
version "1.5.13"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6"
integrity sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==

emittery@^0.13.1:
version "0.13.1"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad"
Expand Down Expand Up @@ -7001,8 +7006,8 @@ matrix-events-sdk@0.0.1:
integrity sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==

"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop":
version "34.3.1"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/8d19782c57ba5264f06a80c724b41cf4ba8482e8"
version "34.4.0"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/2a6612c73aa7ae8d7f10f426239b2850c86a1ea5"
dependencies:
"@babel/runtime" "^7.12.5"
"@matrix-org/matrix-sdk-crypto-wasm" "^7.0.0"
Expand Down

0 comments on commit a79a2e0

Please sign in to comment.