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

Start DM on first message #8612

Merged
merged 102 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
8093f4b
Start DM on first message
weeman1337 May 16, 2022
7b40a6b
Add Room showReadMarkers prop
weeman1337 May 17, 2022
bd86b48
Disable typing notifications for local rooms
weeman1337 May 17, 2022
6538456
Add option to hide room header buttons
weeman1337 May 17, 2022
3dbd684
Hide local rooms from room list
weeman1337 May 17, 2022
38c92ff
Prevent storing m.direct for local rooms
weeman1337 May 17, 2022
7533d15
Add local room avatar
weeman1337 May 17, 2022
b0debb5
Disable room options menu for local rooms
weeman1337 May 17, 2022
1885a45
Choose a different local room id schema
weeman1337 May 20, 2022
c3f52b4
Avatar URL, extract determineCreateRoomEncryptionOption
weeman1337 May 20, 2022
0433e38
Reuse existing DM rooms
weeman1337 May 23, 2022
cb7f586
Set room name, enable multi invite
weeman1337 May 23, 2022
a99bb4e
Implement start DM with poll
weeman1337 May 23, 2022
09569f8
Tweak local room intro messages
weeman1337 May 23, 2022
0f908e2
Implement create DM on file upload
weeman1337 May 24, 2022
a793cb8
Implement create DM on sending sticker
weeman1337 May 24, 2022
afe2fda
Introduce fake client
weeman1337 May 24, 2022
0a67b9b
Collect and replay LocalRoom events
weeman1337 May 24, 2022
79df621
Add local echo; Refactor tile rendering condition
weeman1337 May 25, 2022
0a5a7bd
Implement local room timeline layout
weeman1337 May 25, 2022
d141218
Remove local rooms from history
weeman1337 May 25, 2022
307806e
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 May 25, 2022
9c117a0
Update translation files
weeman1337 May 25, 2022
d651202
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 May 25, 2022
f1b5ea4
Remove en_EN_orig.json
weeman1337 May 25, 2022
b2118cf
Fix roomId access in EventTile
weeman1337 May 25, 2022
412cf31
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 May 30, 2022
0f72b9b
LocalRoom model refactoring
weeman1337 May 30, 2022
98c8268
Fix undefined error
weeman1337 May 30, 2022
8f901fc
Implement room create spinner
weeman1337 May 30, 2022
a71e63e
Remove RoomView props
weeman1337 May 31, 2022
71150a8
Use consts
weeman1337 May 31, 2022
a526747
Wrap matrix client; remove local room view; update layout
weeman1337 May 31, 2022
c5369ec
Replace ClientWrapper by doMaybeLocalRoomAction
weeman1337 Jun 1, 2022
1ec35e3
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jun 2, 2022
68ff8d3
Refactor modules; introduce indirection to break cyclic imports
weeman1337 Jun 2, 2022
846a5e4
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jun 2, 2022
d14868b
Implement minimal local room view
weeman1337 Jun 2, 2022
91004d2
Revert unnecessary changes
weeman1337 Jun 2, 2022
307da0e
Update i18n files
weeman1337 Jun 2, 2022
7e96add
Fix file uploads
weeman1337 Jun 7, 2022
2b79f0e
Extend cypress test; wait for local room to be ready
weeman1337 Jun 13, 2022
cd49bb9
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jun 13, 2022
3adc846
After merge cleanup
weeman1337 Jun 13, 2022
d6f7f50
Clean up, fix Threads test
weeman1337 Jun 13, 2022
8216e13
Add local room create error handling
weeman1337 Jun 15, 2022
ab928d0
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jun 15, 2022
f32e63e
After merge cleanup
weeman1337 Jun 15, 2022
bad7dc0
Implement start DM on first message from user profile
weeman1337 Jun 27, 2022
eec735e
Implement Avatar tests
weeman1337 Jun 27, 2022
ec606c3
Add doMaybeLocalRoomAction test
weeman1337 Jun 27, 2022
6e9a968
Implement ContentMessages test
weeman1337 Jun 27, 2022
e7234b5
Add docs, RoomView refactoring
weeman1337 Jun 27, 2022
2efc744
Implement shareLocation test
weeman1337 Jun 27, 2022
25a1f40
Add SendMessageComposer test
weeman1337 Jun 27, 2022
2dbb04a
Add VoiceRecordComposerTile test
weeman1337 Jun 27, 2022
74bff65
Implement VisibilityProvider test
weeman1337 Jun 28, 2022
631f32f
Add TypingStore test
weeman1337 Jun 28, 2022
1d9c149
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jun 28, 2022
74db0b4
Fix cpyress tests (crypto will be re-added from develop)
weeman1337 Jun 28, 2022
1b166f5
Use KNOWN_SAFE_ROOM_VERSION from JS SDK
weeman1337 Jun 30, 2022
ea62c14
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jun 30, 2022
fa4c45b
Adapt SpotlightDialog
weeman1337 Jun 30, 2022
0643568
implement findDMForUser test
weeman1337 Jun 30, 2022
bd09b3c
Extend direct-messages tests
weeman1337 Jul 1, 2022
f7064e7
Implement direct messages tests / add docs
weeman1337 Jul 4, 2022
f2c7579
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 5, 2022
bf568ad
Adapt spotlight search for start DM
weeman1337 Jul 5, 2022
552a50b
Add RoomView test
weeman1337 Jul 5, 2022
cca4469
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 6, 2022
2a7ef60
Fix room name; reorganise code
weeman1337 Jul 6, 2022
28e18d1
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 7, 2022
8ed4c62
Update spotlight test
weeman1337 Jul 7, 2022
5c59a85
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 7, 2022
5f57546
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 11, 2022
52adaea
Remove duplicate LocalRoom test
weeman1337 Jul 11, 2022
aab5902
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 13, 2022
11b6227
Remove test IDs, unused cypress functions, replace all local rooms
weeman1337 Jul 13, 2022
56491d8
Extract isLocalRoom
weeman1337 Jul 13, 2022
79b227a
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 13, 2022
3695ba9
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 13, 2022
8091a51
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 13, 2022
6ea6ed6
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 18, 2022
5caff31
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 19, 2022
d8318c0
Remove e2e-encryption scenario
weeman1337 Jul 19, 2022
54e9ef5
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 20, 2022
d950a82
Remove test-ids
weeman1337 Jul 20, 2022
561f208
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 20, 2022
7b9a190
Remove console.log; revert import re-ordering
weeman1337 Jul 20, 2022
53dc06a
Revert more changes
weeman1337 Jul 20, 2022
c6ac752
Merge branch 'develop' into feat-dm-on-first
weeman1337 Jul 20, 2022
1067d94
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 25, 2022
2ca2a78
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 25, 2022
4781eea
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 25, 2022
f174f8f
Remove duplicated code after merge
weeman1337 Jul 25, 2022
ad0e1dd
Remove temp file
weeman1337 Jul 25, 2022
28e0a3f
Rename LocalRoomViewProps to ILocalRoomViewProps
weeman1337 Jul 26, 2022
7bf94a3
Extract LargeLoader
weeman1337 Jul 28, 2022
c73cc51
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Jul 28, 2022
a1ca909
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Aug 1, 2022
3bfa1f8
Update roomview test
weeman1337 Aug 1, 2022
0f34d70
Merge remote-tracking branch 'origin/develop' into feat-dm-on-first
weeman1337 Aug 2, 2022
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
7 changes: 6 additions & 1 deletion cypress/e2e/crypto/crypto.spec.ts
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
23 changes: 17 additions & 6 deletions cypress/e2e/spotlight/spotlight.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,13 @@ Cypress.Commands.add("startDM", (name: string) => {
cy.spotlightResults().should("have.length", 1);
cy.spotlightResults().eq(0).should("contain", name);
cy.spotlightResults().eq(0).click();
}).then(() => {
cy.roomHeaderName().should("contain", name);
cy.get(".mx_RoomSublist[aria-label=People]").should("contain", name);
});
// send first message to start DM
cy.get(".mx_BasicMessageComposer_input")
.should("have.focus")
.type("Hey!{enter}");
cy.contains(".mx_EventTile_body", "Hey!");
cy.get(".mx_RoomSublist[aria-label=People]").should("contain", name);
});

