Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cd39d91

Browse files
authored
Promote new room header from labs to Beta (#12739)
* Promote new room header from labs to Beta Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * Fix reload warning Signed-off-by: Michael Telatynski <[email protected]> * Update snapshot Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent 7487b27 commit cd39d91

File tree

5 files changed

+71
-6
lines changed

5 files changed

+71
-6
lines changed

src/i18n/strings/en_EN.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,9 @@
14521452
"location_share_live_description": "Temporary implementation. Locations persist in room history.",
14531453
"mjolnir": "New ways to ignore people",
14541454
"msc3531_hide_messages_pending_moderation": "Let moderators hide messages pending moderation.",
1455-
"new_room_decoration_ui": "Under active development, new room header & details interface",
1455+
"new_room_decoration_ui": "New room header",
1456+
"new_room_decoration_ui_beta_caption": "A new look for your rooms with a simpler, cleaner and more accessible room header.",
1457+
"new_room_decoration_ui_beta_title": "Room header",
14561458
"notification_settings": "New Notification Settings",
14571459
"notification_settings_beta_caption": "Introducing a simpler way to change your notification settings. Customize your %(brand)s, just the way you like.",
14581460
"notification_settings_beta_title": "Notification Settings",

src/settings/Settings.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,13 @@ export const SETTINGS: { [setting: string]: ISetting } = {
589589
isFeature: true,
590590
labsGroup: LabGroup.Rooms,
591591
displayName: _td("labs|new_room_decoration_ui"),
592-
description: _td("labs|under_active_development"),
593-
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
594-
supportedLevelsAreOrdered: true,
592+
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
595593
default: false,
596594
controller: new ReloadOnChangeController(),
595+
betaInfo: {
596+
title: _td("labs|new_room_decoration_ui_beta_title"),
597+
caption: () => <p>{_t("labs|new_room_decoration_ui_beta_caption")}</p>,
598+
},
597599
},
598600
"feature_notifications": {
599601
isFeature: true,

src/settings/SettingsStore.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import SettingsHandler from "./handlers/SettingsHandler";
3535
import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload";
3636
import { Action } from "../dispatcher/actions";
3737
import PlatformSettingsHandler from "./handlers/PlatformSettingsHandler";
38+
import ReloadOnChangeController from "./controllers/ReloadOnChangeController";
3839

3940
// Convert the settings to easier to manage objects for the handlers
4041
const defaultSettings: Record<string, any> = {};
@@ -316,7 +317,12 @@ export default class SettingsStore {
316317
SettingsStore.isFeature(settingName) &&
317318
SettingsStore.getValueAt(SettingLevel.CONFIG, settingName, null, true, true) !== false
318319
) {
319-
return SETTINGS[settingName]?.betaInfo;
320+
const betaInfo = SETTINGS[settingName]!.betaInfo;
321+
if (betaInfo) {
322+
betaInfo.requiresRefresh =
323+
betaInfo.requiresRefresh ?? SETTINGS[settingName]!.controller instanceof ReloadOnChangeController;
324+
}
325+
return betaInfo;
320326
}
321327
}
322328

test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap

+55
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,61 @@ exports[`<LabsUserSettingsTab /> renders settings marked as beta as beta cards 1
129129
</div>
130130
</div>
131131
</div>
132+
<div
133+
class="mx_BetaCard"
134+
>
135+
<div
136+
class="mx_BetaCard_columns"
137+
>
138+
<div
139+
class="mx_BetaCard_columns_description"
140+
>
141+
<h3
142+
class="mx_BetaCard_title"
143+
>
144+
<span>
145+
Room header
146+
</span>
147+
<span
148+
class="mx_BetaCard_betaPill"
149+
>
150+
Beta
151+
</span>
152+
</h3>
153+
<div
154+
class="mx_BetaCard_caption"
155+
>
156+
<p>
157+
A new look for your rooms with a simpler, cleaner and more accessible room header.
158+
</p>
159+
</div>
160+
<div
161+
class="mx_BetaCard_buttons"
162+
>
163+
<div
164+
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
165+
role="button"
166+
tabindex="0"
167+
>
168+
Join the beta
169+
</div>
170+
</div>
171+
<div
172+
class="mx_BetaCard_refreshWarning"
173+
>
174+
Joining the beta will reload BrandedClient.
175+
</div>
176+
</div>
177+
<div
178+
class="mx_BetaCard_columns_image_wrapper"
179+
>
180+
<img
181+
alt=""
182+
class="mx_BetaCard_columns_image"
183+
/>
184+
</div>
185+
</div>
186+
</div>
132187
</div>
133188
</div>
134189
`;

test/settings/SettingsStore-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const TEST_DATA = [
3131
/**
3232
* An existing setting that has {@link IBaseSetting#supportedLevelsAreOrdered} set to true.
3333
*/
34-
const SETTING_NAME_WITH_CONFIG_OVERRIDE = "feature_new_room_decoration_ui";
34+
const SETTING_NAME_WITH_CONFIG_OVERRIDE = "feature_msc3531_hide_messages_pending_moderation";
3535

3636
describe("SettingsStore", () => {
3737
let platformSettings: Record<string, any>;

0 commit comments

Comments
 (0)