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

Promote new room header from labs to Beta #12739

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => <p>{_t("labs|new_room_decoration_ui_beta_caption")}</p>,
},
},
"feature_notifications": {
isFeature: true,
Expand Down
8 changes: 7 additions & 1 deletion src/settings/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any> = {};
Expand Down Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,61 @@ exports[`<LabsUserSettingsTab /> renders settings marked as beta as beta cards 1
</div>
</div>
</div>
<div
class="mx_BetaCard"
>
<div
class="mx_BetaCard_columns"
>
<div
class="mx_BetaCard_columns_description"
>
<h3
class="mx_BetaCard_title"
>
<span>
Room header
</span>
<span
class="mx_BetaCard_betaPill"
>
Beta
</span>
</h3>
<div
class="mx_BetaCard_caption"
>
<p>
A new look for your rooms with a simpler, cleaner and more accessible room header.
</p>
</div>
<div
class="mx_BetaCard_buttons"
>
<div
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
role="button"
tabindex="0"
>
Join the beta
</div>
</div>
<div
class="mx_BetaCard_refreshWarning"
>
Joining the beta will reload BrandedClient.
</div>
</div>
<div
class="mx_BetaCard_columns_image_wrapper"
>
<img
alt=""
class="mx_BetaCard_columns_image"
/>
</div>
</div>
</div>
</div>
</div>
`;
2 changes: 1 addition & 1 deletion test/settings/SettingsStore-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
florianduros marked this conversation as resolved.
Show resolved Hide resolved

describe("SettingsStore", () => {
let platformSettings: Record<string, any>;
Expand Down
Loading