From ed2eca52b23d83c43e46bd94a9c51d8c1113a363 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Wed, 3 Jun 2020 18:05:40 -0500 Subject: [PATCH 01/11] Don't show FormatBar if composer is empty Signed-off-by: Aaron Raimist --- src/components/views/rooms/BasicMessageComposer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index ba1be6a125..82f61e0e1f 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -359,6 +359,8 @@ export default class BasicMessageEditor extends React.Component { } _onSelectionChange = () => { + const {isEmpty} = this.props.model; + this._refreshLastCaretIfNeeded(); const selection = document.getSelection(); if (this._hasTextSelected && selection.isCollapsed) { @@ -366,7 +368,7 @@ export default class BasicMessageEditor extends React.Component { if (this._formatBarRef) { this._formatBarRef.hide(); } - } else if (!selection.isCollapsed) { + } else if (!selection.isCollapsed && !isEmpty) { this._hasTextSelected = true; if (this._formatBarRef) { const selectionRect = selection.getRangeAt(0).getBoundingClientRect(); From f4f23dba04493cba9b82d69f3823e1ec65eba9ad Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 5 Jun 2020 10:53:00 +0100 Subject: [PATCH 02/11] Fix compact layout regression Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- res/css/views/rooms/_GroupLayout.scss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/res/css/views/rooms/_GroupLayout.scss b/res/css/views/rooms/_GroupLayout.scss index af12cce5d6..de4a5538cd 100644 --- a/res/css/views/rooms/_GroupLayout.scss +++ b/res/css/views/rooms/_GroupLayout.scss @@ -18,7 +18,6 @@ limitations under the License. $left-gutter: 65px; .mx_GroupLayout { - .mx_EventTile { > .mx_SenderProfile { line-height: $font-17px; @@ -53,14 +52,14 @@ $left-gutter: 65px; /* Compact layout overrides */ .mx_MatrixChat_useCompactLayout { - .mx_EventTile_line, .mx_EventTile_reply { - padding-top: 0px; - padding-bottom: 0px; - } - .mx_EventTile { padding-top: 4px; + .mx_EventTile_line, .mx_EventTile_reply { + padding-top: 0; + padding-bottom: 0; + } + &.mx_EventTile_info { // same as the padding for non-compact .mx_EventTile.mx_EventTile_info padding-top: 0px; From 0dc788eaa701ed5fbf9d13867a9879e6e6e37e76 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 5 Jun 2020 10:53:00 +0100 Subject: [PATCH 03/11] Fix compact layout regression Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> (cherry picked from commit f4f23dba04493cba9b82d69f3823e1ec65eba9ad) --- res/css/views/rooms/_GroupLayout.scss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/res/css/views/rooms/_GroupLayout.scss b/res/css/views/rooms/_GroupLayout.scss index af12cce5d6..de4a5538cd 100644 --- a/res/css/views/rooms/_GroupLayout.scss +++ b/res/css/views/rooms/_GroupLayout.scss @@ -18,7 +18,6 @@ limitations under the License. $left-gutter: 65px; .mx_GroupLayout { - .mx_EventTile { > .mx_SenderProfile { line-height: $font-17px; @@ -53,14 +52,14 @@ $left-gutter: 65px; /* Compact layout overrides */ .mx_MatrixChat_useCompactLayout { - .mx_EventTile_line, .mx_EventTile_reply { - padding-top: 0px; - padding-bottom: 0px; - } - .mx_EventTile { padding-top: 4px; + .mx_EventTile_line, .mx_EventTile_reply { + padding-top: 0; + padding-bottom: 0; + } + &.mx_EventTile_info { // same as the padding for non-compact .mx_EventTile.mx_EventTile_info padding-top: 0px; From ab9284fcedcdf0311f06740091abd9394ab58045 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Jun 2020 13:47:43 -0600 Subject: [PATCH 04/11] Fix not being able to dismiss new login toasts `toastKey` is a thing. Fixes https://github.com/vector-im/riot-web/issues/13923 (cherry picked from commit c667ea69afba22620e0add944bdf0b4c22a5a184) --- src/toasts/UnverifiedSessionToast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toasts/UnverifiedSessionToast.ts b/src/toasts/UnverifiedSessionToast.ts index 635356b9db..9dedd2b137 100644 --- a/src/toasts/UnverifiedSessionToast.ts +++ b/src/toasts/UnverifiedSessionToast.ts @@ -66,5 +66,5 @@ export const showToast = (deviceId: string) => { }; export const hideToast = (deviceId: string) => { - ToastStore.sharedInstance().dismissToast(deviceId); + ToastStore.sharedInstance().dismissToast(toastKey(deviceId)); }; From e78fa602c03bc375fe8211e4c935007a601a2cff Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 5 Jun 2020 15:13:55 +0100 Subject: [PATCH 05/11] Upgrade matrix-js-sdk to 6.2.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bc009f3c15..ad1c31187a 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "6.2.0", + "matrix-js-sdk": "6.2.1", "minimist": "^1.2.0", "pako": "^1.0.5", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index 1ed5f82369..5d9516507f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5801,10 +5801,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.2.0.tgz#b1aa6f23858ab3ee4b66be25d3e854f6e287d36b" - integrity sha512-dpx1EuJ98HtqE2YUeliTe9xjMOJlicJGRXa06Gr8RAL6WJM7buPgodOk0tRs461LzeilxmymqcGaB4og6o9RxA== +matrix-js-sdk@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.2.1.tgz#d5f76491a650c0a36fcdd078cff59f2da96edd7b" + integrity sha512-X12Y2SMg8MOJwE5P3VMsMV/mnQHOmyJkF+FZRida124w4B4tBJouaNxteYyYaH34w+wyaKGxuqEBXecfSpfvbw== dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 93ed062900d6b25ebcc435fc80b17e6f0d47446d Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 4 Jun 2020 17:54:18 +0100 Subject: [PATCH 06/11] Fix exceptions from Tooltip renderTooltip was not a bound function and so was failing to find the parent when called from the 'scroll' event listener because 'this' was the window object rather than the Tooltip object. Unsure at what point this broke - I assumed it was in thr recent typescript conversion but it looks like it would have had the same problem before. (cherry picked from commit 5e569d75b641c68e973f123f1fea6c633ba1247d) --- src/components/views/elements/Tooltip.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/Tooltip.tsx b/src/components/views/elements/Tooltip.tsx index 133b0ecf58..38960d1a58 100644 --- a/src/components/views/elements/Tooltip.tsx +++ b/src/components/views/elements/Tooltip.tsx @@ -94,7 +94,7 @@ export default class Tooltip extends React.Component { return style; } - private renderTooltip() { + private renderTooltip = () => { // Add the parent's position to the tooltips, so it's correctly // positioned, also taking into account any window zoom // NOTE: The additional 6 pixels for the left position, is to take account of the From 94059b85240b70d5a40c7e3cd62f2ade109d7d72 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 5 Jun 2020 15:43:23 +0100 Subject: [PATCH 07/11] Prepare changelog for v2.7.1 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89b20de919..63702de38b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,20 @@ +Changes in [2.7.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.7.1) (2020-06-05) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.7.0...v2.7.1) + + * Upgrade to JS SDK 6.2.1 + * Fix exceptions from Tooltip + [\#4716](https://github.com/matrix-org/matrix-react-sdk/pull/4716) + * Fix not being able to dismiss new login toasts + [\#4715](https://github.com/matrix-org/matrix-react-sdk/pull/4715) + * Fix compact layout regression + [\#4714](https://github.com/matrix-org/matrix-react-sdk/pull/4714) + Changes in [2.7.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v2.7.0) (2020-06-04) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v2.7.0-rc.2...v2.7.0) + * Upgrade to JS SDK 6.2.0 * Prevent (double) 4S bootstrap from RestoreKeyBackupDialog [\#4703](https://github.com/matrix-org/matrix-react-sdk/pull/4703) * Fix checkbox bleed From c8366b7a47a61192612424764b3feab01d2aa473 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 5 Jun 2020 15:43:24 +0100 Subject: [PATCH 08/11] v2.7.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad1c31187a..e596a643a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "2.7.0", + "version": "2.7.1", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": { From d54308a8c6385a6374187d041b1259755a7dac2a Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Fri, 5 Jun 2020 15:48:06 +0100 Subject: [PATCH 09/11] Reset matrix-js-sdk back to develop branch --- package.json | 2 +- yarn.lock | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index e596a643a6..69fe175d72 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "is-ip": "^2.0.0", "linkifyjs": "^2.1.6", "lodash": "^4.17.14", - "matrix-js-sdk": "6.2.1", + "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", "minimist": "^1.2.0", "pako": "^1.0.5", "parse5": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index ddacd2658d..475c0fda2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3155,15 +3155,15 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emojibase-data@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/emojibase-data/-/emojibase-data-5.0.1.tgz#ce6fe36b4affd3578e0be8779211018a2fdae960" - integrity sha512-rYWlogJ2q5P78U8Xx1vhsXHcYKu1wFnr7+o6z9QHssZ1SsJLTCkJINZIPHRFWuDreAUK457TkqHpdOXElu0fzA== +emojibase-data@^4.0.2: + version "4.2.1" + resolved "https://registry.yarnpkg.com/emojibase-data/-/emojibase-data-4.2.1.tgz#3d1f0c69ddbb2ca7b7014f5e34654190802a40df" + integrity sha512-O0vxoPMgVkRq/uII/gdAjz9RwNv6ClJrd3J9QCCRC4btZRmeut/qohC/Fi+NNXUcjY08RWNTvxSnq/vij8hvrw== -emojibase-regex@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/emojibase-regex/-/emojibase-regex-4.0.1.tgz#a2cd4bbb42825422da9ec72f15e970bc2c90b46a" - integrity sha512-S42UHkFfz15i4NNz+wi9iMKFo+B6Kalc6PJLpYX0BUANViXw4vSyYZMFdBGRLduSabWHuEcTLZl9xOa2YP3eJw== +emojibase-regex@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/emojibase-regex/-/emojibase-regex-3.2.1.tgz#122935958c9a49c96bb29ac69ccbbac0b2e7022d" + integrity sha512-VAX2Rc2U/alu5q6P2cET2alzC63o1Uarm6Ea/b3ab+KOzxZT4JKmB0tCU1sTZvfNKa16KMLCK2k7hJBHJq4vWQ== emojis-list@^2.0.0: version "2.1.0" @@ -5801,10 +5801,9 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@6.2.1: +"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "6.2.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.2.1.tgz#d5f76491a650c0a36fcdd078cff59f2da96edd7b" - integrity sha512-X12Y2SMg8MOJwE5P3VMsMV/mnQHOmyJkF+FZRida124w4B4tBJouaNxteYyYaH34w+wyaKGxuqEBXecfSpfvbw== + resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/ebe66bdd6e0f6edbc60be1612c5a1fc0c9ea092c" dependencies: "@babel/runtime" "^7.8.3" another-json "^0.2.0" From 51038b0c02d934ae14a94fddeb9d889acdc8d6d0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 5 Jun 2020 11:03:18 -0600 Subject: [PATCH 10/11] Replace math hacks with temporary placeholder --- src/components/views/rooms/RoomSublist2.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index e20a36d6ce..dd0d591c53 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -222,11 +222,8 @@ export default class RoomSublist2 extends React.Component { handles = []; // no handles, we're at a minimum } - // TODO: Remove Math hacks - let nVisible = Math.floor(layout.visibleTiles); - if (localStorage.getItem("mx_rl_mathfn")) { - nVisible = Math[localStorage.getItem("mx_rl_mathfn")](layout.visibleTiles); - } + // TODO: This might need adjustment, however for now it is fine as a round. + const nVisible = Math.round(layout.visibleTiles); const visibleTiles = tiles.slice(0, nVisible); // If we're hiding rooms, show a 'show more' button to the user. This button @@ -242,6 +239,7 @@ export default class RoomSublist2 extends React.Component { // TODO: CSS TBD // TODO: Make this an actual tile + // TODO: This is likely to pop out of the list, consider that. visibleTiles.splice(visibleTiles.length - 1, 1, (
Date: Fri, 5 Jun 2020 13:14:44 -0600 Subject: [PATCH 11/11] Minor clarity --- src/components/views/rooms/RoomSublist2.tsx | 1 + src/stores/room-list/ListLayout.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index dd0d591c53..d3bb19729d 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -235,6 +235,7 @@ export default class RoomSublist2 extends React.Component { // we have a cutoff condition - add the button to show all // we +1 to account for the room we're about to hide with our 'show more' button + // this results in the button always being 1+, and not needing an i18n `count`. const numMissing = (tiles.length - visibleTiles.length) + 1; // TODO: CSS TBD diff --git a/src/stores/room-list/ListLayout.ts b/src/stores/room-list/ListLayout.ts index fd57a03ca1..b41d56be3e 100644 --- a/src/stores/room-list/ListLayout.ts +++ b/src/stores/room-list/ListLayout.ts @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { TagID } from "./models"; + const TILE_HEIGHT_PX = 34; interface ISerializedListLayout { @@ -23,7 +25,7 @@ interface ISerializedListLayout { export class ListLayout { private _n = 0; - constructor(public readonly tagId) { + constructor(public readonly tagId: TagID) { const serialized = localStorage.getItem(this.key); if (serialized) { // We don't use the setters as they cause writes.