From 26b70678be92274b7a4bbc7efcf4e5275db23f17 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 8 Jul 2024 17:08:11 +0100 Subject: [PATCH 1/4] Promote new room header from labs to Beta Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/i18n/strings/en_EN.json | 4 +++- src/settings/Settings.tsx | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 5272e22c855..f2b407356a4 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1452,7 +1452,9 @@ "location_share_live_description": "Temporary implementation. Locations persist in room history.", "mjolnir": "New ways to ignore people", "msc3531_hide_messages_pending_moderation": "Let moderators hide messages pending moderation.", - "new_room_decoration_ui": "Under active development, new room header & details interface", + "new_room_decoration_ui": "New room header", + "new_room_decoration_ui_beta_caption": "A new look for your rooms with a simpler, cleaner and more accessible room header.", + "new_room_decoration_ui_beta_title": "Room header", "notification_settings": "New Notification Settings", "notification_settings_beta_caption": "Introducing a simpler way to change your notification settings. Customize your %(brand)s, just the way you like.", "notification_settings_beta_title": "Notification Settings", diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index fbdd20633e3..130eb70bd78 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -589,11 +589,13 @@ export const SETTINGS: { [setting: string]: ISetting } = { isFeature: true, labsGroup: LabGroup.Rooms, displayName: _td("labs|new_room_decoration_ui"), - description: _td("labs|under_active_development"), - supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED, - supportedLevelsAreOrdered: true, + supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG, default: false, controller: new ReloadOnChangeController(), + betaInfo: { + title: _td("labs|new_room_decoration_ui_beta_title"), + caption: () =>

{_t("labs|new_room_decoration_ui_beta_caption")}

, + }, }, "feature_notifications": { isFeature: true, From 57d5d1271016502d7c8347aaa20e6c54b0b56fac Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 8 Jul 2024 17:46:13 +0100 Subject: [PATCH 2/4] Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../LabsUserSettingsTab-test.tsx.snap | 50 +++++++++++++++++++ test/settings/SettingsStore-test.ts | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap index 4e65f7b61f4..3b37eb1a5eb 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap @@ -129,6 +129,56 @@ exports[` renders settings marked as beta as beta cards 1 +
+
+
+

+ + Room header + + + Beta + +

+
+

+ A new look for your rooms with a simpler, cleaner and more accessible room header. +

+
+
+
+ Join the beta +
+
+
+
+ +
+
+
`; diff --git a/test/settings/SettingsStore-test.ts b/test/settings/SettingsStore-test.ts index e1c27ab309b..64c63d1b565 100644 --- a/test/settings/SettingsStore-test.ts +++ b/test/settings/SettingsStore-test.ts @@ -31,7 +31,7 @@ const TEST_DATA = [ /** * An existing setting that has {@link IBaseSetting#supportedLevelsAreOrdered} set to true. */ -const SETTING_NAME_WITH_CONFIG_OVERRIDE = "feature_new_room_decoration_ui"; +const SETTING_NAME_WITH_CONFIG_OVERRIDE = "feature_msc3531_hide_messages_pending_moderation"; describe("SettingsStore", () => { let platformSettings: Record; From fecd0672f9c9e470d7f35d92289c3a0c8b42d4a9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 9 Jul 2024 10:02:50 +0100 Subject: [PATCH 3/4] Fix reload warning Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/settings/SettingsStore.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts index 276f00282b5..a7464853689 100644 --- a/src/settings/SettingsStore.ts +++ b/src/settings/SettingsStore.ts @@ -35,6 +35,7 @@ import SettingsHandler from "./handlers/SettingsHandler"; import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; import { Action } from "../dispatcher/actions"; import PlatformSettingsHandler from "./handlers/PlatformSettingsHandler"; +import ReloadOnChangeController from "./controllers/ReloadOnChangeController"; // Convert the settings to easier to manage objects for the handlers const defaultSettings: Record = {}; @@ -316,7 +317,12 @@ export default class SettingsStore { SettingsStore.isFeature(settingName) && SettingsStore.getValueAt(SettingLevel.CONFIG, settingName, null, true, true) !== false ) { - return SETTINGS[settingName]?.betaInfo; + const betaInfo = SETTINGS[settingName]!.betaInfo; + if (betaInfo) { + betaInfo.requiresRefresh = + betaInfo.requiresRefresh ?? SETTINGS[settingName]!.controller instanceof ReloadOnChangeController; + } + return betaInfo; } } From 66c69b8d629645a551dac85ea7c07c0ea50d437a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 9 Jul 2024 10:09:25 +0100 Subject: [PATCH 4/4] Update snapshot Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../user/__snapshots__/LabsUserSettingsTab-test.tsx.snap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap index 3b37eb1a5eb..51ab4655037 100644 --- a/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap @@ -168,6 +168,11 @@ exports[` renders settings marked as beta as beta cards 1 Join the beta +
+ Joining the beta will reload BrandedClient. +