describe("Spotlight", () => {
Expand Down Expand Up @@ -324,11 +327,19 @@ describe("Spotlight", () => {
cy.spotlightResults().should("have.length", 1);
cy.spotlightResults().eq(0).should("contain", bot2Name);
cy.spotlightResults().eq(0).click();
}).then(() => {
cy.roomHeaderName().should("contain", bot2Name);
cy.get(".mx_RoomSublist[aria-label=People]").should("contain", bot2Name);
});

// Send first message to actually start DM
cy.roomHeaderName().should("contain", bot2Name);
cy.get(".mx_BasicMessageComposer_input")
.click()
.should("have.focus")
.type("Hey!{enter}");

// Assert DM exists by checking for the first message and the room being in the room list
cy.contains(".mx_EventTile_body", "Hey!");
cy.get(".mx_RoomSublist[aria-label=People]").should("contain", bot2Name);

// Invite BotBob into existing DM with ByteBot
cy.getDmRooms(bot2.getUserId()).then(dmRooms => dmRooms[0])
.then(groupDmId => cy.inviteUser(groupDmId, bot1.getUserId()))
Expand Down
1 change: 1 addition & 0 deletions res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@import "./structures/_GenericErrorPage.pcss";
@import "./structures/_HeaderButtons.pcss";
@import "./structures/_HomePage.pcss";
@import "./structures/_LargeLoader.pcss";
@import "./structures/_LeftPanel.pcss";
@import "./structures/_MainSplit.pcss";
@import "./structures/_MatrixChat.pcss";
Expand Down
37 changes: 37 additions & 0 deletions res/css/structures/_LargeLoader.pcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
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.
*/

.mx_LargeLoader {
align-items: center;
display: flex;
flex-direction: column;
height: 100%;

.mx_Spinner {
flex: unset;
height: auto;
margin-bottom: 32px;
margin-top: 33vh;
}

.mx_LargeLoader_text {
font-size: 24px;
font-weight: 600;
padding: 0 16px;
position: relative;
text-align: center;
}
}
11 changes: 11 additions & 0 deletions res/css/structures/_RoomView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ limitations under the License.
position: relative;
}

.mx_MainSplit_timeline,
.mx_RoomView--local {
.mx_MessageComposer_wrapper {
margin: $spacing-8 $spacing-16;
}
}

.mx_RoomView_auxPanel {
min-width: 0px;
width: 100%;
Expand Down Expand Up @@ -183,6 +190,10 @@ limitations under the License.
box-sizing: border-box;
}

.mx_RoomView--local .mx_ScrollPanel .mx_RoomView_MessageList {
justify-content: center;
}

.mx_RoomView_MessageList li {
clear: both;
}
Expand Down
37 changes: 37 additions & 0 deletions src/components/structures/LargeLoader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
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.
*/

import React from "react";

import Spinner from "../views/elements/Spinner";

interface LargeLoaderProps {
text: string;
}

/**
* Loader component that displays a (almost centered) spinner and loading message.
*/
export const LargeLoader: React.FC<LargeLoaderProps> = ({ text }) => {
return (
<div className="mx_LargeLoader">
<Spinner w={45} h={45} />
<div className="mx_LargeLoader_text">
{ text }
</div>
</div>
);
};
Loading