From cd83f12a82dfb40bd2c240410cd27fe5d81f407e Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Mon, 13 Jul 2020 16:11:21 +0100 Subject: [PATCH 01/18] Fix badges for font size 20 --- res/css/views/rooms/_NotificationBadge.scss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/res/css/views/rooms/_NotificationBadge.scss b/res/css/views/rooms/_NotificationBadge.scss index 521f1dfc20..0e6d442cc1 100644 --- a/res/css/views/rooms/_NotificationBadge.scss +++ b/res/css/views/rooms/_NotificationBadge.scss @@ -48,15 +48,15 @@ limitations under the License. } &.mx_NotificationBadge_2char { - width: 16px; - height: 16px; - border-radius: 16px; + width: $font-16px; + height: $font-16px; + border-radius: $font-16px; } &.mx_NotificationBadge_3char { - width: 26px; - height: 16px; - border-radius: 16px; + width: $font-26px; + height: $font-16px; + border-radius: $font-16px; } // The following is the floating badge From 9a3744ebb25af6f0cb5af007112ba851c33ea51c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 09:54:15 -0600 Subject: [PATCH 02/18] Fix default sorting mechanics for new room list Fixes https://github.com/vector-im/riot-web/issues/14445 --- src/stores/room-list/RoomListStore2.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index 8686a3a054..f3a77e765b 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -30,7 +30,6 @@ import { TagWatcher } from "./TagWatcher"; import RoomViewStore from "../RoomViewStore"; import { Algorithm, LIST_UPDATED_EVENT } from "./algorithms/Algorithm"; import { EffectiveMembership, getEffectiveMembership } from "./membership"; -import { ListLayout } from "./ListLayout"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import RoomListLayoutStore from "./RoomListLayoutStore"; import { MarkedExecution } from "../../utils/MarkedExecution"; @@ -425,7 +424,8 @@ export class RoomListStore2 extends AsyncStore { // logic must match calculateListOrder private calculateTagSorting(tagId: TagID): SortAlgorithm { - const defaultSort = SortAlgorithm.Alphabetic; + const isDefaultRecent = tagId === DefaultTagID.Invite || tagId === DefaultTagID.DM; + const defaultSort = isDefaultRecent ? SortAlgorithm.Recent : SortAlgorithm.Alphabetic; const settingAlphabetical = SettingsStore.getValue("RoomList.orderAlphabetically", null, true); const definedSort = this.getTagSorting(tagId); const storedSort = this.getStoredTagSorting(tagId); From 40ab3e23c6eff9921fbec197f13c3cb9c8d51d87 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 10:09:46 -0600 Subject: [PATCH 03/18] Add a null guard on the client --- .../room-list/algorithms/tag-sorting/RecentAlgorithm.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index e7ca94ed95..154fd40b69 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -38,7 +38,11 @@ export class RecentAlgorithm implements IAlgorithm { // actually changed (probably needs to be done higher up?) then we could do an // insertion sort or similar on the limited set of changes. - const myUserId = MatrixClientPeg.get().getUserId(); + // TODO: Don't assume we're using the same client as the peg + let myUserId = ''; + if (MatrixClientPeg.get()) { + myUserId = MatrixClientPeg.get().getUserId(); + } const tsCache: { [roomId: string]: number } = {}; const getLastTs = (r: Room) => { @@ -68,7 +72,6 @@ export class RecentAlgorithm implements IAlgorithm { const ev = r.timeline[i]; if (!ev.getTs()) continue; // skip events that don't have timestamps (tests only?) - // TODO: Don't assume we're using the same client as the peg if (ev.getSender() === myUserId || Unread.eventTriggersUnreadCount(ev)) { return ev.getTs(); } From 231c26c8a45605bd165a9dc3d108aec0b31c7f64 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 13 Jul 2020 17:21:05 +0100 Subject: [PATCH 04/18] Update CustomServerDialog to use brand token --- src/components/views/auth/CustomServerDialog.js | 7 +++++-- src/i18n/strings/bg.json | 1 - src/i18n/strings/cs.json | 1 - src/i18n/strings/de_DE.json | 1 - src/i18n/strings/en_EN.json | 2 +- src/i18n/strings/eo.json | 1 - src/i18n/strings/es.json | 1 - src/i18n/strings/et.json | 1 - src/i18n/strings/eu.json | 1 - src/i18n/strings/fi.json | 1 - src/i18n/strings/fr.json | 1 - src/i18n/strings/gl.json | 1 - src/i18n/strings/hu.json | 1 - src/i18n/strings/it.json | 1 - src/i18n/strings/ko.json | 1 - src/i18n/strings/lt.json | 1 - src/i18n/strings/nl.json | 1 - src/i18n/strings/ru.json | 1 - src/i18n/strings/sk.json | 1 - src/i18n/strings/sq.json | 1 - src/i18n/strings/vls.json | 1 - src/i18n/strings/zh_Hans.json | 1 - src/i18n/strings/zh_Hant.json | 1 - 23 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/components/views/auth/CustomServerDialog.js b/src/components/views/auth/CustomServerDialog.js index 024951e6c0..7b2c8f88aa 100644 --- a/src/components/views/auth/CustomServerDialog.js +++ b/src/components/views/auth/CustomServerDialog.js @@ -1,6 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd -Copyright 2019 The Matrix.org Foundation C.I.C. +Copyright 2019, 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,11 +18,13 @@ limitations under the License. import React from 'react'; import createReactClass from 'create-react-class'; import { _t } from '../../../languageHandler'; +import SdkConfig from '../../../SdkConfig'; export default createReactClass({ displayName: 'CustomServerDialog', render: function() { + const brand = SdkConfig.get().brand; return (
@@ -32,8 +34,9 @@ export default createReactClass({

{_t( "You can use the custom server options to sign into other " + "Matrix servers by specifying a different homeserver URL. This " + - "allows you to use this app with an existing Matrix account on a " + + "allows you to use %(brand)s with an existing Matrix account on a " + "different homeserver.", + { brand }, )}

diff --git a/src/i18n/strings/bg.json b/src/i18n/strings/bg.json index 3d86e54c17..f914e928b5 100644 --- a/src/i18n/strings/bg.json +++ b/src/i18n/strings/bg.json @@ -1056,7 +1056,6 @@ "Go back": "Върни се", "Update status": "Обнови статуса", "Set status": "Настрой статус", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Може да използвате настройките за собствен сървър за да влезете в друг Matrix сървър, чрез указване на адреса му. Това Ви позволява да използвате приложението със съществуващ Matrix акаунт принадлежащ към друг сървър.", "Your Modular server": "Вашият Modular сървър", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Въведете адреса на вашият Modular сървър. Той представлява или вашето собствено домейн име или поддомейн на modular.im.", "Server Name": "Име на сървър", diff --git a/src/i18n/strings/cs.json b/src/i18n/strings/cs.json index 3c6cc3fc66..ca241f4d4e 100644 --- a/src/i18n/strings/cs.json +++ b/src/i18n/strings/cs.json @@ -1147,7 +1147,6 @@ "Set a new status...": "Nastavit status...", "Hide": "Skrýt", "This homeserver would like to make sure you are not a robot.": "Domovský server se potřebuje přesvědčit, že nejste robot.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Ve vlastním nastavení serveru můžete nastavit použití vlastního domovského serveru. To vám umožní používat tuto aplikaci s existujícím Matrix účtem na jiném serveru.", "Please review and accept all of the homeserver's policies": "Pročtěte si a odsouhlaste prosím všechna pravidla domovského serveru", "Please review and accept the policies of this homeserver:": "Pročtěte si a odsouhlaste prosím pravidla domovského serveru:", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Zadejte adresu serveru Modular. Můžete použít svou vlastní doménu a nebo subdoménu modular.im.", diff --git a/src/i18n/strings/de_DE.json b/src/i18n/strings/de_DE.json index 56ffe7327a..0fb38fcb20 100644 --- a/src/i18n/strings/de_DE.json +++ b/src/i18n/strings/de_DE.json @@ -1185,7 +1185,6 @@ "Recovery Method Removed": "Wiederherstellungsmethode gelöscht", "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "Wenn du die Wiederherstellungsmethode nicht gelöscht hast, kann ein Angreifer versuchen Zugang zu deinem Konto zu bekommen. Ändere dein Passwort und richte sofort eine neue Wiederherstellungsmethode in den Einstellungen ein.", "Warning: you should only set up key backup from a trusted computer.": "Warnung: Du solltest die Schlüsselsicherung nur auf einem vertrauenswürdigen Gerät einrichten.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Du kannst die angepassten Serveroptionen benutzen um dich an einem anderen Matrixserver anzumelden indem du eine andere Heimserver-Adresse angibst. Dies erlaubt dir diese Anwendung mit einem anderen Matrixkonto auf einem anderen Heimserver zu nutzen.", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Gib die Adresse deines Modular-Heimservers an. Es kann deine eigene Domain oder eine Subdomain von modular.im sein.", "Unable to query for supported registration methods.": "Konnte unterstützte Registrierungsmethoden nicht abrufen.", "Bulk options": "Sammeloptionen", diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index cefb34ece9..982a47935b 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1943,7 +1943,7 @@ "This homeserver would like to make sure you are not a robot.": "This homeserver would like to make sure you are not a robot.", "Country Dropdown": "Country Dropdown", "Custom Server Options": "Custom Server Options", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.", + "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use %(brand)s with an existing Matrix account on a different homeserver.", "Confirm your identity by entering your account password below.": "Confirm your identity by entering your account password below.", "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.": "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.", "Please review and accept all of the homeserver's policies": "Please review and accept all of the homeserver's policies", diff --git a/src/i18n/strings/eo.json b/src/i18n/strings/eo.json index 8c778cce60..c49e72a1f2 100644 --- a/src/i18n/strings/eo.json +++ b/src/i18n/strings/eo.json @@ -1184,7 +1184,6 @@ "Unable to load backup status": "Ne povas legi staton de savkopio", "Collapse Reply Thread": "Maletendi respondan fadenon", "This homeserver would like to make sure you are not a robot.": "Ĉi tiu hejmservilo volas certigi, ke vi ne estas roboto.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Vi povas uzi proprajn servilajn elektojn por saluti aliajn servilojn de Matrix per alia hejmservila URL. Tio ebligos uzi ĉi tiun aplikaĵon kun jama Matrix-konto en alia hejmservilo.", "Please review and accept all of the homeserver's policies": "Bonvolu tralegi kaj akcepti ĉioman politikon de ĉi tiu hejmservilo", "Please review and accept the policies of this homeserver:": "Bonvolu tralegi kaj akcepti la politikon de ĉi tiu hejmservilo:", "Unable to validate homeserver/identity server": "Ne povas kontroli hejmservilon aŭ identigan servilon", diff --git a/src/i18n/strings/es.json b/src/i18n/strings/es.json index a1262738d4..1619bb7616 100644 --- a/src/i18n/strings/es.json +++ b/src/i18n/strings/es.json @@ -1941,7 +1941,6 @@ "User Status": "Estado de usuario", "This homeserver would like to make sure you are not a robot.": "A este servidor le gustaría asegurarse de que no eres un robot.", "Country Dropdown": "Seleccione país", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Puede utilizar las opciones del servidor personalizado para iniciar sesión en otros servidores de Matrix, especificando una URL de servidor doméstico diferente. Esto le permite usar esta aplicación con una cuenta existente de Matrix en un servidor doméstico diferente.", "Confirm your identity by entering your account password below.": "Confirme su identidad introduciendo la contraseña de su cuenta.", "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.": "Falta la clave pública del captcha en la configuración del servidor doméstico. Por favor, informe de esto al administrador del servidor doméstico.", "Please review and accept all of the homeserver's policies": "Por favor, revise y acepte todas las políticas del servidor doméstico", diff --git a/src/i18n/strings/et.json b/src/i18n/strings/et.json index 17fdc51b0b..0a6837fb48 100644 --- a/src/i18n/strings/et.json +++ b/src/i18n/strings/et.json @@ -1545,7 +1545,6 @@ "Failed to forget room %(errCode)s": "Jututoa unustamine ei õnnestunud %(errCode)s", "This homeserver would like to make sure you are not a robot.": "See server soovib kindlaks teha, et sa ei ole robot.", "Country Dropdown": "Riikide valik", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Sa võid kasutada serveri kohandatud valikuid selleks, et määrates teise aadressi logida sisse teise Matrix'i serverisse. See võimaldab sul kasutada seda rakendust teises koduserveris hallatava olemasoleva Matrix'i kontoga.", "Confirm your identity by entering your account password below.": "Tuvasta oma isik sisestades salasõna alljärgnevalt.", "Please review and accept all of the homeserver's policies": "Palun vaata üle kõik koduserveri kasutustingimused ja nõustu nendega", "Please review and accept the policies of this homeserver:": "Palun vaata üle selle koduserveri kasutustingimused ja nõustu nendega:", diff --git a/src/i18n/strings/eu.json b/src/i18n/strings/eu.json index 66fe2441f2..7d6cfcbad0 100644 --- a/src/i18n/strings/eu.json +++ b/src/i18n/strings/eu.json @@ -1188,7 +1188,6 @@ "Success!": "Ongi!", "A new recovery passphrase and key for Secure Messages have been detected.": "Berreskuratze pasaesaldi eta mezu seguruen gako berriak antzeman dira.", "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "Ez baduzu berreskuratze metodoa kendu, agian erasotzaile bat zure mezuen historialera sarbidea lortu nahi du. Aldatu kontuaren pasahitza eta ezarri berreskuratze metodo berri bat berehala ezarpenetan.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Zerbitzari pertsonalizatuaren aukera erabili dezakezu beste Matrix zerbitzarietan saioa hasteko beste hasiera-zerbitzari batek URLa adieraziz. Honek aplikazio hau beste Matrix zerbitzari batean duzun Matrix kontua erabiltzea baimentzen dizu.", "Changes your display nickname in the current room only": "Zure pantailako izena aldatzen du gela honetan bakarrik", "Your Matrix account on %(serverName)s": "Zure %(serverName)s zerbitzariko Matrix kontua", "Prepends ¯\\_(ツ)_/¯ to a plain-text message": "¯\\_(ツ)_/¯ jartzen du testu soileko mezu baten aurrean", diff --git a/src/i18n/strings/fi.json b/src/i18n/strings/fi.json index 357a2af757..ddac22a9a8 100644 --- a/src/i18n/strings/fi.json +++ b/src/i18n/strings/fi.json @@ -1159,7 +1159,6 @@ "Access your secure message history and set up secure messaging by entering your recovery key.": "Pääse turvattuun viestihistoriaasi ja ota käyttöön turvallinen viestintä syöttämällä palautusavaimesi.", "Share Permalink": "Jaa ikilinkki", "Collapse Reply Thread": "Supista vastaussäie", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Voit käyttää mukautettuja palvelinasetuksia kirjautuaksesi toiselle Matrix-palvelimelle. Tämä sallii tämän sovelluksen käytön toisella kotipalvelimella olevalla Matrix-tilillä.", "Please review and accept all of the homeserver's policies": "Tarkistathan tämän kotipalvelimen käytännöt", "Please review and accept the policies of this homeserver:": "Tarkistathan tämän kotipalvelimen käytännöt:", "Code": "Koodi", diff --git a/src/i18n/strings/fr.json b/src/i18n/strings/fr.json index 35ab26343c..eb09eacd14 100644 --- a/src/i18n/strings/fr.json +++ b/src/i18n/strings/fr.json @@ -1056,7 +1056,6 @@ "Report bugs & give feedback": "Rapporter des anomalies & Donner son avis", "Update status": "Mettre à jour le statut", "Set status": "Définir le statut", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Vous pouvez utiliser les options de serveur personnalisé pour vous connecter à d'autres serveurs Matrix en renseignant un autre URL de serveur d'accueil. Cela vous permet d'utiliser cette application avec un compte Matrix existant sur un autre serveur d'accueil.", "Your Modular server": "Votre serveur Modular", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Saisissez l'emplacement de votre serveur d'accueil Modular. Il peut utiliser votre nom de domaine personnel ou être un sous-domaine de modular.im.", "Server Name": "Nom du serveur", diff --git a/src/i18n/strings/gl.json b/src/i18n/strings/gl.json index fd193e79c6..386b78a61f 100644 --- a/src/i18n/strings/gl.json +++ b/src/i18n/strings/gl.json @@ -2038,7 +2038,6 @@ "User Status": "Estado da usuaria", "This homeserver would like to make sure you are not a robot.": "Este servidor quere asegurarse de que non es un robot.", "Country Dropdown": "Despregable de países", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Podes usar as opcións dun servidor personalizado para conectarte a outros servidores Matrix indicando o URL do servidor. Así poderás usar esta app cunha conta Matrix dun servidor diferente.", "Confirm your identity by entering your account password below.": "Confirma a túa identidade escribindo o contrasinal da conta embaixo.", "Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator.": "Falta a chave pública do captcha na configuración do servidor. Informa desto á administración do teu servidor.", "Please review and accept all of the homeserver's policies": "Revisa e acepta todas as cláusulas do servidor", diff --git a/src/i18n/strings/hu.json b/src/i18n/strings/hu.json index 1d3ccdc9c5..b983926d3d 100644 --- a/src/i18n/strings/hu.json +++ b/src/i18n/strings/hu.json @@ -1055,7 +1055,6 @@ "Go back": "Vissza", "Update status": "Állapot frissítése", "Set status": "Állapot beállítása", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Az egyedi szerver beállítással beléphetsz másik Matrix szerverbe ha megadod annak URL-jét. Ezzel használhatod az alkalmazást megy másik Matrix szerveren meglévő felhasználói fiókkal.", "Your Modular server": "A te Modular servered", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Add meg a Modular Matrix szerveredet. Ami vagy saját domaint használ vagy a modular.im aldomainját.", "Server Name": "Szerver neve", diff --git a/src/i18n/strings/it.json b/src/i18n/strings/it.json index 0aa3bb57b4..4d6fff078d 100644 --- a/src/i18n/strings/it.json +++ b/src/i18n/strings/it.json @@ -1188,7 +1188,6 @@ "Set status": "Imposta stato", "Hide": "Nascondi", "This homeserver would like to make sure you are not a robot.": "Questo homeserver vorrebbe assicurarsi che non sei un robot.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Puoi usare le opzioni server personalizzate per accedere ad altri server Matrix specificando un URL homeserver diverso. Ciò ti permette di usare questa app con un account Matrix esistente su un homeserver differente.", "Your Modular server": "Il tuo server Modular", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Inserisci l'indirizzo del tuo homeserver Modular. Potrebbe usare il tuo nome di dominio o essere un sottodominio di modular.im.", "Server Name": "Nome server", diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index ba3b4a0561..59bb68af94 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -1338,7 +1338,6 @@ "Set a new status...": "새 상태를 설정...", "Hide": "숨기기", "This homeserver would like to make sure you are not a robot.": "이 홈서버는 당신이 로봇이 아닌지 확인하고 싶어합니다.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "맞춤 서버 설정을 사용해 다른 홈서버 URL을 지정함으로써 다른 Matrix 서버에 로그인할 수 있습니다. 이를 통해 다른 홈서버의 기존 Matrix 계정으로 이 앱을 사용할 수 있습니다.", "Please review and accept all of the homeserver's policies": "모든 홈서버의 정책을 검토하고 수락해주세요", "Please review and accept the policies of this homeserver:": "이 홈서버의 정책을 검토하고 수락해주세요:", "Unable to validate homeserver/identity server": "홈서버/ID서버를 확인할 수 없음", diff --git a/src/i18n/strings/lt.json b/src/i18n/strings/lt.json index 2c30a60e0b..fc3d26b51f 100644 --- a/src/i18n/strings/lt.json +++ b/src/i18n/strings/lt.json @@ -1031,7 +1031,6 @@ "Your email address hasn't been verified yet": "Jūsų el. pašto adresas dar nebuvo patvirtintas", "We've sent you an email to verify your address. Please follow the instructions there and then click the button below.": "Išsiuntėme jums el. laišką, kad patvirtintumėme jūsų adresą. Sekite ten esančiais nurodymais ir tada paspauskite žemiau esantį mygtuką.", "Email Address": "El. pašto adresas", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Jūs galite naudoti pasirinktinius serverio nustatymus, kad prisijungtumėte prie kitų Matrix serverių, nurodydami kito serverio URL. Tai leidžia jums naudotis šia programa su kitame serveryje esančia Matrix paskyra.", "Enter your custom homeserver URL What does this mean?": "Įveskite pasirinktinio serverio URL Ką tai reiškia?", "Homeserver URL": "Serverio URL", "Homeserver URL does not appear to be a valid Matrix homeserver": "Serverio adresas neatrodo esantis tinkamas Matrix serveris", diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index ba45d32e71..a8cefd00f9 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -1159,7 +1159,6 @@ "Set a new status...": "Stel een nieuwe status in…", "Hide": "Verbergen", "This homeserver would like to make sure you are not a robot.": "Deze thuisserver wil graag weten of u geen robot bent.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Middels de aangepaste serveropties kunt u zich aanmelden bij andere Matrix-servers, door een andere thuisserver-URL op te geven. Zo kunt u deze toepassing met een bestaande Matrix-account op een andere thuisserver gebruiken.", "Please review and accept all of the homeserver's policies": "Gelieve het beleid van de thuisserver door te nemen en te aanvaarden", "Please review and accept the policies of this homeserver:": "Gelieve het beleid van deze thuisserver door te nemen en te aanvaarden:", "Your Modular server": "Uw Modular-server", diff --git a/src/i18n/strings/ru.json b/src/i18n/strings/ru.json index a3b41282c6..01700c0e8e 100644 --- a/src/i18n/strings/ru.json +++ b/src/i18n/strings/ru.json @@ -1277,7 +1277,6 @@ "Set a new status...": "Установка нового статуса...", "Hide": "Скрыть", "This homeserver would like to make sure you are not a robot.": "Этот сервер хотел бы убедиться, что вы не робот.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Пользовательские серверные параметры можно использовать для входа на другой сервер Matrix по его адресу. Таким образом, вы сможете использовать это приложение с существующим аккаунтом Matrix на другом домашнем сервере.", "Please review and accept all of the homeserver's policies": "Пожалуйста, просмотрите и примите все правила сервера", "Please review and accept the policies of this homeserver:": "Пожалуйста, просмотрите и примите политику этого сервера:", "Unable to validate homeserver/identity server": "Невозможно проверить сервер/сервер идентификации", diff --git a/src/i18n/strings/sk.json b/src/i18n/strings/sk.json index be05d69b88..6cdc74bf05 100644 --- a/src/i18n/strings/sk.json +++ b/src/i18n/strings/sk.json @@ -1183,7 +1183,6 @@ "Set status": "Nastaviť stav", "Hide": "Skryť", "This homeserver would like to make sure you are not a robot.": "Tento domovský server by sa rád uistil, že nie ste robot.", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Vlastné nastavenia servera môžete použiť na pripojenie k inému domovskému serveru Matrix zadaním URL adresy. Umožní vám to prihlásiť sa cez túto aplikáciu k existujúcemu Matrix účtu na inom domovskom servery.", "Your Modular server": "Váš server Modular", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Zadajte umiestnenie vášho domovského servera modular. Môže to byť buď vaša doména alebo subdoména modular.im.", "Server Name": "Názov servera", diff --git a/src/i18n/strings/sq.json b/src/i18n/strings/sq.json index 01dc7c4442..1eda92480b 100644 --- a/src/i18n/strings/sq.json +++ b/src/i18n/strings/sq.json @@ -1049,7 +1049,6 @@ "Go back": "Kthehu mbrapsht", "Update status": "Përditëso gendjen", "Set status": "Caktojini gjendjen", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Mund të përdorni mundësitë mbi shërbyes vetjak, për të bërë hyrjen në shërbyes të tjerë Matrix, duke dhënë URL-në e një tjetër shërbyesi Home. Kjo ju lejon ta përdorni këtë aplikacion në një tjetër shërbyes Home, me një llogari ekzistuese Matrix.", "Your Modular server": "Shërbyesi juaj Modular", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "Jepni vendndodhjen e shërbyesit tuaj Home Modular. Mund të përdorë emrin e përkatësisë tuaj ose të jetë një nënpërkatësi e modular.im.", "Server Name": "Emër Shërbyesi", diff --git a/src/i18n/strings/vls.json b/src/i18n/strings/vls.json index 6c9a9bf002..1172804efa 100644 --- a/src/i18n/strings/vls.json +++ b/src/i18n/strings/vls.json @@ -1082,7 +1082,6 @@ "powered by Matrix": "meuglik gemakt deur Matrix", "This homeserver would like to make sure you are not a robot.": "Deze thuusserver wil geirn weetn of da je gy geen robot zyt.", "Custom Server Options": "Angepaste serverinstelliengn", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "Je kut de angepaste serveropties gebruukn vo jen an te meldn by andere Matrix-servers, deur een andere thuusserver-URL in te geevn. Dit biedt je de meuglikheid vo deze toepassienge te gebruukn met een bestoande Matrix-account ip een andere thuusserver.", "Please review and accept all of the homeserver's policies": "Gelieve ’t beleid van de thuusserver te leezn en ’anveirdn", "Please review and accept the policies of this homeserver:": "Gelieve ’t beleid van deze thuusserver te leezn en t’anveirdn:", "An email has been sent to %(emailAddress)s": "’t Is een e-mail noa %(emailAddress)s verstuurd gewist", diff --git a/src/i18n/strings/zh_Hans.json b/src/i18n/strings/zh_Hans.json index c143fb5baf..ee2af983cb 100644 --- a/src/i18n/strings/zh_Hans.json +++ b/src/i18n/strings/zh_Hans.json @@ -1138,7 +1138,6 @@ "Set a new status...": "设置新状态...", "Hide": "隐藏", "This homeserver would like to make sure you are not a robot.": "此主服务器想要确认您不是机器人。", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "您可以通过在自定义服务器选项中指定不同的主服务器网址来登入其他 Matrix 服务器。这让您可以通过不同的主服务器上已有的 Matrix 账号来使用此应用程序。", "Please review and accept all of the homeserver's policies": "请阅读并接受该主服务器的所有政策", "Please review and accept the policies of this homeserver:": "请阅读并接受此主服务器的政策:", "Your Modular server": "您的模组服务器", diff --git a/src/i18n/strings/zh_Hant.json b/src/i18n/strings/zh_Hant.json index 0f135f454f..2fd8aac537 100644 --- a/src/i18n/strings/zh_Hant.json +++ b/src/i18n/strings/zh_Hant.json @@ -1054,7 +1054,6 @@ "Go back": "返回", "Update status": "更新狀態", "Set status": "設定狀態", - "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use this app with an existing Matrix account on a different homeserver.": "您可以透過指定不同的家伺服器 URL 來使用自訂的伺服器選項來登入其他 Matrix 伺服器。這讓您可以與既有的在不同家伺服器上 Matrix 帳號一同使用此應用程式。", "Your Modular server": "您的模組化伺服器", "Enter the location of your Modular homeserver. It may use your own domain name or be a subdomain of modular.im.": "輸入您模組化伺服器的位置。它可能會使用您自己的域名或是 modular.im 的子網域。", "Server Name": "伺服器名稱", From f0c6139803e3153ed524810606cd91a922779fa5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 13 Jul 2020 17:40:41 +0100 Subject: [PATCH 05/18] Update analytics host tracking for new structure --- src/Analytics.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Analytics.js b/src/Analytics.js index 59cc9d0872..adaf21e2a1 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -204,8 +204,11 @@ class Analytics { this._setVisitVariable('Chosen Language', getCurrentLanguage()); - if (window.location.hostname === 'riot.im') { + const hostname = window.location.hostname; + if (hostname === 'riot.im') { this._setVisitVariable('Instance', window.location.pathname); + } else if (hostname.endsWith('.element.io')) { + this._setVisitVariable('Instance', hostname); } let installedPWA = "unknown"; From d2c7a55fa0d0cac3fcd7d68fb14588a24d0bfa30 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 12:00:56 -0600 Subject: [PATCH 06/18] Ensure tag changes (leaving rooms) causes rooms to move between lists Fixes https://github.com/vector-im/riot-web/issues/14442 Turns out that we are so good at moving a room that when it flows through as a TIMELINE update the algorithm no-ops and does nothing, so don't do that. --- src/stores/room-list/algorithms/Algorithm.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 17e8283c74..a8adaed4d7 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -698,8 +698,8 @@ export class Algorithm extends EventEmitter { } } + let didTagChange = false; if (cause === RoomUpdateCause.PossibleTagChange) { - let didTagChange = false; const oldTags = this.roomIdsToTags[room.roomId] || []; const newTags = this.getTagsForRoom(room); const diff = arrayDiff(oldTags, newTags); @@ -713,6 +713,11 @@ export class Algorithm extends EventEmitter { if (!algorithm) throw new Error(`No algorithm for ${rmTag}`); await algorithm.handleRoomUpdate(room, RoomUpdateCause.RoomRemoved); this.cachedRooms[rmTag] = algorithm.orderedRooms; + + // Later on we won't update the filtered rooms or sticky room for removed + // tags, so do so now. + this.recalculateFilteredRoomsForTag(rmTag); + this.recalculateStickyRoom(rmTag); } for (const addTag of diff.added) { if (!window.mx_QuietRoomListLogging) { @@ -812,7 +817,7 @@ export class Algorithm extends EventEmitter { return false; } - let changed = false; + let changed = didTagChange; for (const tag of tags) { const algorithm: OrderingAlgorithm = this.algorithms[tag]; if (!algorithm) throw new Error(`No algorithm for ${tag}`); From c9e231c3eb9d8662b4e2fa551408a5a22a527b57 Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Mon, 13 Jul 2020 19:03:31 +0100 Subject: [PATCH 07/18] Add fad --- res/css/views/rooms/_RoomSublist2.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/res/css/views/rooms/_RoomSublist2.scss b/res/css/views/rooms/_RoomSublist2.scss index 633c33feea..20f836159b 100644 --- a/res/css/views/rooms/_RoomSublist2.scss +++ b/res/css/views/rooms/_RoomSublist2.scss @@ -196,6 +196,8 @@ limitations under the License. // as the box model should be top aligned. Happens in both FF and Chromium display: flex; flex-direction: column; + + mask-image: linear-gradient(0deg, transparent, black 3px); } .mx_RoomSublist2_resizerHandles_showNButton { From 8e982f52ff834e90464d944cf7a22131ee681936 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 12:59:09 -0600 Subject: [PATCH 08/18] Fix extra room tiles being rendered on smaller sublists Fixes https://github.com/vector-im/riot-web/issues/14426 The issue only applies to lists which won't have a 'show less' button, as the lists with the button would have the button's height considered when determining visible tiles. For lists that were under that (1-4 rooms), the show more button wasn't being considered and thus leading to the padding being added rather than subtracted, causing an extra tile to render. By ensuring we include the padding for both show more and show less, we ensure that no extra tiles get rendered and that the cutoff semantics are still present. --- src/components/views/rooms/RoomSublist2.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index c22e6cd807..2887b7fa55 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -137,9 +137,10 @@ export default class RoomSublist2 extends React.Component { let padding = RESIZE_HANDLE_HEIGHT; // this is used for calculating the max height of the whole container, // and takes into account whether there should be room reserved for the show less button - // when fully expanded. Note that the show more button might still be shown when not fully expanded, - // but in this case it will take the space of a tile and we don't need to reserve space for it. - if (this.numTiles > this.layout.defaultVisibleTiles) { + // when fully expanded. We cannot check against the layout's defaultVisible tile count + // because there are conditions in which we need to know that the 'show more' button + // is present while well under the default tile limit. + if (this.numTiles > this.numVisibleTiles) { padding += SHOW_N_BUTTON_HEIGHT; } return padding; From a8829f09d0ed23dc33148009322cb4019148e35d Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 13:15:44 -0600 Subject: [PATCH 09/18] Ensure RoomListStore2 gets reset when the client becomes invalidated Fixes https://github.com/vector-im/riot-web/issues/14384 We also make use of the new AsyncStore type to handle this more safely. --- src/stores/room-list/RoomListStore2.ts | 48 +++++++------------- test/components/views/rooms/RoomList-test.js | 2 +- 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index f3a77e765b..1be2bae6be 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -33,6 +33,7 @@ import { EffectiveMembership, getEffectiveMembership } from "./membership"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import RoomListLayoutStore from "./RoomListLayoutStore"; import { MarkedExecution } from "../../utils/MarkedExecution"; +import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; interface IState { tagsEnabled?: boolean; @@ -44,14 +45,13 @@ interface IState { */ export const LISTS_UPDATE_EVENT = "lists_update"; -export class RoomListStore2 extends AsyncStore { +export class RoomListStore2 extends AsyncStoreWithClient { /** * Set to true if you're running tests on the store. Should not be touched in * any other environment. */ public static TEST_MODE = false; - private _matrixClient: MatrixClient; private initialListsGenerated = false; private enabled = false; private algorithm = new Algorithm(); @@ -78,33 +78,30 @@ export class RoomListStore2 extends AsyncStore { return this.algorithm.getOrderedRooms(); } - public get matrixClient(): MatrixClient { - return this._matrixClient; - } - // Intended for test usage public async resetStore() { await this.reset(); this.tagWatcher = new TagWatcher(this); this.filterConditions = []; this.initialListsGenerated = false; - this._matrixClient = null; this.algorithm.off(LIST_UPDATED_EVENT, this.onAlgorithmListUpdated); this.algorithm.off(FILTER_CHANGED, this.onAlgorithmListUpdated); this.algorithm = new Algorithm(); this.algorithm.on(LIST_UPDATED_EVENT, this.onAlgorithmListUpdated); this.algorithm.on(FILTER_CHANGED, this.onAlgorithmListUpdated); + + // Reset state without causing updates as the client will have been destroyed + // and downstream code will throw NPE errors. + await this.reset(null, true); } // Public for test usage. Do not call this. - public async makeReady(client: MatrixClient) { + public async makeReady() { // TODO: Remove with https://github.com/vector-im/riot-web/issues/14367 this.checkEnabled(); if (!this.enabled) return; - this._matrixClient = client; - // Update any settings here, as some may have happened before we were logically ready. // Update any settings here, as some may have happened before we were logically ready. console.log("Regenerating room lists: Startup"); @@ -161,7 +158,15 @@ export class RoomListStore2 extends AsyncStore { if (trigger) this.updateFn.trigger(); } - protected async onDispatch(payload: ActionPayload) { + protected async onReady(): Promise { + await this.makeReady(); + } + + protected async onNotReady(): Promise { + await this.resetStore(); + } + + protected async onAction(payload: ActionPayload) { // When we're running tests we can't reliably use setImmediate out of timing concerns. // As such, we use a more synchronous model. if (RoomListStore2.TEST_MODE) { @@ -175,29 +180,10 @@ export class RoomListStore2 extends AsyncStore { } protected async onDispatchAsync(payload: ActionPayload) { - if (payload.action === 'MatrixActions.sync') { - // Filter out anything that isn't the first PREPARED sync. - if (!(payload.prevState === 'PREPARED' && payload.state !== 'PREPARED')) { - return; - } - - await this.makeReady(payload.matrixClient); - - return; // no point in running the next conditions - they won't match - } - // TODO: Remove this once the RoomListStore becomes default if (!this.enabled) return; - if (payload.action === 'on_client_not_viable' || payload.action === 'on_logged_out') { - // Reset state without causing updates as the client will have been destroyed - // and downstream code will throw NPE errors. - await this.reset(null, true); - this._matrixClient = null; - this.initialListsGenerated = false; // we'll want to regenerate them - } - - // Everything below here requires a MatrixClient or some sort of logical readiness. + // Everything here requires a MatrixClient or some sort of logical readiness. const logicallyReady = this.matrixClient && this.initialListsGenerated; if (!logicallyReady) return; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index e84f943708..313bd4b77e 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -109,7 +109,7 @@ describe('RoomList', () => { client.getRoom = (roomId) => roomMap[roomId]; // Now that everything has been set up, prepare and update the store - await RoomListStore.instance.makeReady(client); + await RoomListStore.instance.makeReady(); done(); }); From eb78b1b328a01fc7a6e2013c10a31e0feba80e6c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 13:18:01 -0600 Subject: [PATCH 10/18] Export the matrix client from the store --- src/stores/room-list/RoomListStore2.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index 1be2bae6be..a3311ce90d 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -78,6 +78,10 @@ export class RoomListStore2 extends AsyncStoreWithClient { return this.algorithm.getOrderedRooms(); } + public get matrixClient(): MatrixClient { + return super.matrixClient; + } + // Intended for test usage public async resetStore() { await this.reset(); From 19500cf96abd23f761c5e6426da96af7329149ff Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 13:24:02 -0600 Subject: [PATCH 11/18] Allow the tests to force a MatrixClient --- src/stores/room-list/RoomListStore2.ts | 6 +++++- test/components/views/rooms/RoomList-test.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index a3311ce90d..d67c728bf0 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -101,7 +101,11 @@ export class RoomListStore2 extends AsyncStoreWithClient { } // Public for test usage. Do not call this. - public async makeReady() { + public async makeReady(forcedClient?: MatrixClient) { + if (forcedClient) { + super.matrixClient = forcedClient; + } + // TODO: Remove with https://github.com/vector-im/riot-web/issues/14367 this.checkEnabled(); if (!this.enabled) return; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index 313bd4b77e..e84f943708 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -109,7 +109,7 @@ describe('RoomList', () => { client.getRoom = (roomId) => roomMap[roomId]; // Now that everything has been set up, prepare and update the store - await RoomListStore.instance.makeReady(); + await RoomListStore.instance.makeReady(client); done(); }); From 4b5faf814896445eec68de013c1fcb89a0b268a4 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 13 Jul 2020 21:24:43 +0100 Subject: [PATCH 12/18] Update top vs. bottom sticky styles separately If a sublist changes from sticky top to sticky bottom in a single run of the logic (without passing through the default state), we were leaving the previous top position set. This handles them independently to resolve this. Fixes https://github.com/vector-im/riot-web/issues/14390 Maybe helps with https://github.com/vector-im/riot-web/issues/14443 For vector-im/riot-web#13635 --- src/components/structures/LeftPanel2.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/structures/LeftPanel2.tsx b/src/components/structures/LeftPanel2.tsx index 3c8994b1c0..58cf665430 100644 --- a/src/components/structures/LeftPanel2.tsx +++ b/src/components/structures/LeftPanel2.tsx @@ -187,10 +187,23 @@ export default class LeftPanel2 extends React.Component { if (header.style.top !== newTop) { header.style.top = newTop; } - } else if (style.stickyBottom) { + } else { + if (header.classList.contains("mx_RoomSublist2_headerContainer_stickyTop")) { + header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop"); + } + if (header.style.top) { + header.style.removeProperty('top'); + } + } + + if (style.stickyBottom) { if (!header.classList.contains("mx_RoomSublist2_headerContainer_stickyBottom")) { header.classList.add("mx_RoomSublist2_headerContainer_stickyBottom"); } + } else { + if (header.classList.contains("mx_RoomSublist2_headerContainer_stickyBottom")) { + header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom"); + } } if (style.stickyTop || style.stickyBottom) { @@ -209,21 +222,12 @@ export default class LeftPanel2 extends React.Component { if (header.classList.contains("mx_RoomSublist2_headerContainer_sticky")) { header.classList.remove("mx_RoomSublist2_headerContainer_sticky"); } - if (header.classList.contains("mx_RoomSublist2_headerContainer_stickyTop")) { - header.classList.remove("mx_RoomSublist2_headerContainer_stickyTop"); - } - if (header.classList.contains("mx_RoomSublist2_headerContainer_stickyBottom")) { - header.classList.remove("mx_RoomSublist2_headerContainer_stickyBottom"); - } if (headerContainer.classList.contains("mx_RoomSublist2_headerContainer_hasSticky")) { headerContainer.classList.remove("mx_RoomSublist2_headerContainer_hasSticky"); } if (header.style.width) { header.style.removeProperty('width'); } - if (header.style.top) { - header.style.removeProperty('top'); - } } } From a3a1e2e01fa261698686fe8a1984b1dd5fc2197e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 16:38:13 -0600 Subject: [PATCH 13/18] Fix show less button occluding the last tile Fixes https://github.com/vector-im/riot-web/issues/14450 People may have to click various combinations of 'show more' and 'show less' until it fixes itself, as their layout could be a bit weird now. --- src/components/views/rooms/RoomSublist2.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index 2887b7fa55..e06bbb6ff2 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -624,11 +624,15 @@ export default class RoomSublist2 extends React.Component { const showMoreAtMinHeight = minTiles < this.numTiles; const minHeightPadding = RESIZE_HANDLE_HEIGHT + (showMoreAtMinHeight ? SHOW_N_BUTTON_HEIGHT : 0); const minTilesPx = layout.tilesToPixelsWithPadding(minTiles, minHeightPadding); - const maxTilesPx = layout.tilesToPixelsWithPadding(this.numTiles, this.padding); + let maxTilesPx = layout.tilesToPixelsWithPadding(this.numTiles, this.padding); const showMoreBtnClasses = classNames({ 'mx_RoomSublist2_showNButton': true, }); + if (this.numTiles > this.layout.defaultVisibleTiles) { + maxTilesPx += SHOW_N_BUTTON_HEIGHT; + } + // If we're hiding rooms, show a 'show more' button to the user. This button // floats above the resize handle, if we have one present. If the user has all // tiles visible, it becomes 'show less'. From 80cf2839d9c90e5e41116d56c7149d8f08143430 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 18:46:17 -0600 Subject: [PATCH 14/18] Ensure breadcrumbs don't keep turning themselves back on Fixes https://github.com/vector-im/riot-web/issues/14452 --- src/stores/BreadcrumbsStore.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/stores/BreadcrumbsStore.ts b/src/stores/BreadcrumbsStore.ts index 48ef75cb59..5639a9104c 100644 --- a/src/stores/BreadcrumbsStore.ts +++ b/src/stores/BreadcrumbsStore.ts @@ -21,6 +21,7 @@ import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { arrayHasDiff } from "../utils/arrays"; import { RoomListStoreTempProxy } from "./room-list/RoomListStoreTempProxy"; +import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; const MAX_ROOMS = 20; // arbitrary const AUTOJOIN_WAIT_THRESHOLD_MS = 90000; // 90s, the time we wait for an autojoined room to show up @@ -51,7 +52,11 @@ export class BreadcrumbsStore extends AsyncStoreWithClient { } public get visible(): boolean { - return this.state.enabled && this.matrixClient.getVisibleRooms().length >= 20; + return this.state.enabled && this.meetsRoomRequirement; + } + + private get meetsRoomRequirement(): boolean { + return this.matrixClient.getVisibleRooms().length >= 20; } protected async onAction(payload: ActionPayload) { @@ -99,8 +104,9 @@ export class BreadcrumbsStore extends AsyncStoreWithClient { } private onMyMembership = async (room: Room) => { - // We turn on breadcrumbs by default once the user has at least 1 room to show. - if (!this.state.enabled) { + // Only turn on breadcrumbs is the user hasn't explicitly turned it off again. + const settingValueRaw = SettingsStore.getValue("breadcrumbs", null, /*excludeDefault=*/true); + if (this.meetsRoomRequirement && isNullOrUndefined(settingValueRaw)) { await SettingsStore.setValue("breadcrumbs", null, SettingLevel.ACCOUNT, true); } }; From 917c41dfa03779b8207aa81f975b0395be645929 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 20:08:12 -0600 Subject: [PATCH 15/18] Update sticky headers when breadcrumbs pop in or out Fixes https://github.com/vector-im/riot-web/issues/14455 --- src/components/structures/LeftPanel2.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/structures/LeftPanel2.tsx b/src/components/structures/LeftPanel2.tsx index 58cf665430..9d836ddec3 100644 --- a/src/components/structures/LeftPanel2.tsx +++ b/src/components/structures/LeftPanel2.tsx @@ -111,6 +111,10 @@ export default class LeftPanel2 extends React.Component { const newVal = BreadcrumbsStore.instance.visible; if (newVal !== this.state.showBreadcrumbs) { this.setState({showBreadcrumbs: newVal}); + + // Update the sticky headers too as the breadcrumbs will be popping in or out. + if (!this.listContainerRef.current) return; // ignore: no headers to sticky + this.handleStickyHeaders(this.listContainerRef.current); } }; From bdb136e24ee6a5f2964b7b1b2780dd299e8c288e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 20:25:02 -0600 Subject: [PATCH 16/18] Clean up TODOs, comments, and imports in the new room list Fixes https://github.com/vector-im/riot-web/issues/14412 --- src/components/structures/LeftPanel2.tsx | 12 ------------ src/components/structures/RoomSearch.tsx | 10 ---------- src/components/structures/UserMenu.tsx | 1 + .../views/rooms/NotificationBadge.tsx | 2 -- src/components/views/rooms/RoomBreadcrumbs2.tsx | 9 --------- src/components/views/rooms/RoomList2.tsx | 10 +--------- src/components/views/rooms/RoomSublist2.tsx | 13 +------------ src/components/views/rooms/RoomTile2.tsx | 17 +---------------- src/components/views/rooms/TemporaryTile.tsx | 1 + src/stores/room-list/RoomListStore2.ts | 1 - src/stores/room-list/algorithms/Algorithm.ts | 2 -- .../list-ordering/NaturalAlgorithm.ts | 2 +- .../tag-sorting/AlphabeticAlgorithm.ts | 2 -- .../algorithms/tag-sorting/RecentAlgorithm.ts | 3 ++- 14 files changed, 8 insertions(+), 77 deletions(-) diff --git a/src/components/structures/LeftPanel2.tsx b/src/components/structures/LeftPanel2.tsx index 58cf665430..93270a5780 100644 --- a/src/components/structures/LeftPanel2.tsx +++ b/src/components/structures/LeftPanel2.tsx @@ -35,17 +35,8 @@ import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomLi import {Key} from "../../Keyboard"; import IndicatorScrollbar from "../structures/IndicatorScrollbar"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 // TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14367 -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - interface IProps { isMinimized: boolean; resizeNotifier: ResizeNotifier; @@ -246,7 +237,6 @@ export default class LeftPanel2 extends React.Component { } } - // TODO: Improve header reliability: https://github.com/vector-im/riot-web/issues/14232 private onScroll = (ev: React.MouseEvent) => { const list = ev.target as HTMLDivElement; this.handleStickyHeaders(list); @@ -387,8 +377,6 @@ export default class LeftPanel2 extends React.Component { onResize={this.onResize} />; - // TODO: Conference handling / calls: https://github.com/vector-im/riot-web/issues/14177 - const containerClasses = classNames({ "mx_LeftPanel2": true, "mx_LeftPanel2_hasTagPanel": !!tagPanel, diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 231bd92ddf..517a5f2580 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -25,16 +25,6 @@ import { Key } from "../../Keyboard"; import AccessibleButton from "../views/elements/AccessibleButton"; import { Action } from "../../dispatcher/actions"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 - -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - interface IProps { onQueryUpdate: (newQuery: string) => void; isMinimized: boolean; diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index a6eabe25f7..842e11b516 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -170,6 +170,7 @@ export default class UserMenu extends React.Component { ev.stopPropagation(); // TODO: Archived room view: https://github.com/vector-im/riot-web/issues/14038 + // Note: You'll need to uncomment the button too. console.log("TODO: Show archived rooms"); }; diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index 941a057927..d215df9126 100644 --- a/src/components/views/rooms/NotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge.tsx @@ -18,8 +18,6 @@ import React from "react"; import classNames from "classnames"; import { formatMinimalBadgeCount } from "../../../utils/FormattingUtils"; import SettingsStore from "../../../settings/SettingsStore"; -import { DefaultTagID, TagID } from "../../../stores/room-list/models"; -import { readReceiptChangeIsFor } from "../../../utils/read-receipts"; import AccessibleButton from "../elements/AccessibleButton"; import { XOR } from "../../../@types/common"; import { NOTIFICATION_STATE_UPDATE, NotificationState } from "../../../stores/notifications/NotificationState"; diff --git a/src/components/views/rooms/RoomBreadcrumbs2.tsx b/src/components/views/rooms/RoomBreadcrumbs2.tsx index 7d0584ef66..619ad6da4d 100644 --- a/src/components/views/rooms/RoomBreadcrumbs2.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs2.tsx @@ -27,17 +27,8 @@ import RoomListStore from "../../../stores/room-list/RoomListStore2"; import { DefaultTagID } from "../../../stores/room-list/models"; import AccessibleTooltipButton from "../elements/AccessibleTooltipButton"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 // TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14367 -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - interface IProps { } diff --git a/src/components/views/rooms/RoomList2.tsx b/src/components/views/rooms/RoomList2.tsx index 67787963a3..61f0f5c0c8 100644 --- a/src/components/views/rooms/RoomList2.tsx +++ b/src/components/views/rooms/RoomList2.tsx @@ -41,17 +41,8 @@ import { Action } from "../../../dispatcher/actions"; import { ViewRoomDeltaPayload } from "../../../dispatcher/payloads/ViewRoomDeltaPayload"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 // TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14367 -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - interface IProps { onKeyDown: (ev: React.KeyboardEvent) => void; onFocus: (ev: React.FocusEvent) => void; @@ -231,6 +222,7 @@ export default class RoomList2 extends React.Component { private renderCommunityInvites(): React.ReactElement[] { // TODO: Put community invites in a more sensible place (not in the room list) + // See https://github.com/vector-im/riot-web/issues/14456 return MatrixClientPeg.get().getGroups().filter(g => { if (g.myMembership !== 'invite') return false; return !this.searchFilter || this.searchFilter.matches(g.name || ""); diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index e06bbb6ff2..252de622a1 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -17,7 +17,7 @@ limitations under the License. */ import * as React from "react"; -import {createRef, UIEventHandler} from "react"; +import {createRef} from "react"; import { Room } from "matrix-js-sdk/src/models/room"; import classNames from 'classnames'; import { RovingAccessibleButton, RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; @@ -48,17 +48,8 @@ import { polyfillTouchEvent } from "../../../@types/polyfill"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; import RoomListLayoutStore from "../../../stores/room-list/RoomListLayoutStore"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 // TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14367 -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - const SHOW_N_BUTTON_HEIGHT = 28; // As defined by CSS const RESIZE_HANDLE_HEIGHT = 4; // As defined by CSS export const HEADER_HEIGHT = 32; // As defined by CSS @@ -607,8 +598,6 @@ export default class RoomSublist2 extends React.Component { } public render(): React.ReactElement { - // TODO: Error boundary: https://github.com/vector-im/riot-web/issues/14185 - const visibleTiles = this.renderVisibleTiles(); const classes = classNames({ 'mx_RoomSublist2': true, diff --git a/src/components/views/rooms/RoomTile2.tsx b/src/components/views/rooms/RoomTile2.tsx index ca2f8865f9..fe6a19f2ed 100644 --- a/src/components/views/rooms/RoomTile2.tsx +++ b/src/components/views/rooms/RoomTile2.tsx @@ -55,17 +55,8 @@ import {ActionPayload} from "../../../dispatcher/payloads"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; import { NotificationState } from "../../../stores/notifications/NotificationState"; -// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14367 // TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14367 -/******************************************************************* - * CAUTION * - ******************************************************************* - * This is a work in progress implementation and isn't complete or * - * even useful as a component. Please avoid using it until this * - * warning disappears. * - *******************************************************************/ - interface IProps { room: Room; showMessagePreview: boolean; @@ -124,7 +115,6 @@ const NotifOption: React.FC = ({active, onClick, iconClassNam export default class RoomTile2 extends React.Component { private dispatcherRef: string; private roomTileRef = createRef(); - // TODO: a11y: https://github.com/vector-im/riot-web/issues/14180 constructor(props: IProps) { super(props); @@ -310,7 +300,7 @@ export default class RoomTile2 extends React.Component { await setRoomNotifsState(this.props.room.roomId, newState); } catch (error) { // TODO: some form of error notification to the user to inform them that their state change failed. - // https://github.com/vector-im/riot-web/issues/14281 + // See https://github.com/vector-im/riot-web/issues/14281 console.error(error); } @@ -398,8 +388,6 @@ export default class RoomTile2 extends React.Component { private renderGeneralMenu(): React.ReactElement { if (!this.showContextMenu) return null; // no menu to show - // TODO: We could do with a proper invite context menu, unlike what showContextMenu suggests - const roomTags = RoomListStore.instance.getTagsForRoom(this.props.room); const isFavorite = roomTags.includes(DefaultTagID.Favourite); @@ -465,8 +453,6 @@ export default class RoomTile2 extends React.Component { } public render(): React.ReactElement { - // TODO: Invites: https://github.com/vector-im/riot-web/issues/14198 - const classes = classNames({ 'mx_RoomTile2': true, 'mx_RoomTile2_selected': this.state.selected, @@ -495,7 +481,6 @@ export default class RoomTile2 extends React.Component { ); } - // TODO: the original RoomTile uses state for the room name. Do we need to? let name = this.props.room.name; if (typeof name !== 'string') name = ''; name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon diff --git a/src/components/views/rooms/TemporaryTile.tsx b/src/components/views/rooms/TemporaryTile.tsx index a3ee7eb5bd..9baaba817d 100644 --- a/src/components/views/rooms/TemporaryTile.tsx +++ b/src/components/views/rooms/TemporaryTile.tsx @@ -34,6 +34,7 @@ interface IState { hover: boolean; } +// TODO: Remove with community invites in the room list: https://github.com/vector-im/riot-web/issues/14456 export default class TemporaryTile extends React.Component { constructor(props: IProps) { super(props); diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index d67c728bf0..9b17069d90 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -19,7 +19,6 @@ import { MatrixClient } from "matrix-js-sdk/src/client"; import SettingsStore from "../../settings/SettingsStore"; import { DefaultTagID, OrderedDefaultTagIDs, RoomUpdateCause, TagID } from "./models"; import TagOrderStore from "../TagOrderStore"; -import { AsyncStore } from "../AsyncStore"; import { Room } from "matrix-js-sdk/src/models/room"; import { IListOrderingMap, ITagMap, ITagSortingMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; import { ActionPayload } from "../../dispatcher/payloads"; diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index a8adaed4d7..e0692bbb30 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -34,8 +34,6 @@ import { EffectiveMembership, getEffectiveMembership, splitRoomsByMembership } f import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; import { getListAlgorithmInstance } from "./list-ordering"; -// TODO: Add locking support to avoid concurrent writes? https://github.com/vector-im/riot-web/issues/14235 - /** * Fired when the Algorithm has determined a list has been updated. */ diff --git a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts index ae1a2c98f6..a1c9e4eb85 100644 --- a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts @@ -55,7 +55,7 @@ export class NaturalAlgorithm extends OrderingAlgorithm { } } - // TODO: Optimize this to avoid useless operations: https://github.com/vector-im/riot-web/issues/14035 + // TODO: Optimize this to avoid useless operations: https://github.com/vector-im/riot-web/issues/14457 // For example, we can skip updates to alphabetic (sometimes) and manually ordered tags this.cachedOrderedRooms = await sortRoomsWithAlgorithm(this.cachedOrderedRooms, this.tagId, this.sortingAlgorithm); diff --git a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts index 8d74ebd11e..d909fb6288 100644 --- a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts @@ -17,8 +17,6 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; -import { MatrixClientPeg } from "../../../../MatrixClientPeg"; -import * as Unread from "../../../../Unread"; /** * Sorts rooms according to the browser's determination of alphabetic. diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index 154fd40b69..0a735762a9 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -33,12 +33,13 @@ export class RecentAlgorithm implements IAlgorithm { // of the rooms to each other. // TODO: We could probably improve the sorting algorithm here by finding changes. - // See https://github.com/vector-im/riot-web/issues/14035 + // See https://github.com/vector-im/riot-web/issues/14459 // For example, if we spent a little bit of time to determine which elements have // actually changed (probably needs to be done higher up?) then we could do an // insertion sort or similar on the limited set of changes. // TODO: Don't assume we're using the same client as the peg + // See https://github.com/vector-im/riot-web/issues/14458 let myUserId = ''; if (MatrixClientPeg.get()) { myUserId = MatrixClientPeg.get().getUserId(); From 4a8a59c578e442e3cd410a2a6db0859494ed516e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 13 Jul 2020 20:29:46 -0600 Subject: [PATCH 17/18] Make EffectiveMembership utils generic Fixes https://github.com/vector-im/riot-web/issues/14460 Just have to move them to utils. --- src/stores/notifications/RoomNotificationState.ts | 2 +- src/stores/room-list/RoomListStore2.ts | 2 +- src/stores/room-list/algorithms/Algorithm.ts | 2 +- src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts | 2 +- src/{stores/room-list => utils}/membership.ts | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename src/{stores/room-list => utils}/membership.ts (100%) diff --git a/src/stores/notifications/RoomNotificationState.ts b/src/stores/notifications/RoomNotificationState.ts index ab354c0e93..dc38f8bf0f 100644 --- a/src/stores/notifications/RoomNotificationState.ts +++ b/src/stores/notifications/RoomNotificationState.ts @@ -17,7 +17,7 @@ limitations under the License. import { NotificationColor } from "./NotificationColor"; import { IDestroyable } from "../../utils/IDestroyable"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import { EffectiveMembership, getEffectiveMembership } from "../room-list/membership"; +import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; import { readReceiptChangeIsFor } from "../../utils/read-receipts"; import { MatrixEvent } from "matrix-js-sdk/src/models/event"; import { Room } from "matrix-js-sdk/src/models/room"; diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index d67c728bf0..80ad05cfbe 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -29,7 +29,7 @@ import { FILTER_CHANGED, IFilterCondition } from "./filters/IFilterCondition"; import { TagWatcher } from "./TagWatcher"; import RoomViewStore from "../RoomViewStore"; import { Algorithm, LIST_UPDATED_EVENT } from "./algorithms/Algorithm"; -import { EffectiveMembership, getEffectiveMembership } from "./membership"; +import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import RoomListLayoutStore from "./RoomListLayoutStore"; import { MarkedExecution } from "../../utils/MarkedExecution"; diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index a8adaed4d7..faa5b672d8 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -30,7 +30,7 @@ import { SortAlgorithm } from "./models"; import { FILTER_CHANGED, FilterPriority, IFilterCondition } from "../filters/IFilterCondition"; -import { EffectiveMembership, getEffectiveMembership, splitRoomsByMembership } from "../membership"; +import { EffectiveMembership, getEffectiveMembership, splitRoomsByMembership } from "../../../utils/membership"; import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; import { getListAlgorithmInstance } from "./list-ordering"; diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index 154fd40b69..82a216c0aa 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -19,7 +19,7 @@ import { TagID } from "../../models"; import { IAlgorithm } from "./IAlgorithm"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import * as Unread from "../../../../Unread"; -import { EffectiveMembership, getEffectiveMembership } from "../../membership"; +import { EffectiveMembership, getEffectiveMembership } from "../../../../utils/membership"; /** * Sorts rooms according to the last event's timestamp in each room that seems diff --git a/src/stores/room-list/membership.ts b/src/utils/membership.ts similarity index 100% rename from src/stores/room-list/membership.ts rename to src/utils/membership.ts From 03f94779f16d12801a951da8efd8647f61d9dcdc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 14 Jul 2020 09:38:31 +0100 Subject: [PATCH 18/18] Fix show-all keyboard focus regression Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/RoomSublist2.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index e06bbb6ff2..d24b28bb60 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -237,10 +237,13 @@ export default class RoomSublist2 extends React.Component { }; private onShowAllClick = () => { + // read number of visible tiles before we mutate it + const numVisibleTiles = this.numVisibleTiles; const newHeight = this.layout.tilesToPixelsWithPadding(this.numTiles, this.padding); this.applyHeightChange(newHeight); this.setState({height: newHeight}, () => { - this.focusRoomTile(this.numTiles - 1); + // focus the top-most new room + this.focusRoomTile(numVisibleTiles); }); };