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

Separate labs and betas more clearly #8969

Merged
merged 29 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b65dce8
Separate labs and betas more clearly
SimonBrandner Jul 2, 2022
edabdb3
Fix tests
SimonBrandner Jul 2, 2022
2977d84
Capitalize `L` in `Labs`
SimonBrandner Jul 2, 2022
352539c
Use `labsSections` instead of `SdkConfig.get("show_labs_settings")`
SimonBrandner Jul 4, 2022
342cbc6
Link to `betas.md` instead of `labs.md`
SimonBrandner Jul 5, 2022
5d0f971
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Oct 4, 2022
ffec636
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Oct 19, 2022
1201b39
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Oct 20, 2022
3bd9d0b
Change labs label back to `Labs`
SimonBrandner Oct 20, 2022
548678a
Improve labs section copy
SimonBrandner Oct 20, 2022
f662ed3
Improve labs flags copy
SimonBrandner Oct 20, 2022
da4454a
i18n
SimonBrandner Oct 20, 2022
5d6a3f8
Fix cypress tests
SimonBrandner Oct 20, 2022
bc95bdc
Reduce diff
SimonBrandner Oct 20, 2022
9ae13a4
Remove empty line
SimonBrandner Oct 20, 2022
55b3d5b
Fix comment
SimonBrandner Oct 20, 2022
4f53e5d
Remove margin-bottom for the last child
SimonBrandner Oct 22, 2022
08fc52d
Improve code based on review
SimonBrandner Nov 4, 2022
b7fd714
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Nov 4, 2022
903f2a1
Fix ts
SimonBrandner Nov 4, 2022
16e6e75
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Nov 5, 2022
12e5cac
Improve ts
SimonBrandner Nov 5, 2022
96acdd8
Fix ts
SimonBrandner Nov 5, 2022
fb02303
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Nov 14, 2022
718f0e1
Improve code
SimonBrandner Nov 29, 2022
9dbd676
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Nov 29, 2022
be31b0a
Merge remote-tracking branch 'upstream/develop' into SimonBrandner/fe…
SimonBrandner Nov 29, 2022
d481a43
Improve TS
SimonBrandner Nov 29, 2022
4870786
Merge branch 'develop' into SimonBrandner/feat/betas
turt2live Nov 30, 2022
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: 2 additions & 2 deletions cypress/integration/5-threads/threads.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("Threads", () => {
markWindowBeforeReload();

// Turn off
cy.openUserSettings("Labs").within(() => {
cy.openUserSettings("Betas").within(() => {
// initially the new property is there
cy.window().should("have.prop", "beforeReload", true);

Expand All @@ -61,7 +61,7 @@ describe("Threads", () => {
markWindowBeforeReload();

// Turn on
cy.openUserSettings("Labs").within(() => {
cy.openUserSettings("Betas").within(() => {
// initially the new property is there
cy.window().should("have.prop", "beforeReload", true);

Expand Down
23 changes: 16 additions & 7 deletions src/components/views/dialogs/UserSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ import SidebarUserSettingsTab from "../settings/tabs/user/SidebarUserSettingsTab
import KeyboardUserSettingsTab from "../settings/tabs/user/KeyboardUserSettingsTab";
import { UserTab } from "./UserTab";

/**
* Returns null if labs are disabled and no betas exist
*/
const getLabsTabLabel = (): string | null => {
const showLabs = SdkConfig.get("show_labs_settings");
const showBetas = SettingsStore.getFeatureSettingNames().some(k => SettingsStore.getBetaInfo(k));

if (showBetas && showLabs) return _td("Betas & Labs");
else if (showBetas) return _td("Betas");
else if (showLabs) return _td("Labs");

return null;
};

interface IProps extends IDialogProps {
initialTabId?: UserTab;
}
Expand Down Expand Up @@ -114,7 +128,6 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
<SidebarUserSettingsTab />,
"UserSettingsSidebar",
));

if (SettingsStore.getValue(UIFeature.Voip)) {
tabs.push(new Tab(
UserTab.Voice,
Expand All @@ -124,21 +137,17 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
"UserSettingsVoiceVideo",
));
}

tabs.push(new Tab(
UserTab.Security,
_td("Security & Privacy"),
"mx_UserSettingsDialog_securityIcon",
<SecurityUserSettingsTab closeSettingsFn={this.props.onFinished} />,
"UserSettingsSecurityPrivacy",
));
// Show the Labs tab if enabled or if there are any active betas
if (SdkConfig.get("show_labs_settings")
|| SettingsStore.getFeatureSettingNames().some(k => SettingsStore.getBetaInfo(k))
) {
if (getLabsTabLabel()) {
tabs.push(new Tab(
UserTab.Labs,
_td("Labs"),
getLabsTabLabel(),
"mx_UserSettingsDialog_labsIcon",
<LabsUserSettingsTab />,
"UserSettingsLabs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {

return (
<div className="mx_SettingsTab mx_LabsUserSettingsTab">
<div className="mx_SettingsTab_heading">{ _t("Labs") }</div>
<div className="mx_SettingsTab_heading">{ _t("Betas") }</div>
<div className='mx_SettingsTab_subsectionText'>
{
_t('Feeling experimental? Labs are the best way to get things early, ' +
_t('Feeling experimental? Betas are the best way to get things early, ' +
'test out new features and help shape them before they actually launch. ' +
'<a>Learn more</a>.', {}, {
'a': (sub) => {
Expand All @@ -180,7 +180,10 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
}
</div>
{ betaSection }
{ labsSections }
{ SdkConfig.get("show_labs_settings") && <>
SimonBrandner marked this conversation as resolved.
Show resolved Hide resolved
<div className="mx_SettingsTab_heading">{ _t("Labs") }</div>
{ labsSections }
</> }
</div>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1448,8 +1448,9 @@
"Your access token gives full access to your account. Do not share it with anyone.": "Your access token gives full access to your account. Do not share it with anyone.",
"Clear cache and reload": "Clear cache and reload",
"Keyboard": "Keyboard",
"Betas": "Betas",
"Feeling experimental? Betas are the best way to get things early, test out new features and help shape them before they actually launch. <a>Learn more</a>.": "Feeling experimental? Betas are the best way to get things early, test out new features and help shape them before they actually launch. <a>Learn more</a>.",
"Labs": "Labs",
"Feeling experimental? Labs are the best way to get things early, test out new features and help shape them before they actually launch. <a>Learn more</a>.": "Feeling experimental? Labs are the best way to get things early, test out new features and help shape them before they actually launch. <a>Learn more</a>.",
"Ignored/Blocked": "Ignored/Blocked",
"Error adding ignored user/server": "Error adding ignored user/server",
"Something went wrong. Please try again or view your console for hints.": "Something went wrong. Please try again or view your console for hints.",
Expand Down Expand Up @@ -2776,6 +2777,7 @@
"Upload %(count)s other files|one": "Upload %(count)s other file",
"Cancel All": "Cancel All",
"Upload Error": "Upload Error",
"Betas & Labs": "Betas & Labs",
"Verify other device": "Verify other device",
"Verification Request": "Verification Request",
"Approve widget permissions": "Approve widget permissions",
Expand Down