From ccd3234873184393ac5afe4abbe3494461f87ac6 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 21 Jan 2020 16:13:14 +0000 Subject: [PATCH 1/9] Moved read receipts to the bottom of the EventTile. --- res/css/views/rooms/_EventTile.scss | 17 +---------------- src/components/views/rooms/EventTile.js | 6 +++--- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index fbac1e932a..0b5c4a48a6 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -289,17 +289,11 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { display: inline-block; width: 14px; height: 14px; - top: 29px; + top: -19px; user-select: none; z-index: 1; } -.mx_EventTile_continuation .mx_EventTile_readAvatars, -.mx_EventTile_info .mx_EventTile_readAvatars, -.mx_EventTile_emote .mx_EventTile_readAvatars { - top: 7px; -} - .mx_EventTile_readAvatars .mx_BaseAvatar { position: absolute; display: inline-block; @@ -621,15 +615,6 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { top: 27px; } - .mx_EventTile_continuation .mx_EventTile_readAvatars, - .mx_EventTile_emote .mx_EventTile_readAvatars { - top: 5px; - } - - .mx_EventTile_info .mx_EventTile_readAvatars { - top: 4px; - } - .mx_RoomView_MessageList h2 { margin-top: 6px; } diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index dce4dc8a93..8ee51a9377 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -820,9 +820,6 @@ export default createReactClass({ // tab-index=-1 to allow it to be focusable but do not add tab stop for it, primarily for screen readers return (
-
- { readAvatars } -
{ sender }
+
+ { readAvatars } +
{ // The avatar goes after the event tile as it's absolutely positioned to be over the // event tile line, so needs to be later in the DOM so it appears on top (this avoids From 07348a65ad66b733c6de899ade6ba47c71c0e710 Mon Sep 17 00:00:00 2001 From: Mark Striemer Date: Mon, 2 Mar 2020 13:59:14 -0600 Subject: [PATCH 2/9] Include a mark as read X under the scroll to unread button --- res/css/views/rooms/_TopUnreadMessagesBar.scss | 14 ++++++++++++++ src/components/views/rooms/TopUnreadMessagesBar.js | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/res/css/views/rooms/_TopUnreadMessagesBar.scss b/res/css/views/rooms/_TopUnreadMessagesBar.scss index a3916f321a..5f6f869877 100644 --- a/res/css/views/rooms/_TopUnreadMessagesBar.scss +++ b/res/css/views/rooms/_TopUnreadMessagesBar.scss @@ -56,3 +56,17 @@ limitations under the License. mask-position: 9px 13px; background: $roomtile-name-color; } + +.mx_TopUnreadMessagesBar_markAsRead { + display: block; + width: 18px; + height: 18px; + background-image: url('$(res)/img/cancel.svg'); + background-position: center; + background-size: 10px; + background-repeat: no-repeat; + background-color: $primary-bg-color; + border: 1.3px solid $roomtile-name-color; + border-radius: 99px; + margin: 5px auto; +} diff --git a/src/components/views/rooms/TopUnreadMessagesBar.js b/src/components/views/rooms/TopUnreadMessagesBar.js index 04805c799f..23d41059c4 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.js +++ b/src/components/views/rooms/TopUnreadMessagesBar.js @@ -27,6 +27,7 @@ export default createReactClass({ propTypes: { onScrollUpClick: PropTypes.func, + onCloseClick: PropTypes.func, }, render: function() { @@ -36,6 +37,10 @@ export default createReactClass({ title={_t('Jump to first unread message.')} onClick={this.props.onScrollUpClick}> + +
); }, From df9710907c833aad6275feb191f6d88c0bc8e58f Mon Sep 17 00:00:00 2001 From: Mark Striemer Date: Mon, 2 Mar 2020 15:45:16 -0600 Subject: [PATCH 3/9] Add en_US string --- src/i18n/strings/en_EN.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index ab18c58e90..58f42ebe34 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1139,6 +1139,7 @@ "Revoke invite": "Revoke invite", "Invited by %(sender)s": "Invited by %(sender)s", "Jump to first unread message.": "Jump to first unread message.", + "Mark all as read": "Mark all as read", "Error updating main address": "Error updating main address", "There was an error updating the room's main address. It may not be allowed by the server or a temporary failure occurred.": "There was an error updating the room's main address. It may not be allowed by the server or a temporary failure occurred.", "Error creating alias": "Error creating alias", From 98f0a2ab679d4d08c298a0148e3de09b4b9ea790 Mon Sep 17 00:00:00 2001 From: Simeon Keske Date: Wed, 4 Mar 2020 22:30:24 +0100 Subject: [PATCH 4/9] show the room presence indicator, even when cross-singing is enabled --- src/components/views/rooms/RoomTile.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index a07c81eb21..3245cdb779 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -491,15 +491,15 @@ export default createReactClass({ alt="dm" />; - const { room } = this.props; - const member = room.getMember(dmUserId); - if ( - member && member.membership === "join" && room.getJoinedMemberCount() === 2 && - SettingsStore.isFeatureEnabled("feature_presence_in_room_list") - ) { - const UserOnlineDot = sdk.getComponent('rooms.UserOnlineDot'); - dmOnline = ; - } + } + const { room } = this.props; + const member = room.getMember(dmUserId); + if ( + member && member.membership === "join" && room.getJoinedMemberCount() === 2 && + SettingsStore.isFeatureEnabled("feature_presence_in_room_list") + ) { + const UserOnlineDot = sdk.getComponent('rooms.UserOnlineDot'); + dmOnline = ; } // The following labels are written in such a fashion to increase screen reader efficiency (speed). From cf1d9cc8b5ff65cc127510a310ad0585c1c1dfba Mon Sep 17 00:00:00 2001 From: Simeon Keske Date: Wed, 4 Mar 2020 22:46:07 +0100 Subject: [PATCH 5/9] make the linter happy --- src/components/views/rooms/RoomTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 3245cdb779..e1624602f1 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -490,8 +490,8 @@ export default createReactClass({ height="13" alt="dm" />; - } + const { room } = this.props; const member = room.getMember(dmUserId); if ( From 74fcb103b1d11a408a44a144c1850624904f0f2f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 5 Mar 2020 11:04:33 -0700 Subject: [PATCH 6/9] Link to the right contributing guidelines --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fbed22030..d6fd6db1b7 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ All code lands on the `develop` branch - `master` is only used for stable releas **Please file PRs against `develop`!!** Please follow the standard Matrix contributor's guide: -https://github.com/matrix-org/synapse/tree/master/CONTRIBUTING.rst +https://github.com/matrix-org/matrix-js-sdk/blob/develop/CONTRIBUTING.rst Please follow the Matrix JS/React code style as per: https://github.com/matrix-org/matrix-react-sdk/blob/master/code_style.md From a7de5753160ecf1cc657a963493131f386e655d3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 6 Mar 2020 16:50:39 +0100 Subject: [PATCH 7/9] use crypto.verification.request even when xsign is disabled --- src/components/structures/MatrixChat.js | 41 +++++++++++++------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index bc11e66d2c..e4af503b46 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1495,26 +1495,29 @@ export default createReactClass({ } }); - if (SettingsStore.isFeatureEnabled("feature_cross_signing")) { - cli.on("crypto.verification.request", request => { - if (request.pending) { - ToastStore.sharedInstance().addOrReplaceToast({ - key: 'verifreq_' + request.channel.transactionId, - title: _t("Verification Request"), - icon: "verification", - props: {request}, - component: sdk.getComponent("toasts.VerificationRequestToast"), - }); - } - }); - } else { - cli.on("crypto.verification.start", (verifier) => { - const IncomingSasDialog = sdk.getComponent("views.dialogs.IncomingSasDialog"); - Modal.createTrackedDialog('Incoming Verification', '', IncomingSasDialog, { - verifier, + cli.on("crypto.verification.request", request => { + const isFlagOn = SettingsStore.isFeatureEnabled("feature_cross_signing"); + + if (!isFlagOn && !request.channel.deviceId) { + request.cancel({code: "m.invalid_message", reason: "This client has cross-signing disabled"}); + return; + } + + if (request.pending) { + ToastStore.sharedInstance().addOrReplaceToast({ + key: 'verifreq_' + request.channel.transactionId, + title: _t("Verification Request"), + icon: "verification", + props: {request}, + component: sdk.getComponent("toasts.VerificationRequestToast"), + }); + } else if (request.started) { + const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog"); + Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, { + verificationRequest: request, }, null, /* priority = */ false, /* static = */ true); - }); - } + } + }); // Fire the tinter right on startup to ensure the default theme is applied // A later sync can/will correct the tint to be the right value for the user const colorScheme = SettingsStore.getValue("roomColor"); From f8ef5bb6a58a95969dfd181a6e997f882ce28514 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 6 Mar 2020 17:20:08 +0100 Subject: [PATCH 8/9] check .started first as it can be both .started and pending --- src/components/structures/MatrixChat.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index e4af503b46..87b0f6773f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1503,7 +1503,12 @@ export default createReactClass({ return; } - if (request.pending) { + if (request.started) { + const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog"); + Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, { + verificationRequest: request, + }, null, /* priority = */ false, /* static = */ true); + } else if (request.pending) { ToastStore.sharedInstance().addOrReplaceToast({ key: 'verifreq_' + request.channel.transactionId, title: _t("Verification Request"), @@ -1511,11 +1516,6 @@ export default createReactClass({ props: {request}, component: sdk.getComponent("toasts.VerificationRequestToast"), }); - } else if (request.started) { - const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog"); - Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, { - verificationRequest: request, - }, null, /* priority = */ false, /* static = */ true); } }); // Fire the tinter right on startup to ensure the default theme is applied From b0617f10e82a5c60258846e69b97abb877c49e63 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 6 Mar 2020 17:22:56 +0100 Subject: [PATCH 9/9] stick to IncomingSasDialog as VerificationRequestDialog doesn't show sender yet, makes e2e tests fail --- src/components/structures/MatrixChat.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 87b0f6773f..a0b9a8fe57 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1503,10 +1503,10 @@ export default createReactClass({ return; } - if (request.started) { - const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog"); - Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, { - verificationRequest: request, + if (request.verifier) { + const IncomingSasDialog = sdk.getComponent("views.dialogs.IncomingSasDialog"); + Modal.createTrackedDialog('Incoming Verification', '', IncomingSasDialog, { + verifier: request.verifier, }, null, /* priority = */ false, /* static = */ true); } else if (request.pending) { ToastStore.sharedInstance().addOrReplaceToast({