From eee6a509c7dbf62929780df6c69af4ff787fe630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 30 Jan 2021 08:04:25 +0100 Subject: [PATCH 01/14] Close button should always close the panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/RightPanel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 41f4d83743..7927e9d0e5 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -260,7 +260,7 @@ export default class RightPanel extends React.Component { user={this.state.member} room={this.props.room} key={roomId || this.state.member.userId} - onClose={this.onCloseUserInfo} + onClose={this.onClose} phase={this.state.phase} verificationRequest={this.state.verificationRequest} verificationRequestPromise={this.state.verificationRequestPromise} @@ -276,7 +276,7 @@ export default class RightPanel extends React.Component { user={this.state.member} groupId={this.props.groupId} key={this.state.member.userId} - onClose={this.onCloseUserInfo} />; + onClose={this.onClose} />; break; case RightPanelPhases.GroupRoomInfo: From 4cf03e4c104ef6aa9d748ab3ca70dcbd455ef96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 30 Jan 2021 08:51:26 +0100 Subject: [PATCH 02/14] Added optional refireParams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/right_panel/BaseCard.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/right_panel/BaseCard.tsx b/src/components/views/right_panel/BaseCard.tsx index 5927c7c3cc..09973809de 100644 --- a/src/components/views/right_panel/BaseCard.tsx +++ b/src/components/views/right_panel/BaseCard.tsx @@ -33,6 +33,7 @@ interface IProps { previousPhase?: RightPanelPhases; closeLabel?: string; onClose?(): void; + refireParams?; } interface IGroupProps { @@ -56,6 +57,7 @@ const BaseCard: React.FC = ({ withoutScrollContainer, previousPhase, children, + refireParams, }) => { let backButton; if (previousPhase) { @@ -63,6 +65,7 @@ const BaseCard: React.FC = ({ defaultDispatcher.dispatch({ action: Action.SetRightPanelPhase, phase: previousPhase, + refireParams: refireParams, }); }; backButton = ; From 1360f551ceff501adff9c8aebcea560b107d8548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 30 Jan 2021 08:54:08 +0100 Subject: [PATCH 03/14] Back button should send you to member info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/right_panel/UserInfo.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index cdb4c43b09..70c22859e2 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -1560,9 +1560,13 @@ const UserInfo: React.FC = ({ break; } + let refireParams; let previousPhase: RightPanelPhases; // We have no previousPhase for when viewing a UserInfo from a Group or without a Room at this time - if (room) { + if (room && phase === RightPanelPhases.EncryptionPanel) { + previousPhase = RightPanelPhases.RoomMemberInfo; + refireParams = {member: member}; + } else if (room) { previousPhase = RightPanelPhases.RoomMemberList; } @@ -1581,6 +1585,7 @@ const UserInfo: React.FC = ({ onClose={onClose} closeLabel={closeLabel} previousPhase={previousPhase} + refireParams={refireParams} > { content } ; From 73ab07421909da2f88eb9d9c68fdd13326909d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 30 Jan 2021 09:38:10 +0100 Subject: [PATCH 04/14] Properly handle closing the panel while verifying MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/RightPanel.js | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 7927e9d0e5..4ebd16e1c1 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -186,7 +186,7 @@ export default class RightPanel extends React.Component { } } - onCloseUserInfo = () => { + onClose = () => { // XXX: There are three different ways of 'closing' this panel depending on what state // things are in... this knows far more than it should do about the state of the rest // of the app and is generally a bit silly. @@ -198,31 +198,21 @@ export default class RightPanel extends React.Component { dis.dispatch({ action: "view_home_page", }); - } else if (this.state.phase === RightPanelPhases.EncryptionPanel && + } else if ( + this.state.phase === RightPanelPhases.EncryptionPanel && this.state.verificationRequest && this.state.verificationRequest.pending ) { // When the user clicks close on the encryption panel cancel the pending request first if any this.state.verificationRequest.cancel(); } else { - // Otherwise we have got our user from RoomViewStore which means we're being shown - // within a room/group, so go back to the member panel if we were in the encryption panel, - // or the member list if we were in the member panel... phew. - const isEncryptionPhase = this.state.phase === RightPanelPhases.EncryptionPanel; - dis.dispatch({ - action: Action.ViewUser, - member: isEncryptionPhase ? this.state.member : null, + // the RightPanelStore has no way of knowing which mode room/group it is in, so we handle closing here + defaultDispatcher.dispatch({ + action: Action.ToggleRightPanel, + type: this.props.groupId ? "group" : "room", }); } }; - onClose = () => { - // the RightPanelStore has no way of knowing which mode room/group it is in, so we handle closing here - defaultDispatcher.dispatch({ - action: Action.ToggleRightPanel, - type: this.props.groupId ? "group" : "room", - }); - }; - render() { const MemberList = sdk.getComponent('rooms.MemberList'); const UserInfo = sdk.getComponent('right_panel.UserInfo'); From 8a50b7bcbb2954e2ca7da63cbdace0fcdd87e36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 30 Jan 2021 10:08:38 +0100 Subject: [PATCH 05/14] Properly handle closing encryption panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/right_panel/UserInfo.tsx | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 70c22859e2..a4b5cd0fbb 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -60,6 +60,7 @@ import QuestionDialog from "../dialogs/QuestionDialog"; import ConfirmUserActionDialog from "../dialogs/ConfirmUserActionDialog"; import InfoDialog from "../dialogs/InfoDialog"; import { EventType } from "matrix-js-sdk/src/@types/event"; +import {SetRightPanelPhasePayload} from "../../../dispatcher/payloads/SetRightPanelPhasePayload"; interface IDevice { deviceId: string; @@ -1534,6 +1535,24 @@ const UserInfo: React.FC = ({ const classes = ["mx_UserInfo"]; + let refireParams; + let previousPhase: RightPanelPhases; + // We have no previousPhase for when viewing a UserInfo from a Group or without a Room at this time + if (room && phase === RightPanelPhases.EncryptionPanel) { + previousPhase = RightPanelPhases.RoomMemberInfo; + refireParams = {member: member}; + } else if (room) { + previousPhase = RightPanelPhases.RoomMemberList; + } + + const onEncryptionPanelClose = () => { + dis.dispatch({ + action: Action.SetRightPanelPhase, + phase: previousPhase, + refireParams: refireParams, + }); + } + let content; switch (phase) { case RightPanelPhases.RoomMemberInfo: @@ -1553,23 +1572,13 @@ const UserInfo: React.FC = ({ } member={member} - onClose={onClose} + onClose={onEncryptionPanelClose} isRoomEncrypted={isRoomEncrypted} /> ); break; } - let refireParams; - let previousPhase: RightPanelPhases; - // We have no previousPhase for when viewing a UserInfo from a Group or without a Room at this time - if (room && phase === RightPanelPhases.EncryptionPanel) { - previousPhase = RightPanelPhases.RoomMemberInfo; - refireParams = {member: member}; - } else if (room) { - previousPhase = RightPanelPhases.RoomMemberList; - } - let closeLabel = undefined; if (phase === RightPanelPhases.EncryptionPanel) { const verificationRequest = (props as React.ComponentProps).verificationRequest; From 9b54aba4c06eab89b494a777c8a77e3f14edd948 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sun, 31 Jan 2021 11:11:34 +0100 Subject: [PATCH 06/14] fix timestamp width if there is a 2e2 indicator bar Signed-off-by: Michael Weimann --- res/css/_common.scss | 5 +++++ res/css/views/rooms/_EventTile.scss | 9 ++++----- res/css/views/rooms/_GroupLayout.scss | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/res/css/_common.scss b/res/css/_common.scss index 87336a1c03..6e9d252659 100644 --- a/res/css/_common.scss +++ b/res/css/_common.scss @@ -21,6 +21,11 @@ limitations under the License. $hover-transition: 0.08s cubic-bezier(.46, .03, .52, .96); // quadratic +$EventTile_e2e_state_indicator_width: 4px; + +$MessageTimestamp_width: 46px; /* 8 + 30 (avatar) + 8 */ +$MessageTimestamp_width_hover: calc($MessageTimestamp_width - 2 * $EventTile_e2e_state_indicator_width); + :root { font-size: 10px; } diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 429ac7ed4b..92b218e937 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -421,15 +421,15 @@ $left-gutter: 64px; } .mx_EventTile:hover.mx_EventTile_verified .mx_EventTile_line { - border-left: $e2e-verified-color 4px solid; + border-left: $e2e-verified-color $EventTile_e2e_state_indicator_width solid; } .mx_EventTile:hover.mx_EventTile_unverified .mx_EventTile_line { - border-left: $e2e-unverified-color 4px solid; + border-left: $e2e-unverified-color $EventTile_e2e_state_indicator_width solid; } .mx_EventTile:hover.mx_EventTile_unknown .mx_EventTile_line { - border-left: $e2e-unknown-color 4px solid; + border-left: $e2e-unknown-color $EventTile_e2e_state_indicator_width solid; } .mx_EventTile:hover.mx_EventTile_verified.mx_EventTile_info .mx_EventTile_line, @@ -447,8 +447,7 @@ $left-gutter: 64px; .mx_EventTile:hover.mx_EventTile_verified .mx_EventTile_line > a > .mx_MessageTimestamp, .mx_EventTile:hover.mx_EventTile_unverified .mx_EventTile_line > a > .mx_MessageTimestamp, .mx_EventTile:hover.mx_EventTile_unknown .mx_EventTile_line > a > .mx_MessageTimestamp { - left: 3px; - width: auto; + width: $MessageTimestamp_width_hover; } // Explicit relationships so that it doesn't apply to nested EventTile components (e.g in Replies) diff --git a/res/css/views/rooms/_GroupLayout.scss b/res/css/views/rooms/_GroupLayout.scss index 50ef50110f..543e6ed685 100644 --- a/res/css/views/rooms/_GroupLayout.scss +++ b/res/css/views/rooms/_GroupLayout.scss @@ -34,7 +34,7 @@ $left-gutter: 64px; .mx_MessageTimestamp { position: absolute; - width: 46px; /* 8 + 30 (avatar) + 8 */ + width: $MessageTimestamp_width; } .mx_EventTile_line, .mx_EventTile_reply { From eee9cf153ba4b8627538175331a7a019cdeec029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 3 Feb 2021 08:15:59 +0100 Subject: [PATCH 07/14] Fix trash alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/messages/_RedactedBody.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/messages/_RedactedBody.scss b/res/css/views/messages/_RedactedBody.scss index e4ab0c0835..600ac0c6b7 100644 --- a/res/css/views/messages/_RedactedBody.scss +++ b/res/css/views/messages/_RedactedBody.scss @@ -30,7 +30,7 @@ limitations under the License. mask-size: contain; content: ''; position: absolute; - top: 2px; + top: 1px; left: 0; } } From 9a131efc1a83d90eb0c16b8e99d8dec727ffd713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 3 Feb 2021 08:16:07 +0100 Subject: [PATCH 08/14] Fix avatar alignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/rooms/_EventTile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index acf3049804..12cba5b89d 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -37,7 +37,7 @@ $left-gutter: 64px; } .mx_EventTile.mx_EventTile_info .mx_EventTile_avatar { - top: $font-8px; + top: $font-5px; left: $left-gutter; } From b8ee23cdf4797008f9f9c6fab14f40be6c7e08e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 3 Feb 2021 18:41:09 +0100 Subject: [PATCH 09/14] Make consistent for all events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/views/rooms/_EventTile.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 12cba5b89d..2b3ddf9361 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -26,7 +26,7 @@ $left-gutter: 64px; } .mx_EventTile.mx_EventTile_info { - padding-top: 0px; + padding-top: 1px; } .mx_EventTile_avatar { @@ -37,7 +37,7 @@ $left-gutter: 64px; } .mx_EventTile.mx_EventTile_info .mx_EventTile_avatar { - top: $font-5px; + top: $font-6px; left: $left-gutter; } From 97584af9478d469096ba3d4afb30f8768b4b2624 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Feb 2021 02:50:54 -0700 Subject: [PATCH 10/14] Fix z-index of stickerpicker --- src/components/views/elements/PersistedElement.js | 6 +++++- src/components/views/rooms/Stickerpicker.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 07b01cb03f..3732f644b8 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -23,6 +23,7 @@ import ResizeObserver from 'resize-observer-polyfill'; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import {isNullOrUndefined} from "matrix-js-sdk/src/utils"; // Shamelessly ripped off Modal.js. There's probably a better way // of doing reusable widgets like dialog boxes & menus where we go and @@ -61,6 +62,9 @@ export default class PersistedElement extends React.Component { // Any PersistedElements with the same persistKey will use // the same DOM container. persistKey: PropTypes.string.isRequired, + + // z-index for the element. Defaults to 9. + zIndex: PropTypes.number, }; constructor() { @@ -165,7 +169,7 @@ export default class PersistedElement extends React.Component { const parentRect = parent.getBoundingClientRect(); Object.assign(child.style, { - zIndex: 9, + zIndex: isNullOrUndefined(this.props.zIndex) ? 9 : this.props.zIndex, position: 'absolute', top: parentRect.top + 'px', left: parentRect.left + 'px', diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 0b81f82721..5446d15671 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -264,7 +264,7 @@ export default class Stickerpicker extends React.Component { width: this.popoverWidth, }} > - + Date: Thu, 4 Feb 2021 02:50:54 -0700 Subject: [PATCH 11/14] Fix z-index of stickerpicker --- src/components/views/elements/PersistedElement.js | 6 +++++- src/components/views/rooms/Stickerpicker.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index 07b01cb03f..3732f644b8 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -23,6 +23,7 @@ import ResizeObserver from 'resize-observer-polyfill'; import dis from '../../../dispatcher/dispatcher'; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import {MatrixClientPeg} from "../../../MatrixClientPeg"; +import {isNullOrUndefined} from "matrix-js-sdk/src/utils"; // Shamelessly ripped off Modal.js. There's probably a better way // of doing reusable widgets like dialog boxes & menus where we go and @@ -61,6 +62,9 @@ export default class PersistedElement extends React.Component { // Any PersistedElements with the same persistKey will use // the same DOM container. persistKey: PropTypes.string.isRequired, + + // z-index for the element. Defaults to 9. + zIndex: PropTypes.number, }; constructor() { @@ -165,7 +169,7 @@ export default class PersistedElement extends React.Component { const parentRect = parent.getBoundingClientRect(); Object.assign(child.style, { - zIndex: 9, + zIndex: isNullOrUndefined(this.props.zIndex) ? 9 : this.props.zIndex, position: 'absolute', top: parentRect.top + 'px', left: parentRect.left + 'px', diff --git a/src/components/views/rooms/Stickerpicker.js b/src/components/views/rooms/Stickerpicker.js index 0b81f82721..5446d15671 100644 --- a/src/components/views/rooms/Stickerpicker.js +++ b/src/components/views/rooms/Stickerpicker.js @@ -264,7 +264,7 @@ export default class Stickerpicker extends React.Component { width: this.popoverWidth, }} > - + Date: Thu, 4 Feb 2021 12:04:27 +0000 Subject: [PATCH 12/14] Prepare changelog for v3.13.1 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d1595396b..43a1494497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +Changes in [3.13.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.13.1) (2021-02-04) +===================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.13.0...v3.13.1) + + * [Release] Fix z-index of stickerpicker + [\#5618](https://github.com/matrix-org/matrix-react-sdk/pull/5618) + Changes in [3.13.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.13.0) (2021-02-03) ===================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.13.0-rc.1...v3.13.0) From 0fe54deab15e87df2163192a3c436ca058fd70fa Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Thu, 4 Feb 2021 12:04:27 +0000 Subject: [PATCH 13/14] v3.13.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e32409fb7..65646ab711 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "3.13.0", + "version": "3.13.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From fdc78396fa4044627ac19a3f31cd45212c88ce57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 4 Feb 2021 16:53:25 +0100 Subject: [PATCH 14/14] Replaced defaultDis and removed duplicate import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/structures/RightPanel.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 4ebd16e1c1..d66049d3a5 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -30,7 +30,6 @@ import MatrixClientContext from "../../contexts/MatrixClientContext"; import {Action} from "../../dispatcher/actions"; import RoomSummaryCard from "../views/right_panel/RoomSummaryCard"; import WidgetCard from "../views/right_panel/WidgetCard"; -import defaultDispatcher from "../../dispatcher/dispatcher"; export default class RightPanel extends React.Component { static get propTypes() { @@ -206,7 +205,7 @@ export default class RightPanel extends React.Component { this.state.verificationRequest.cancel(); } else { // the RightPanelStore has no way of knowing which mode room/group it is in, so we handle closing here - defaultDispatcher.dispatch({ + dis.dispatch({ action: Action.ToggleRightPanel, type: this.props.groupId ? "group" : "room", });