From b285315cb8a5566e444754784cd6c8df3f812b83 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 29 Sep 2021 11:16:41 +0100 Subject: [PATCH 1/4] Fix `ScrollPanel.isAtBottom` for non-standard DPI settings --- src/components/structures/ScrollPanel.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 2eae585f4f..563686cee4 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -277,8 +277,15 @@ export default class ScrollPanel extends React.Component { // fractional values (both too big and too small) // for scrollTop happen on certain browsers/platforms // when scrolled all the way down. E.g. Chrome 72 on debian. - // so check difference <= 1; - return Math.abs(sn.scrollHeight - (sn.scrollTop + sn.clientHeight)) <= 1; + // + // We therefore leave a bit of wiggle-room and assume we're at the + // bottom if the unscrolled area is less than one pixel high. + // + // non-standard DPI settings also seem to have effect here and can + // actually lead to scrollTop+clientHeight being *larger* than + // scrollHeight. (observed in element-desktop on Ubuntu 20.04) + // + return sn.scrollHeight - (sn.scrollTop + sn.clientHeight) <= 1; }; // returns the vertical height in the given direction that can be removed from From c99216814f141202a766b041e467c9d124d938ef Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 29 Sep 2021 11:20:51 +0100 Subject: [PATCH 2/4] fix lint --- src/components/structures/ScrollPanel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 563686cee4..0ea070627a 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -284,7 +284,7 @@ export default class ScrollPanel extends React.Component { // non-standard DPI settings also seem to have effect here and can // actually lead to scrollTop+clientHeight being *larger* than // scrollHeight. (observed in element-desktop on Ubuntu 20.04) - // + // return sn.scrollHeight - (sn.scrollTop + sn.clientHeight) <= 1; }; From 842ab0af05f8f83e92b4bec80fd056fe8440b1e4 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Wed, 29 Sep 2021 11:18:15 +0100 Subject: [PATCH 3/4] Remove extra 'are' in README Signed-off-by: Andy Balaam --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67e5e12f59..4588a0586e 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Code should be committed as follows: * CSS: https://github.com/matrix-org/matrix-react-sdk/tree/master/res/css * Theme specific CSS & resources: https://github.com/matrix-org/matrix-react-sdk/tree/master/res/themes -React components in matrix-react-sdk are come in two different flavours: +React components in matrix-react-sdk come in two different flavours: 'structures' and 'views'. Structures are stateful components which handle the more complicated business logic of the app, delegating their actual presentation rendering to stateless 'view' components. For instance, the RoomView component From af8c07a69b5e65e7f10cfd5943f2605a6d7496d6 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 29 Sep 2021 11:45:27 +0100 Subject: [PATCH 4/4] Ensure that sub-spaces aren't considered for notification badges --- src/stores/SpaceStore.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index d440c33c83..ea482ffb9b 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -595,7 +595,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { // Update NotificationStates this.getNotificationState(s).setRooms(visibleRooms.filter(room => { - if (!roomIds.has(room.roomId)) return false; + if (!roomIds.has(room.roomId) || room.isSpaceRoom()) return false; if (DMRoomMap.shared().getUserIdForRoomId(room.roomId)) { return s === HOME_SPACE;