From 107eb974d43fb6af795a9af20df6eb15c8bcf985 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 14 Feb 2019 13:28:22 +0100 Subject: [PATCH 01/11] always rerender as not all state that goes into rendering comes from state or props, we shouldn't be blocking rendering at all This might rerender a few times more, but it shouldn't be worse than what was there before the redesigned roomlist. --- src/components/views/elements/LazyRenderList.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/components/views/elements/LazyRenderList.js b/src/components/views/elements/LazyRenderList.js index 1c1cc127d6..d7d2a0ab99 100644 --- a/src/components/views/elements/LazyRenderList.js +++ b/src/components/views/elements/LazyRenderList.js @@ -73,12 +73,6 @@ export default class LazyRenderList extends React.Component { } } - shouldComponentUpdate(nextProps, nextState) { - const itemsChanged = nextProps.items !== this.props.items; - const rangeChanged = nextState.renderRange !== this.state.renderRange; - return itemsChanged || rangeChanged; - } - render() { const {itemHeight, items, renderItem} = this.props; From e5e355ed2d2140f72c54eb0ba351c918b54d1cc3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 14 Feb 2019 12:35:09 +0000 Subject: [PATCH 02/11] Remove the white screen of welcome If there's no home page configured, view the first room. --- src/components/structures/LoggedInView.js | 13 ++-------- src/components/structures/MatrixChat.js | 7 ++++- src/utils/pages.js | 31 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 src/utils/pages.js diff --git a/src/components/structures/LoggedInView.js b/src/components/structures/LoggedInView.js index 2303083d98..2e1b91fe0e 100644 --- a/src/components/structures/LoggedInView.js +++ b/src/components/structures/LoggedInView.js @@ -31,6 +31,7 @@ import sessionStore from '../../stores/SessionStore'; import MatrixClientPeg from '../../MatrixClientPeg'; import SettingsStore from "../../settings/SettingsStore"; import RoomListStore from "../../stores/RoomListStore"; +import { getHomePageUrl } from '../../utils/pages'; import TagOrderActions from '../../actions/TagOrderActions'; import RoomListActions from '../../actions/RoomListActions'; @@ -459,17 +460,7 @@ const LoggedInView = React.createClass({ case PageTypes.HomePage: { - const pagesConfig = this.props.config.embeddedPages; - let pageUrl = null; - if (pagesConfig) { - pageUrl = pagesConfig.homeUrl; - } - if (!pageUrl) { - // This is a deprecated config option for the home page - // (despite the name, given we also now have a welcome - // page, which is not the same). - pageUrl = this.props.config.welcomePageUrl; - } + const pageUrl = getHomePageUrl(this.props.config); pageElement = { + dis.dispatch({action: 'view_next_room'}); + }); } } }, diff --git a/src/utils/pages.js b/src/utils/pages.js new file mode 100644 index 0000000000..d63ca3f2c7 --- /dev/null +++ b/src/utils/pages.js @@ -0,0 +1,31 @@ +/* +Copyright 2019 New Vector Ltd + +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. +*/ + +export function getHomePageUrl(appConfig) { + const pagesConfig = appConfig.embeddedPages; + let pageUrl = null; + if (pagesConfig) { + pageUrl = pagesConfig.homeUrl; + } + if (!pageUrl) { + // This is a deprecated config option for the home page + // (despite the name, given we also now have a welcome + // page, which is not the same). + pageUrl = appConfig.welcomePageUrl; + } + + return pageUrl; +} From b242d03f7ff1a8ba54894a43d4f473bf9fda08bd Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 14 Feb 2019 12:52:38 +0000 Subject: [PATCH 03/11] lint --- src/components/structures/MatrixChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 3ac987d078..8bc1fbdd07 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1199,7 +1199,7 @@ export default React.createClass({ } else { if (MatrixClientPeg.get().isGuest()) { dis.dispatch({action: 'view_welcome_page'}); - } else if (getHomePageUrl(this.props.config)){ + } else if (getHomePageUrl(this.props.config)) { dis.dispatch({action: 'view_home_page'}); } else { this.firstSyncPromise.promise.then(() => { From 790e752b7a4f0603406ec80e0324f925dbc559ec Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 14 Feb 2019 16:11:38 +0100 Subject: [PATCH 04/11] clear min-height on scroll --- src/components/structures/ScrollPanel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 1df5e876e8..25cccd2dd8 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -211,6 +211,12 @@ module.exports = React.createClass({ // forget what we wanted, so don't overwrite the saved state unless // this appears to be a user-initiated scroll. if (sn.scrollTop != this._lastSetScroll) { + // when scrolling, we don't care about disappearing typing notifs shrinking the timeline + // this might cause the scrollbar to resize in case the max-height was not correct + // but that's better than ending up with a lot of whitespace at the bottom of the timeline. + // we need to above check because when showing the typing notifs, an onScroll event is also triggered + this.clearBlockShrinking(); + this._saveScrollState(); } else { debuglog("Ignoring scroll echo"); From 9e260ad96b170654ddd3cb40a4b289bfa7d2bf67 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 14 Feb 2019 16:19:58 +0100 Subject: [PATCH 05/11] make sure we're at the bottom, although that seems to always be the case in this branch? --- src/components/structures/ScrollPanel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 25cccd2dd8..a1a7d08e0b 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -215,7 +215,9 @@ module.exports = React.createClass({ // this might cause the scrollbar to resize in case the max-height was not correct // but that's better than ending up with a lot of whitespace at the bottom of the timeline. // we need to above check because when showing the typing notifs, an onScroll event is also triggered - this.clearBlockShrinking(); + if (!this.isAtBottom()) { + this.clearBlockShrinking(); + } this._saveScrollState(); } else { From 89792459ffcb227d3f04761696c733c9c60e7a1c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 14 Feb 2019 16:51:45 +0100 Subject: [PATCH 06/11] fix close button being half off screen --- res/css/views/elements/_ImageView.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/res/css/views/elements/_ImageView.scss b/res/css/views/elements/_ImageView.scss index 9bf23b1025..52b6a63699 100644 --- a/res/css/views/elements/_ImageView.scss +++ b/res/css/views/elements/_ImageView.scss @@ -77,7 +77,8 @@ limitations under the License. .mx_ImageView_cancel { position: absolute; - top: 0px; + // hack for mx_Dialog having a top padding of 40px + top: 40px; right: 0px; padding: 35px; cursor: pointer; From 2a3b05a321a7ebcb1cae81e335fccda07d78ae41 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 15:52:13 +0000 Subject: [PATCH 07/11] Update help buoy text and issue links --- src/components/views/dialogs/RedesignFeedbackDialog.js | 10 ++++------ src/i18n/strings/en_EN.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/views/dialogs/RedesignFeedbackDialog.js b/src/components/views/dialogs/RedesignFeedbackDialog.js index c428aca16a..8f345bdd92 100644 --- a/src/components/views/dialogs/RedesignFeedbackDialog.js +++ b/src/components/views/dialogs/RedesignFeedbackDialog.js @@ -20,14 +20,12 @@ import { _t } from '../../../languageHandler'; export default (props) => { const existingIssuesUrl = "https://github.com/vector-im/riot-web/issues" + - "?q=is%3Aopen+is%3Aissue+label%3Aredesign+sort%3Areactions-%2B1-desc"; - const newIssueUrl = "https://github.com/vector-im/riot-web/issues/new" + - "?assignees=&labels=redesign&template=redesign_issue.md&title="; + "?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc"; + const newIssueUrl = "https://github.com/vector-im/riot-web/issues/new"; const description1 = - _t("Thanks for testing the Riot Redesign. " + - "If you run into any bugs or visual issues, " + - "please let us know on GitHub."); + _t("If you run into any bugs or have feedback you'd like to share, " + + "please let us know on GitHub."); const description2 = _t("To help avoid duplicate issues, " + "please view existing issues " + "first (and add a +1) or create a new issue " + diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index fe41beb7ae..74857e77e4 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1106,7 +1106,7 @@ "Manually export keys": "Manually export keys", "You'll lose access to your encrypted messages": "You'll lose access to your encrypted messages", "Are you sure you want to sign out?": "Are you sure you want to sign out?", - "Thanks for testing the Riot Redesign. If you run into any bugs or visual issues, please let us know on GitHub.": "Thanks for testing the Riot Redesign. If you run into any bugs or visual issues, please let us know on GitHub.", + "If you run into any bugs or have feedback you'd like to share, please let us know on GitHub.": "If you run into any bugs or have feedback you'd like to share, please let us know on GitHub.", "To help avoid duplicate issues, please view existing issues first (and add a +1) or create a new issue if you can't find it.": "To help avoid duplicate issues, please view existing issues first (and add a +1) or create a new issue if you can't find it.", "Report bugs & give feedback": "Report bugs & give feedback", "Go back": "Go back", From 84b53faf9e74b8bf37c48f4b9bb2a0f07ab761f9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 14 Feb 2019 17:00:47 +0100 Subject: [PATCH 08/11] make e2e icons on message transparent --- res/css/views/rooms/_EventTile.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index a8f34565b5..24a23a0f98 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -278,6 +278,10 @@ limitations under the License. /* End to end encryption stuff */ +.mx_EventTile_e2eIcon:hover { + opacity: 1; +} + .mx_EventTile_e2eIcon { display: block; position: absolute; @@ -289,6 +293,7 @@ limitations under the License. mask-size: 14px; mask-repeat: no-repeat; mask-position: 0; + opacity: 0.2; } .mx_EventTile_e2eIcon_undecryptable, .mx_EventTile_e2eIcon_unverified { From 37d1191c72b54c31a38c897a3332e1bc36172307 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 14 Feb 2019 09:00:52 -0700 Subject: [PATCH 09/11] Add credit for cover photo usage Fixes https://github.com/vector-im/riot-web/issues/8374 --- .../views/settings/tabs/HelpSettingsTab.js | 21 +++++++++++++++++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 22 insertions(+) diff --git a/src/components/views/settings/tabs/HelpSettingsTab.js b/src/components/views/settings/tabs/HelpSettingsTab.js index 524bddf3b1..4ad62451cb 100644 --- a/src/components/views/settings/tabs/HelpSettingsTab.js +++ b/src/components/views/settings/tabs/HelpSettingsTab.js @@ -126,6 +126,26 @@ export default class HelpSettingsTab extends React.Component { ); } + _renderCredits() { + // Note: This is not translated because it is legal text. + // Also,   is ugly but necessary. + return ( +
+ {_t("Credits")} + +
+ ); + } + render() { let faqText = _t('For help with using Riot, click here.', {}, { 'a': (sub) => {sub}, @@ -211,6 +231,7 @@ export default class HelpSettingsTab extends React.Component { {this._renderLegal()} + {this._renderCredits()}
{_t("Advanced")}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index fe41beb7ae..e98ad402a0 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -528,6 +528,7 @@ "Deactivating your account is a permanent action - be careful!": "Deactivating your account is a permanent action - be careful!", "Deactivate Account": "Deactivate Account", "Legal": "Legal", + "Credits": "Credits", "For help with using Riot, click here.": "For help with using Riot, click here.", "For help with using Riot, click here or start a chat with our bot using the button below.": "For help with using Riot, click here or start a chat with our bot using the button below.", "Chat with Riot Bot": "Chat with Riot Bot", From 96619afc7c11e2087a8525ba5d563a97367481e3 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 14 Feb 2019 09:09:07 -0700 Subject: [PATCH 10/11] Fix icons being cut off in settings Fixes https://github.com/vector-im/riot-web/issues/8578 --- res/css/structures/_TabbedView.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/structures/_TabbedView.scss b/res/css/structures/_TabbedView.scss index 6e435b8e75..29e7c401e6 100644 --- a/res/css/structures/_TabbedView.scss +++ b/res/css/structures/_TabbedView.scss @@ -64,7 +64,7 @@ limitations under the License. background-color: $tab-label-icon-bg-color; mask-repeat: no-repeat; mask-size: 16px; - width: 14px; + width: 16px; height: 22px; mask-position: center; content: ''; From 5c41e1f8dfd8b0364f7bdbf5942d2c1c6f35982f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 14 Feb 2019 09:33:46 -0700 Subject: [PATCH 11/11] Turn on pin unread rooms for everyone --- src/settings/Settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 4108848033..bb3cf9330c 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -324,12 +324,12 @@ export const SETTINGS = { "pinMentionedRooms": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td("Pin rooms I'm mentioned in to the top of the room list"), - default: false, + default: true, }, "pinUnreadRooms": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td("Pin unread rooms to the top of the room list"), - default: false, + default: true, }, "enableWidgetScreenshots": { supportedLevels: LEVELS_ACCOUNT_SETTINGS,