Skip to content

Commit

Permalink
Merge tag 'v3.52.0' into sc
Browse files Browse the repository at this point in the history
* Device manager - New device tile info design ([\matrix-org#9122](matrix-org#9122)). Contributed by @kerryarchibald.
* Device manager generic settings subsection component ([\matrix-org#9147](matrix-org#9147)). Contributed by @kerryarchibald.
* Migrate the hidden read receipts flag to new "send read receipts" option ([\matrix-org#9141](matrix-org#9141)).
* Live location sharing - share location at most every 5 seconds ([\matrix-org#9148](matrix-org#9148)). Contributed by @kerryarchibald.
* Increase max length of voice messages to 15m ([\matrix-org#9133](matrix-org#9133)). Fixes element-hq/element-web#18620.
* Move pin drop out of labs ([\matrix-org#9135](matrix-org#9135)).
* Start DM on first message ([\matrix-org#8612](matrix-org#8612)). Fixes element-hq/element-web#14736.
* Remove "Add Space" button from RoomListHeader when user cannot create spaces ([\matrix-org#9129](matrix-org#9129)).
* The Welcome Home Screen: Dedicated Download Apps Dialog ([\matrix-org#9120](matrix-org#9120)). Fixes element-hq/element-web#22921. Contributed by @justjanne.
* The Welcome Home Screen: "Submit Feedback" pane ([\matrix-org#9090](matrix-org#9090)). Fixes element-hq/element-web#22918. Contributed by @justjanne.
* New User Onboarding Task List ([\matrix-org#9083](matrix-org#9083)). Fixes element-hq/element-web#22919. Contributed by @justjanne.
* Add support for disabling spell checking ([\matrix-org#8604](matrix-org#8604)). Fixes element-hq/element-web#21901.
* Live location share - leave maximised map open when beacons expire ([\matrix-org#9098](matrix-org#9098)). Contributed by @kerryarchibald.
* Some slash-commands (`/myroomnick`) have temporarily been disabled before the first message in a DM is sent. ([\matrix-org#9193](matrix-org#9193)).
* Use stable reference for active tab in tabbedView ([\matrix-org#9145](matrix-org#9145)). Contributed by @kerryarchibald.
* Fix pillification sometimes doubling up ([\matrix-org#9152](matrix-org#9152)). Fixes element-hq/element-web#23036.
* Fix composer padding ([\matrix-org#9137](matrix-org#9137)). Fixes element-hq/element-web#22992.
* Fix highlights not being applied to plaintext messages ([\matrix-org#9126](matrix-org#9126)). Fixes element-hq/element-web#22787.
* Fix dismissing edit composer when change was undone ([\matrix-org#9109](matrix-org#9109)). Fixes element-hq/element-web#22932.
* 1-to-1 DM rooms with bots now act like DM rooms instead of multi-user-rooms before ([\matrix-org#9124](matrix-org#9124)). Fixes element-hq/element-web#22894.
* Apply inline start padding to selected lines on modern layout only ([\matrix-org#9006](matrix-org#9006)). Fixes element-hq/element-web#22768. Contributed by @luixxiul.
* Peek into world-readable rooms from spotlight ([\matrix-org#9115](matrix-org#9115)). Fixes element-hq/element-web#22862.
* Use default styling on nested numbered lists due to MD being sensitive ([\matrix-org#9110](matrix-org#9110)). Fixes element-hq/element-web#22935.
* Fix replying using chat effect commands ([\matrix-org#9101](matrix-org#9101)). Fixes element-hq/element-web#22824.
* The first message in a DM can no longer be a sticker. This has been changed to avoid issues with the integration manager. ([\matrix-org#9180](matrix-org#9180)).
  • Loading branch information
su-ex committed Aug 22, 2022
2 parents a00e78b + afb39d8 commit 434ba30
Show file tree
Hide file tree
Showing 514 changed files with 7,535 additions and 6,857 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>matrix-org/renovate-config-element-web"
]
}
18 changes: 18 additions & 0 deletions .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,21 @@ jobs:

- name: Run Linter
run: "yarn run lint:style"

analyse_dead_code:
name: "Analyse Dead Code"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
cache: 'yarn'

- name: Install Deps
run: "scripts/ci/layered.sh"

- name: Dead Code Analysis
run: |
cd element-web
yarn run analyse:unused-exports
1 change: 1 addition & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ module.exports = {
"selector-no-vendor-prefix": null,
"media-feature-name-no-vendor-prefix": null,
"number-max-precision": null,
"no-invalid-double-slash-comments": true,
},
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
Changes in [3.52.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.52.0) (2022-08-16)
=====================================================================================================

## ✨ Features
* Device manager - New device tile info design ([\#9122](https://github.com/matrix-org/matrix-react-sdk/pull/9122)). Contributed by @kerryarchibald.
* Device manager generic settings subsection component ([\#9147](https://github.com/matrix-org/matrix-react-sdk/pull/9147)). Contributed by @kerryarchibald.
* Migrate the hidden read receipts flag to new "send read receipts" option ([\#9141](https://github.com/matrix-org/matrix-react-sdk/pull/9141)).
* Live location sharing - share location at most every 5 seconds ([\#9148](https://github.com/matrix-org/matrix-react-sdk/pull/9148)). Contributed by @kerryarchibald.
* Increase max length of voice messages to 15m ([\#9133](https://github.com/matrix-org/matrix-react-sdk/pull/9133)). Fixes vector-im/element-web#18620.
* Move pin drop out of labs ([\#9135](https://github.com/matrix-org/matrix-react-sdk/pull/9135)).
* Start DM on first message ([\#8612](https://github.com/matrix-org/matrix-react-sdk/pull/8612)). Fixes vector-im/element-web#14736.
* Remove "Add Space" button from RoomListHeader when user cannot create spaces ([\#9129](https://github.com/matrix-org/matrix-react-sdk/pull/9129)).
* The Welcome Home Screen: Dedicated Download Apps Dialog ([\#9120](https://github.com/matrix-org/matrix-react-sdk/pull/9120)). Fixes vector-im/element-web#22921. Contributed by @justjanne.
* The Welcome Home Screen: "Submit Feedback" pane ([\#9090](https://github.com/matrix-org/matrix-react-sdk/pull/9090)). Fixes vector-im/element-web#22918. Contributed by @justjanne.
* New User Onboarding Task List ([\#9083](https://github.com/matrix-org/matrix-react-sdk/pull/9083)). Fixes vector-im/element-web#22919. Contributed by @justjanne.
* Add support for disabling spell checking ([\#8604](https://github.com/matrix-org/matrix-react-sdk/pull/8604)). Fixes vector-im/element-web#21901.
* Live location share - leave maximised map open when beacons expire ([\#9098](https://github.com/matrix-org/matrix-react-sdk/pull/9098)). Contributed by @kerryarchibald.

## 🐛 Bug Fixes
* Some slash-commands (`/myroomnick`) have temporarily been disabled before the first message in a DM is sent. ([\#9193](https://github.com/matrix-org/matrix-react-sdk/pull/9193)).
* Use stable reference for active tab in tabbedView ([\#9145](https://github.com/matrix-org/matrix-react-sdk/pull/9145)). Contributed by @kerryarchibald.
* Fix pillification sometimes doubling up ([\#9152](https://github.com/matrix-org/matrix-react-sdk/pull/9152)). Fixes vector-im/element-web#23036.
* Fix composer padding ([\#9137](https://github.com/matrix-org/matrix-react-sdk/pull/9137)). Fixes vector-im/element-web#22992.
* Fix highlights not being applied to plaintext messages ([\#9126](https://github.com/matrix-org/matrix-react-sdk/pull/9126)). Fixes vector-im/element-web#22787.
* Fix dismissing edit composer when change was undone ([\#9109](https://github.com/matrix-org/matrix-react-sdk/pull/9109)). Fixes vector-im/element-web#22932.
* 1-to-1 DM rooms with bots now act like DM rooms instead of multi-user-rooms before ([\#9124](https://github.com/matrix-org/matrix-react-sdk/pull/9124)). Fixes vector-im/element-web#22894.
* Apply inline start padding to selected lines on modern layout only ([\#9006](https://github.com/matrix-org/matrix-react-sdk/pull/9006)). Fixes vector-im/element-web#22768. Contributed by @luixxiul.
* Peek into world-readable rooms from spotlight ([\#9115](https://github.com/matrix-org/matrix-react-sdk/pull/9115)). Fixes vector-im/element-web#22862.
* Use default styling on nested numbered lists due to MD being sensitive ([\#9110](https://github.com/matrix-org/matrix-react-sdk/pull/9110)). Fixes vector-im/element-web#22935.
* Fix replying using chat effect commands ([\#9101](https://github.com/matrix-org/matrix-react-sdk/pull/9101)). Fixes vector-im/element-web#22824.
* The first message in a DM can no longer be a sticker. This has been changed to avoid issues with the integration manager. ([\#9180](https://github.com/matrix-org/matrix-react-sdk/pull/9180)).

Changes in [3.51.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.51.0) (2022-08-02)
=====================================================================================================

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const startDMWithBob = function(this: CryptoTestContext) {
};

const testMessages = function(this: CryptoTestContext) {
cy.get(".mx_BasicMessageComposer_input").should("have.focus").type("Hey!{enter}");
// check the invite message
cy.contains(".mx_EventTile_body", "Hey!")
.closest(".mx_EventTile")
.should("not.have.descendants", ".mx_EventTile_e2eIcon_warning")
Expand Down Expand Up @@ -150,6 +150,11 @@ describe("Cryptography", function() {
it("creating a DM should work, being e2e-encrypted / user verification", function(this: CryptoTestContext) {
cy.bootstrapCrossSigning();
startDMWithBob.call(this);
// send first message
cy.get(".mx_BasicMessageComposer_input")
.click()
.should("have.focus")
.type("Hey!{enter}");
checkDMRoom();
bobJoin.call(this);
testMessages.call(this);
Expand Down
70 changes: 70 additions & 0 deletions cypress/e2e/editing/editing.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Copyright 2022 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.
*/

/// <reference types="cypress" />

import { MessageEvent } from "matrix-events-sdk";

import type { ISendEventResponse } from "matrix-js-sdk/src/@types/requests";
import type { EventType } from "matrix-js-sdk/src/@types/event";
import { SynapseInstance } from "../../plugins/synapsedocker";
import Chainable = Cypress.Chainable;

const sendEvent = (roomId: string): Chainable<ISendEventResponse> => {
return cy.sendEvent(
roomId,
null,
"m.room.message" as EventType,
MessageEvent.from("Message").serialize().content,
);
};

describe("Editing", () => {
let synapse: SynapseInstance;

beforeEach(() => {
cy.startSynapse("default").then(data => {
synapse = data;
cy.initTestUser(synapse, "Edith").then(() => {
cy.injectAxe();
return cy.createRoom({ name: "Test room" }).as("roomId");
});
});
});

afterEach(() => {
cy.stopSynapse(synapse);
});

it("should close the composer when clicking save after making a change and undoing it", () => {
cy.get<string>("@roomId").then(roomId => {
sendEvent(roomId);
cy.visit("/#/room/" + roomId);
});

// Edit message
cy.contains(".mx_RoomView_body .mx_EventTile .mx_EventTile_line", "Message").within(() => {
cy.get('[aria-label="Edit"]').click({ force: true }); // Cypress has no ability to hover
cy.checkA11y();
cy.get(".mx_BasicMessageComposer_input").type("Foo{backspace}{backspace}{backspace}{enter}");
cy.checkA11y();
});
cy.get(".mx_RoomView_body .mx_EventTile").contains(".mx_EventTile[data-scroll-tokens]", "Message");

// Assert that the edit composer has gone away
cy.get(".mx_EditMessageComposer").should("not.exist");
});
});
12 changes: 6 additions & 6 deletions cypress/e2e/lazy-loading/lazy-loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ describe("Lazy Loading", () => {
});
}

function getMembersInMemberlist(): Chainable<JQuery> {
return cy.get(".mx_MemberList .mx_EntityTile_name");
function getMemberInMemberlist(name: string): Chainable<JQuery> {
return cy.contains(".mx_MemberList .mx_EntityTile_name", name);
}

function checkMemberList(charlies: Charly[]) {
getMembersInMemberlist().contains("Alice").should("exist");
getMembersInMemberlist().contains("Bob").should("exist");
getMemberInMemberlist("Alice").should("exist");
getMemberInMemberlist("Bob").should("exist");
charlies.forEach(charly => {
getMembersInMemberlist().contains(charly.displayName).should("exist");
getMemberInMemberlist(charly.displayName).should("exist");
});
}

function checkMemberListLacksCharlies(charlies: Charly[]) {
charlies.forEach(charly => {
getMembersInMemberlist().contains(charly.displayName).should("not.exist");
getMemberInMemberlist(charly.displayName).should("not.exist");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ limitations under the License.

import { SynapseInstance } from "../../plugins/synapsedocker";
import Chainable = Cypress.Chainable;
import { SettingLevel } from "../../../src/settings/SettingLevel";

describe("Location sharing", () => {
let synapse: SynapseInstance;
Expand All @@ -40,9 +39,6 @@ describe("Location sharing", () => {

cy.initTestUser(synapse, "Tom");
});

// enable pin drop location sharing feature
cy.setSettingValue("feature_location_share_pin_drop", null, SettingLevel.DEVICE, true);
});

afterEach(() => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ describe("Login", () => {
});

it("logs in with an existing account and lands on the home screen", () => {
cy.injectAxe();

cy.get("#mx_LoginForm_username", { timeout: 15000 }).should("be.visible");
cy.percySnapshot("Login");
cy.checkA11y();

cy.get(".mx_ServerPicker_change").click();
cy.get(".mx_ServerPickerDialog_otherHomeserver").type(synapse.baseUrl);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ describe("Registration", () => {
});

it("registers an account and lands on the home screen", () => {
cy.injectAxe();

cy.get(".mx_ServerPicker_change", { timeout: 15000 }).click();
cy.get(".mx_ServerPickerDialog_continue").should("be.visible");
cy.percySnapshot("Server Picker");
cy.checkA11y();

cy.get(".mx_ServerPickerDialog_otherHomeserver").type(synapse.baseUrl);
cy.get(".mx_ServerPickerDialog_continue").click();
Expand All @@ -46,6 +49,7 @@ describe("Registration", () => {
// Hide the server text as it contains the randomly allocated Synapse port
const percyCSS = ".mx_ServerPicker_server { visibility: hidden !important; }";
cy.percySnapshot("Registration", { percyCSS });
cy.checkA11y();

cy.get("#mx_RegistrationForm_username").type("alice");
cy.get("#mx_RegistrationForm_password").type("totally a great password");
Expand All @@ -55,16 +59,21 @@ describe("Registration", () => {

cy.get(".mx_RegistrationEmailPromptDialog").should("be.visible");
cy.percySnapshot("Registration email prompt", { percyCSS });
cy.checkA11y();
cy.get(".mx_RegistrationEmailPromptDialog button.mx_Dialog_primary").click();

cy.stopMeasuring("create-account");
cy.get(".mx_InteractiveAuthEntryComponents_termsPolicy").should("be.visible");
cy.percySnapshot("Registration terms prompt", { percyCSS });
cy.checkA11y();

cy.get(".mx_InteractiveAuthEntryComponents_termsPolicy input").click();
cy.startMeasuring("from-submit-to-home");
cy.get(".mx_InteractiveAuthEntryComponents_termsSubmit").click();

cy.get(".mx_UseCaseSelection_skip").should("exist");
cy.percySnapshot("Use-case selection screen");
cy.checkA11y();
cy.get(".mx_UseCaseSelection_skip .mx_AccessibleButton").click();

cy.url().should('contain', '/#/home');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ describe("Pills", () => {
// find the pill in the timeline and click it
cy.get(".mx_EventTile_body .mx_Pill").click();

const localUrl = `/#/room/#${targetLocalpart}:`;
// verify we landed at a sane place
cy.url().should("contain", `/#/room/#${targetLocalpart}:`);
cy.url().should("contain", localUrl);

cy.wait(250); // let the room list settle

Expand All @@ -69,7 +70,7 @@ describe("Pills", () => {
cy.get(".mx_EventTile_body .mx_Pill .mx_Pill_linkText")
.should("have.css", "pointer-events", "none")
.click({ force: true }); // force is to ensure we bypass pointer-events
cy.url().should("contain", `https://matrix.to/#/#${targetLocalpart}:`);
cy.url().should("contain", localUrl);
});
});
});
90 changes: 90 additions & 0 deletions cypress/e2e/settings/hidden-rr-migration.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
Copyright 2022 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.
*/

/// <reference types="cypress" />

import { SynapseInstance } from "../../plugins/synapsedocker";

function seedLabs(synapse: SynapseInstance, labsVal: boolean | null): void {
cy.initTestUser(synapse, "Sally", () => {
// seed labs flag
cy.window({ log: false }).then(win => {
if (typeof labsVal === "boolean") {
// stringify boolean
win.localStorage.setItem("mx_labs_feature_feature_hidden_read_receipts", `${labsVal}`);
}
});
});
}

function testForVal(settingVal: boolean | null): void {
const testRoomName = "READ RECEIPTS";
cy.createRoom({ name: testRoomName }).as("roomId");
cy.all([cy.get<string>("@roomId")]).then(() => {
cy.viewRoomByName(testRoomName).then(() => {
// if we can see the room, then sync is working for us. It's time to see if the
// migration even ran.

cy.getSettingValue("sendReadReceipts", null, true).should("satisfy", (val) => {
if (typeof settingVal === "boolean") {
return val === settingVal;
} else {
return !val; // falsy - we don't actually care if it's undefined, null, or a literal false
}
});
});
});
}

describe("Hidden Read Receipts Setting Migration", () => {
// We run this as a full-blown end-to-end test to ensure it works in an integration
// sense. If we unit tested it, we'd be testing that the code works but not that the
// migration actually runs.
//
// Here, we get to test that not only the code works but also that it gets run. Most
// of our interactions are with the JS console as we're honestly just checking that
// things got set correctly.
//
// For a security-sensitive feature like hidden read receipts, it's absolutely vital
// that we migrate the setting appropriately.

let synapse: SynapseInstance;

beforeEach(() => {
cy.startSynapse("default").then(data => {
synapse = data;
});
});

afterEach(() => {
cy.stopSynapse(synapse);
});

it('should not migrate the lack of a labs flag', () => {
seedLabs(synapse, null);
testForVal(null);
});

it('should migrate labsHiddenRR=false as sendRR=true', () => {
seedLabs(synapse, false);
testForVal(true);
});

it('should migrate labsHiddenRR=true as sendRR=false', () => {
seedLabs(synapse, true);
testForVal(false);
});
});
Loading

0 comments on commit 434ba30

Please sign in to comment.