From ff2ac63530646ca1d3c22b322153589fff9fb59a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 26 Nov 2019 09:52:03 -0700 Subject: [PATCH 1/6] Fix override behaviour of system vs defined themes Fixes https://github.com/vector-im/riot-web/issues/11509 --- src/i18n/strings/en_EN.json | 2 +- src/settings/Settings.js | 2 +- src/theme.js | 23 ++++++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7709a4a398..f31f086d26 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -364,7 +364,7 @@ "Automatically replace plain text Emoji": "Automatically replace plain text Emoji", "Mirror local video feed": "Mirror local video feed", "Enable Community Filter Panel": "Enable Community Filter Panel", - "Match system dark mode setting": "Match system dark mode setting", + "Match system theme": "Match system theme", "Allow Peer-to-Peer for 1:1 calls": "Allow Peer-to-Peer for 1:1 calls", "Send analytics data": "Send analytics data", "Never send encrypted messages to unverified devices from this device": "Never send encrypted messages to unverified devices from this device", diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 89693f7c50..54b8715b6e 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -284,7 +284,7 @@ export const SETTINGS = { "use_system_theme": { supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, default: true, - displayName: _td("Match system dark mode setting"), + displayName: _td("Match system theme"), }, "webRtcAllowPeerToPeer": { supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG, diff --git a/src/theme.js b/src/theme.js index e89af55924..2973d2d3fd 100644 --- a/src/theme.js +++ b/src/theme.js @@ -20,7 +20,7 @@ import {_t} from "./languageHandler"; export const DEFAULT_THEME = "light"; import Tinter from "./Tinter"; import dis from "./dispatcher"; -import SettingsStore from "./settings/SettingsStore"; +import SettingsStore, {SettingLevel} from "./settings/SettingsStore"; export class ThemeWatcher { static _instance = null; @@ -60,14 +60,14 @@ export class ThemeWatcher { _onChange = () => { this.recheck(); - } + }; _onAction = (payload) => { if (payload.action === 'recheck_theme') { // XXX forceTheme this.recheck(payload.forceTheme); } - } + }; // XXX: forceTheme param aded here as local echo appears to be unreliable // https://github.com/vector-im/riot-web/issues/11443 @@ -80,6 +80,23 @@ export class ThemeWatcher { } getEffectiveTheme() { + // If the user has specifically enabled the system matching option (excluding default), + // then use that over anything else. We pick the lowest possible level for the setting + // to ensure the ordering otherwise works. + const systemThemeExplicit = SettingsStore.getValueAt(SettingLevel.DEVICE, "use_system_theme", null, false, true); + if (systemThemeExplicit) { + if (this._preferDark.matches) return 'dark'; + if (this._preferLight.matches) return 'light'; + } + + // If the user has specifically enabled the theme (without the system matching option being + // enabled specifically and excluding the default), use that theme. We pick the lowest possible + // level for the setting to ensure the ordering otherwise works. + const themeExplicit = SettingsStore.getValueAt(SettingLevel.DEVICE, "theme", null, false, true); + if (themeExplicit) return themeExplicit; + + // If the user hasn't really made a preference in either direction, assume the defaults of the + // settings and use those. if (SettingsStore.getValue('use_system_theme')) { if (this._preferDark.matches) return 'dark'; if (this._preferLight.matches) return 'light'; From 810fff64bc65ecfe146442c050f7c514bd20d563 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 26 Nov 2019 09:56:04 -0700 Subject: [PATCH 2/6] Appease the linter --- src/theme.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/theme.js b/src/theme.js index 2973d2d3fd..77cf6e9593 100644 --- a/src/theme.js +++ b/src/theme.js @@ -83,7 +83,8 @@ export class ThemeWatcher { // If the user has specifically enabled the system matching option (excluding default), // then use that over anything else. We pick the lowest possible level for the setting // to ensure the ordering otherwise works. - const systemThemeExplicit = SettingsStore.getValueAt(SettingLevel.DEVICE, "use_system_theme", null, false, true); + const systemThemeExplicit = SettingsStore.getValueAt( + SettingLevel.DEVICE, "use_system_theme", null, false, true); if (systemThemeExplicit) { if (this._preferDark.matches) return 'dark'; if (this._preferLight.matches) return 'light'; @@ -92,7 +93,8 @@ export class ThemeWatcher { // If the user has specifically enabled the theme (without the system matching option being // enabled specifically and excluding the default), use that theme. We pick the lowest possible // level for the setting to ensure the ordering otherwise works. - const themeExplicit = SettingsStore.getValueAt(SettingLevel.DEVICE, "theme", null, false, true); + const themeExplicit = SettingsStore.getValueAt( + SettingLevel.DEVICE, "theme", null, false, true); if (themeExplicit) return themeExplicit; // If the user hasn't really made a preference in either direction, assume the defaults of the From c2c8b1b6e0d8f0e07e502e8a58f877427603c89b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 25 Nov 2019 14:03:40 +0000 Subject: [PATCH 3/6] Clarify that cross-signing is in development In an attempt to clarify the state of this highly anticipated feature, this updates the labs flag name to match. Part of https://github.com/vector-im/riot-web/issues/11492 --- src/i18n/strings/en_EN.json | 2 +- src/settings/Settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index f31f086d26..ad877f11e7 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -342,7 +342,7 @@ "Multiple integration managers": "Multiple integration managers", "Try out new ways to ignore people (experimental)": "Try out new ways to ignore people (experimental)", "Send verification requests in direct message, including a new verification UX in the member panel.": "Send verification requests in direct message, including a new verification UX in the member panel.", - "Enable cross-signing to verify per-user instead of per-device": "Enable cross-signing to verify per-user instead of per-device", + "Enable cross-signing to verify per-user instead of per-device (in development)": "Enable cross-signing to verify per-user instead of per-device (in development)", "Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)", "Use the new, faster, composer for writing messages": "Use the new, faster, composer for writing messages", "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 54b8715b6e..b02ab82400 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -143,7 +143,7 @@ export const SETTINGS = { }, "feature_cross_signing": { isFeature: true, - displayName: _td("Enable cross-signing to verify per-user instead of per-device"), + displayName: _td("Enable cross-signing to verify per-user instead of per-device (in development)"), supportedLevels: LEVELS_FEATURE, default: false, controller: new ReloadOnChangeController(), From d9e322bbcaf2f4bf78b608266c35c6c5292bb4ef Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 27 Nov 2019 10:32:21 +0000 Subject: [PATCH 4/6] Upgrade to JS SDK 2.4.5 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1ecfe63c23..6cdd42c9da 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "linkifyjs": "^2.1.6", "lodash": "^4.17.14", "lolex": "4.2", - "matrix-js-sdk": "2.4.4", + "matrix-js-sdk": "2.4.5", "optimist": "^0.6.1", "pako": "^1.0.5", "png-chunks-extract": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 44d9548b54..e43f12760b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5197,10 +5197,10 @@ mathml-tag-names@^2.0.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.1.tgz#6dff66c99d55ecf739ca53c492e626f1d12a33cc" integrity sha512-pWB896KPGSGkp1XtyzRBftpTzwSOL0Gfk0wLvxt4f2mgzjY19o0LxJ3U25vNWTzsh7da+KTbuXQoQ3lOJZ8WHw== -matrix-js-sdk@2.4.4: - version "2.4.4" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-2.4.4.tgz#d5e2d6fbe938c4275a1423a5f09330d33517ce3f" - integrity sha512-wSaRFvhWvwEzVaEkyBGo5ReumvaM5OrC1MJ6SVlyoLwH/WRPEXcUlu+rUNw5TFVEAH4TAVHXf/SVRBiR0j5nSQ== +matrix-js-sdk@2.4.5: + version "2.4.5" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-2.4.5.tgz#0a02f0a3e18c59a393b34b8d6ebc54226cce6465" + integrity sha512-Mh0fPoiqyXRksFNYS4/2s20xAklmYVIgSms3qFvLhno32LN43NizUoAMBYYGtyjt8BQi+U77lbNL0s5f2V7gPQ== dependencies: another-json "^0.2.0" babel-runtime "^6.26.0" From 25b5921ddfeeb4dbbfd4387b8f8482fcbdda82fe Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 27 Nov 2019 10:38:35 +0000 Subject: [PATCH 5/6] Prepare changelog for v1.7.4 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc2341863a..8fe6f80e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Changes in [1.7.4](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.7.4) (2019-11-27) +=================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.7.3...v1.7.4) + +* Upgrade to JS SDK 2.5.4 to relax identity server discovery and E2EE debugging +* Fix override behaviour of system vs defined theme +* Clarify that cross-signing is in development + Changes in [1.7.3](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v1.7.3) (2019-11-25) =================================================================================================== [Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v1.7.3-rc.2...v1.7.3) From 1a98c0d04e74684dc47ee1c7d917ae56a5a9ba91 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 27 Nov 2019 10:38:35 +0000 Subject: [PATCH 6/6] v1.7.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6cdd42c9da..7b75390293 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matrix-react-sdk", - "version": "1.7.3", + "version": "1.7.4", "description": "SDK for matrix.org using React", "author": "matrix.org", "repository": {