element-web/src/settings/Settings.tsx

964 lines
34 KiB
TypeScript
Raw Normal View History

/*
Copyright 2017 Travis Ralston
Copyright 2018 - 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
2020-07-28 18:02:02 +00:00
import { MatrixClient } from 'matrix-js-sdk/src/client';
import { ReactNode } from "react";
import { _td } from '../languageHandler';
import {
NotificationBodyEnabledController,
NotificationsEnabledController,
} from "./controllers/NotificationControllers";
import CustomStatusController from "./controllers/CustomStatusController";
import ThemeController from './controllers/ThemeController';
import PushToMatrixClientController from './controllers/PushToMatrixClientController';
import ReloadOnChangeController from "./controllers/ReloadOnChangeController";
import FontSizeController from './controllers/FontSizeController';
2020-06-15 14:33:52 +00:00
import SystemFontController from './controllers/SystemFontController';
import UseSystemFontController from './controllers/UseSystemFontController';
2020-07-28 18:02:02 +00:00
import { SettingLevel } from "./SettingLevel";
2020-07-28 21:24:32 +00:00
import SettingController from "./controllers/SettingController";
2020-07-30 14:53:54 +00:00
import { RightPanelPhases } from "../stores/RightPanelStorePhases";
2020-09-08 09:46:09 +00:00
import { isMac } from '../Keyboard';
import UIFeatureController from "./controllers/UIFeatureController";
import { UIFeature } from "./UIFeature";
import { OrderedMultiController } from "./controllers/OrderedMultiController";
import { Layout } from "./enums/Layout";
import ReducedMotionController from './controllers/ReducedMotionController';
import IncompatibleController from "./controllers/IncompatibleController";
import NewLayoutSwitcherController from './controllers/NewLayoutSwitcherController';
import { ImageSize } from "./enums/ImageSize";
2021-11-11 13:07:41 +00:00
import { MetaSpace } from "../stores/spaces";
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
2020-07-28 18:02:02 +00:00
const LEVELS_ROOM_SETTINGS = [
SettingLevel.DEVICE,
SettingLevel.ROOM_DEVICE,
SettingLevel.ROOM_ACCOUNT,
SettingLevel.ACCOUNT,
SettingLevel.CONFIG,
];
const LEVELS_ROOM_OR_ACCOUNT = [
SettingLevel.ROOM_ACCOUNT,
SettingLevel.ACCOUNT,
];
const LEVELS_ROOM_SETTINGS_WITH_ROOM = [
SettingLevel.DEVICE,
SettingLevel.ROOM_DEVICE,
SettingLevel.ROOM_ACCOUNT,
SettingLevel.ACCOUNT,
SettingLevel.CONFIG,
SettingLevel.ROOM,
];
const LEVELS_ACCOUNT_SETTINGS = [
SettingLevel.DEVICE,
SettingLevel.ACCOUNT,
SettingLevel.CONFIG,
];
const LEVELS_FEATURE = [
SettingLevel.DEVICE,
SettingLevel.CONFIG,
];
const LEVELS_DEVICE_ONLY_SETTINGS = [
SettingLevel.DEVICE,
];
const LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG = [
SettingLevel.DEVICE,
SettingLevel.CONFIG,
];
const LEVELS_UI_FEATURE = [
SettingLevel.CONFIG,
// in future we might have a .well-known level or something
];
2021-11-25 16:21:10 +00:00
export enum LabGroup {
Messaging,
Profile,
Spaces,
Widgets,
Rooms,
Moderation,
Analytics,
MessagePreviews,
Themes,
Encryption,
Experimental,
Developer,
}
export const labGroupNames: Record<LabGroup, string> = {
[LabGroup.Messaging]: _td("Messaging"),
[LabGroup.Profile]: _td("Profile"),
[LabGroup.Spaces]: _td("Spaces"),
[LabGroup.Widgets]: _td("Widgets"),
[LabGroup.Rooms]: _td("Rooms"),
[LabGroup.Moderation]: _td("Moderation"),
[LabGroup.Analytics]: _td("Analytics"),
[LabGroup.MessagePreviews]: _td("Message Previews"),
[LabGroup.Themes]: _td("Themes"),
[LabGroup.Encryption]: _td("Encryption"),
[LabGroup.Experimental]: _td("Experimental"),
[LabGroup.Developer]: _td("Developer"),
};
interface IBaseSetting {
isFeature?: false | undefined;
2020-07-28 18:02:02 +00:00
// Display names are strongly recommended for clarity.
// Display name can also be an object for different levels.
displayName?: string | {
// @ts-ignore - TS wants the key to be a string, but we know better
[level: SettingLevel]: string;
};
2021-06-17 15:22:40 +00:00
// Optional description which will be shown as microCopy under SettingsFlags
description?: string;
2020-07-28 18:02:02 +00:00
// The supported levels are required. Preferably, use the preset arrays
// at the top of this file to define this rather than a custom array.
supportedLevels?: SettingLevel[];
// Required. Can be any data type. The value specified here should match
// the data being stored (ie: if a boolean is used, the setting should
// represent a boolean).
default: any;
// Optional settings controller. See SettingsController for more information.
2020-07-28 21:24:32 +00:00
controller?: SettingController;
2020-07-28 18:02:02 +00:00
// Optional flag to make supportedLevels be respected as the order to handle
// settings. The first element is treated as "most preferred". The "default"
// level is always appended to the end.
supportedLevelsAreOrdered?: boolean;
// Optional value to invert a boolean setting's value. The string given will
// be read as the setting's ID instead of the one provided as the key for the
// setting definition. By setting this, the returned value will automatically
// be inverted, except for when the default value is returned. Inversion will
// occur after the controller is asked for an override. This should be used by
// historical settings which we don't want existing user's values be wiped. Do
// not use this for new settings.
invertedSettingName?: string;
// XXX: Keep this around for re-use in future Betas
betaInfo?: {
title: string; // _td
caption: string; // _td
disclaimer?: (enabled: boolean) => ReactNode;
image: string; // require(...)
feedbackSubheading?: string;
feedbackLabel?: string;
extraSettings?: string[];
};
2020-07-28 18:02:02 +00:00
}
2021-11-25 16:21:10 +00:00
export interface IFeature extends Omit<IBaseSetting, "isFeature"> {
// Must be set to true for features.
isFeature: true;
labsGroup: LabGroup;
}
// Type using I-identifier for backwards compatibility from before it became a discriminated union
export type ISetting = IBaseSetting | IFeature;
2020-07-28 18:02:02 +00:00
export const SETTINGS: {[setting: string]: ISetting} = {
"feature_report_to_moderators": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Moderation,
displayName: _td("Report to moderators prototype. " +
"In rooms that support moderation, the `report` button will let you report abuse to room moderators"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_dnd": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Profile,
displayName: _td("Show options to enable 'Do not disturb' mode"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
2020-10-10 15:32:49 +00:00
"feature_latex_maths": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Messaging,
2020-11-26 17:26:42 +00:00
displayName: _td("Render LaTeX maths in messages"),
2020-10-10 15:32:49 +00:00
supportedLevels: LEVELS_FEATURE,
default: false,
},
2020-08-21 01:44:59 +00:00
"feature_communities_v2_prototypes": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Spaces,
2020-08-21 01:59:44 +00:00
displayName: _td(
"Communities v2 prototypes. Requires compatible homeserver. " +
"Highly experimental - use with caution.",
),
2020-08-21 01:44:59 +00:00
supportedLevels: LEVELS_FEATURE,
default: false,
controller: new IncompatibleController("showCommunitiesInsteadOfSpaces", false, false),
2020-06-25 23:00:30 +00:00
},
"feature_pinning": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Messaging,
displayName: _td("Message Pinning"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_maximised_widgets": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Widgets,
displayName: _td("Maximised widgets"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
2021-08-24 08:09:28 +00:00
"feature_thread": {
2021-07-08 09:30:56 +00:00
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Messaging,
2021-08-19 11:25:29 +00:00
// Requires a reload as we change an option flag on the `js-sdk`
// And the entire sync history needs to be parsed again
controller: new ReloadOnChangeController(),
2021-07-08 09:30:56 +00:00
displayName: _td("Threaded messaging"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_custom_status": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Profile,
displayName: _td("Custom user status messages"),
supportedLevels: LEVELS_FEATURE,
default: false,
controller: new CustomStatusController(),
},
2019-02-07 18:04:30 +00:00
"feature_custom_tags": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Experimental,
2019-02-07 18:04:30 +00:00
displayName: _td("Group & filter rooms by custom tags (refresh to apply changes)"),
supportedLevels: LEVELS_FEATURE,
default: false,
controller: new IncompatibleController("showCommunitiesInsteadOfSpaces", false, false),
},
2018-12-24 15:09:10 +00:00
"feature_state_counters": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Rooms,
2018-12-24 15:09:10 +00:00
displayName: _td("Render simple counters in room header"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_many_integration_managers": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Experimental,
displayName: _td("Multiple integration managers (requires manual setup)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
2019-10-31 19:19:54 +00:00
"feature_mjolnir": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Moderation,
2019-10-31 19:19:54 +00:00
displayName: _td("Try out new ways to ignore people (experimental)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_custom_themes": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Themes,
displayName: _td("Support adding custom themes"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_roomlist_preview_reactions_dms": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.MessagePreviews,
displayName: _td("Show message previews for reactions in DMs"),
supportedLevels: LEVELS_FEATURE,
default: false,
// this option is a subset of `feature_roomlist_preview_reactions_all` so disable it when that one is enabled
controller: new IncompatibleController("feature_roomlist_preview_reactions_all"),
},
"feature_roomlist_preview_reactions_all": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.MessagePreviews,
displayName: _td("Show message previews for reactions in all rooms"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
2020-10-02 01:41:03 +00:00
"feature_dehydration": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Encryption,
2020-10-02 21:43:49 +00:00
displayName: _td("Offline encrypted messaging using dehydrated devices"),
2020-10-02 01:41:03 +00:00
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_polls": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Messaging,
supportedLevels: LEVELS_FEATURE,
displayName: _td("Polls (under active development)"),
default: false,
},
"feature_location_share": {
isFeature: true,
labsGroup: LabGroup.Messaging,
supportedLevels: LEVELS_FEATURE,
displayName: _td("Location sharing (under active development)"),
default: false,
},
"doNotDisturb": {
supportedLevels: [SettingLevel.DEVICE],
default: false,
Tweaks to informational architecture 1.1 (#7052) * Move user avatar to Space panel * Add room list header for 'Home' or 'Space Name' to room list Add existing Space context menus to room list header * Re-add pending room join spinner * Iterate RoomListHeader plus context menu * Iterate space context menu * Iterate room list + interactions * Move DND to new iA model * Replace composer custom status management with usermenu one * Cull Quick Actions * Iterate minimized room list state * delint * Merge the RoomListNumResults into the RoomListHeader * Make the search shortcut prompt semi-bold * Iterate RoomListHeader based on design review * Iterate UserMenu based on feedback * Add name to expanded spacepanel usermenu button * i18n * Make room sub list aux button components more generic * Change left panel explore button to only refer to room directory * Iterate RoomListHeader * Fix custom user status input field width in Chrome * Bring back Notification settings button * delint * i18n * post-merge fix * iterate pr * Remove unused state * update copy * Apply suggestions from PR review * delint * Update invite iconography * Iterate Space context menu to match Figma * Fix chevron alignment * Fix edge case for RoomListHeader on metaspaces * Wire up general rageshake-driven feedback mechanism * Add IA1.1 info toast * add missing alt attribute * delint * delint * tweak ia toast priority * e2e test account for new toast * autofocus feedback field and remove old subheading * tweak copy * Iterate space panel colours to match Figma * Iterate PR * delint * Fix feedback submission with object setting values * iterate based on review * Tweak colours and update splash image * Tweaks based on review * Remove room list prompt, made redundant by the big fat `+` * Fix edge cases around User Menu positioning and dnd * Add missing import, bad merge? * Update aria label in e2e test * Fix room list space rooms context menu explore button behaviour * Tweak copy * Revert order of options in the UserMenu * Tweak copy * i18n
2021-11-30 18:08:46 +00:00
controller: new IncompatibleController("feature_dnd", false, false),
},
2019-10-31 19:19:54 +00:00
"mjolnirRooms": {
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
2019-10-31 19:19:54 +00:00
default: [],
},
"mjolnirPersonalRoom": {
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
2019-10-31 19:19:54 +00:00
default: null,
},
2019-12-09 13:28:43 +00:00
"feature_bridge_state": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Rooms,
2019-12-09 13:28:43 +00:00
supportedLevels: LEVELS_FEATURE,
displayName: _td("Show info about bridges in room settings"),
default: false,
},
"feature_new_layout_switcher": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Messaging,
supportedLevels: LEVELS_FEATURE,
2021-07-14 14:20:25 +00:00
displayName: _td("New layout switcher (with message bubbles)"),
default: false,
controller: new NewLayoutSwitcherController(),
},
2021-11-11 13:07:41 +00:00
"feature_spaces_metaspaces": {
isFeature: true,
2021-11-25 16:21:10 +00:00
labsGroup: LabGroup.Spaces,
2021-11-11 13:07:41 +00:00
supportedLevels: LEVELS_FEATURE,
displayName: _td("Meta Spaces"),
default: false,
controller: new OrderedMultiController([
new IncompatibleController("showCommunitiesInsteadOfSpaces"),
new ReloadOnChangeController(),
]),
},
"feature_breadcrumbs_v2": {
isFeature: true,
labsGroup: LabGroup.Rooms,
supportedLevels: LEVELS_FEATURE,
displayName: _td("Use new room breadcrumbs"),
default: false,
},
2021-12-10 11:50:01 +00:00
"feature_spotlight": {
isFeature: true,
labsGroup: LabGroup.Rooms,
supportedLevels: LEVELS_FEATURE,
displayName: _td("New spotlight search experience"),
default: false,
},
"feature_jump_to_date": {
// We purposely leave out `isFeature: true` so it doesn't show in Labs
// by default. We will conditionally show it depending on whether we can
// detect MSC3030 support (see LabUserSettingsTab.tsx).
// labsGroup: LabGroup.Messaging,
displayName: _td("Jump to date (adds /jumptodate)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"RoomList.backgroundImage": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: null,
},
"feature_hidden_read_receipts": {
supportedLevels: LEVELS_FEATURE,
2021-11-25 16:21:10 +00:00
displayName: _td("Don't send read receipts"),
default: false,
},
"baseFontSize": {
displayName: _td("Font size"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: 10,
controller: new FontSizeController(),
},
"useCustomFontSize": {
2020-06-16 14:41:10 +00:00
displayName: _td("Use custom size"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"MessageComposerInput.suggestEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Enable Emoji suggestions while typing'),
default: true,
invertedSettingName: 'MessageComposerInput.dontSuggestEmoji',
},
"MessageComposerInput.showStickersButton": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Show stickers button'),
default: true,
controller: new UIFeatureController(UIFeature.Widgets, false),
},
// TODO: Wire up appropriately to UI (FTUE notifications)
"Notifications.alwaysShowBadgeCounts": {
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,
default: false,
},
"useCompactLayout": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("Use a more compact 'Modern' layout"),
default: false,
controller: new IncompatibleController("layout", false, v => v !== Layout.Group),
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"showRedactions": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Show a placeholder for removed messages'),
default: true,
invertedSettingName: 'hideRedactions',
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"showJoinLeaves": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Show join/leave messages (invites/kicks/bans unaffected)'),
default: true,
invertedSettingName: 'hideJoinLeaves',
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"showAvatarChanges": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Show avatar changes'),
default: true,
invertedSettingName: 'hideAvatarChanges',
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"showDisplaynameChanges": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Show display name changes'),
default: true,
invertedSettingName: 'hideDisplaynameChanges',
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"showReadReceipts": {
supportedLevels: LEVELS_ROOM_SETTINGS,
displayName: _td('Show read receipts sent by other users'),
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
default: true,
invertedSettingName: 'hideReadReceipts',
},
"showTwelveHourTimestamps": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Show timestamps in 12 hour format (e.g. 2:30pm)'),
default: false,
},
"alwaysShowTimestamps": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Always show message timestamps'),
default: false,
},
"autoplayGifs": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Autoplay GIFs'),
default: false,
},
"autoplayVideo": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Autoplay videos'),
default: false,
},
"enableSyntaxHighlightLanguageDetection": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable automatic language detection for syntax highlighting'),
default: false,
},
"expandCodeByDefault": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Expand code blocks by default'),
default: false,
},
"showCodeLineNumbers": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Show line numbers in code blocks'),
default: true,
},
"scrollToBottomOnMessageSent": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Jump to the bottom of the timeline when you send a message'),
default: true,
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"Pill.shouldShowPillAvatar": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Show avatars in user and room mentions'),
default: true,
invertedSettingName: 'Pill.shouldHidePillAvatar',
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"TextualBody.enableBigEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Enable big emoji in chat'),
default: true,
invertedSettingName: 'TextualBody.disableBigEmoji',
},
"MessageComposerInput.isRichTextEnabled": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
},
"MessageComposer.showFormatting": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"sendTypingNotifications": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td("Send typing notifications"),
default: true,
invertedSettingName: 'dontSendTypingNotifications',
},
2020-02-08 21:21:30 +00:00
"showTypingNotifications": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show typing notifications"),
default: true,
},
"ctrlFForSearch": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: isMac ? _td("Use Command + F to search timeline") : _td("Use Ctrl + F to search timeline"),
default: false,
},
"MessageComposerInput.ctrlEnterToSend": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
2020-09-08 09:46:09 +00:00
displayName: isMac ? _td("Use Command + Enter to send a message") : _td("Use Ctrl + Enter to send a message"),
default: false,
},
"MessageComposerInput.surroundWith": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Surround selected text when typing special characters"),
default: false,
},
"MessageComposerInput.autoReplaceEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Automatically replace plain text Emoji'),
default: false,
},
"VideoView.flipVideoHorizontally": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Mirror local video feed'),
default: false,
},
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
"TagPanel.enableTagPanel": {
2018-02-28 18:16:01 +00:00
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
displayName: _td('Enable Community Filter Panel'),
default: true,
invertedSettingName: 'TagPanel.disableTagPanel',
2020-09-16 11:55:04 +00:00
// We force the value to true because the invertedSettingName causes it to flip
controller: new UIFeatureController(UIFeature.Communities, true),
2018-02-28 18:16:01 +00:00
},
"theme": {
2019-02-12 09:13:39 +00:00
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
2019-02-13 09:45:20 +00:00
default: "light",
controller: new ThemeController(),
},
"custom_themes": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: [],
},
"use_system_theme": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: true,
displayName: _td("Match system theme"),
},
2020-06-15 14:33:52 +00:00
"useSystemFont": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
displayName: _td("Use a system font"),
controller: new UseSystemFontController(),
},
"systemFont": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: "",
displayName: _td("System font name"),
controller: new SystemFontController(),
},
"webRtcAllowPeerToPeer": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
displayName: _td(
"Allow Peer-to-Peer for 1:1 calls " +
"(if you enable this, the other party might be able to see your IP address)",
),
Be more positive with setting labels Fixes https://github.com/vector-im/riot-web/issues/6435 This is done through an on-the-fly inverter for the settings. All the settings changed are boolean values, so this should be more than safe to just let happen throughout the SettingsStore. Typically a change like this would be done in the individual handlers (similar to how setting names are remapped to different properties or even different storage locations on the fly), however doing that for this many settings would be a huge nightmare and involve changing *all* the layers. By putting a global "invert this" flag on the setting, we can get away with doing the inversion as the last possible step during a read (or write). To speed up calculations of the default values, we cache all the inverted values into a lookup table similar to how we represent the defaults already. Without this, the DefaultHandler would need to iterate the setting list and invert the values, slowing things down over time. We invert the value up front so we can keep the generic inversion logic without checking the level ahead of time. It is fully intended that a default value represents the new setting name, not the legacy name. This commit also includes a debugger for settings because it was hard to visualize what the SettingsStore was doing during development. Some added information is included as it may be helpful for when someone has a problem with their settings and we need to debug it. Typically the debugger would be run in conjunction with `mxSendRageshake`: `mxSettingsStore.debugSetting('showJoinLeaves') && mxSendRageshake('Debugging showJoinLeaves setting')`.
2019-01-25 03:57:40 +00:00
default: true,
invertedSettingName: 'webRtcForceTURN',
},
"webrtc_audiooutput": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: null,
},
"webrtc_audioinput": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: null,
},
"webrtc_videoinput": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: null,
},
"language": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: "en",
},
"breadcrumb_rooms": {
// not really a setting
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
default: [],
},
"recent_emoji": {
// not really a setting
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
default: [],
},
2021-12-10 11:50:01 +00:00
"SpotlightSearch.recentSearches": {
// not really a setting
supportedLevels: [SettingLevel.ACCOUNT],
default: [], // list of room IDs, most recent first
},
"room_directory_servers": {
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
default: [],
},
2019-10-29 20:26:35 +00:00
"integrationProvisioning": {
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ACCOUNT],
default: true,
},
"allowedWidgets": {
supportedLevels: [SettingLevel.ROOM_ACCOUNT, SettingLevel.ROOM_DEVICE],
supportedLevelsAreOrdered: true,
default: {}, // none allowed
},
"analyticsOptIn": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
displayName: _td('Send analytics data'),
default: false,
},
"showCookieBar": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: true,
},
"pseudonymousAnalyticsOptIn": {
supportedLevels: [SettingLevel.ACCOUNT],
displayName: _td('Send analytics data'),
default: null,
},
"autocompleteDelay": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: 200,
},
"readMarkerInViewThresholdMs": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: 3000,
},
"readMarkerOutOfViewThresholdMs": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: 30000,
},
"blacklistUnverifiedDevices": {
// We specifically want to have room-device > device so that users may set a device default
// with a per-room override.
2020-07-30 03:00:32 +00:00
supportedLevels: [SettingLevel.ROOM_DEVICE, SettingLevel.DEVICE],
supportedLevelsAreOrdered: true,
displayName: {
"default": _td('Never send encrypted messages to unverified sessions from this session'),
2020-01-29 19:55:27 +00:00
"room-device": _td('Never send encrypted messages to unverified sessions in this room from this session'),
},
default: false,
controller: new UIFeatureController(UIFeature.AdvancedEncryption),
},
"urlPreviewsEnabled": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
displayName: {
"default": _td('Enable inline URL previews by default'),
"room-account": _td("Enable URL previews for this room (only affects you)"),
"room": _td("Enable URL previews by default for participants in this room"),
},
default: true,
controller: new UIFeatureController(UIFeature.URLPreviews),
},
"urlPreviewsEnabled_e2ee": {
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ROOM_DEVICE, SettingLevel.ROOM_ACCOUNT],
displayName: {
"room-account": _td("Enable URL previews for this room (only affects you)"),
},
default: false,
controller: new UIFeatureController(UIFeature.URLPreviews),
},
"notificationsEnabled": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
controller: new NotificationsEnabledController(),
},
2019-04-19 21:31:51 +00:00
"notificationSound": {
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,
default: false,
},
"notificationBodyEnabled": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: true,
controller: new NotificationBodyEnabledController(),
},
"audioNotificationsEnabled": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: true,
},
"enableWidgetScreenshots": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable widget screenshots on supported widgets'),
default: false,
},
"promptBeforeInviteUnknownUsers": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Prompt before sending invites to potentially invalid matrix IDs'),
default: true,
},
2018-10-24 17:15:25 +00:00
"showDeveloperTools": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Show developer tools'),
default: false,
},
"widgetOpenIDPermissions": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: {
allow: [],
deny: [],
},
},
// TODO: Remove setting: https://github.com/vector-im/element-web/issues/14373
"RoomList.orderAlphabetically": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Order rooms by name"),
default: false,
},
// TODO: Remove setting: https://github.com/vector-im/element-web/issues/14373
"RoomList.orderByImportance": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show rooms with unread notifications first"),
default: true,
},
"breadcrumbs": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show shortcuts to recently viewed rooms above the room list"),
default: true,
controller: new IncompatibleController("feature_breadcrumbs_v2", true),
},
2019-05-17 16:43:08 +00:00
"showHiddenEventsInTimeline": {
displayName: _td("Show hidden events in timeline"),
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
},
"lowBandwidth": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
displayName: _td('Low bandwidth mode (requires compatible homeserver)'),
default: false,
controller: new ReloadOnChangeController(),
},
"fallbackICEServerAllowed": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
2019-08-15 10:11:46 +00:00
displayName: _td(
"Allow fallback call assist server turn.matrix.org when your homeserver " +
"does not offer one (your IP address would be shared during a call)",
),
// This is a tri-state value, where `null` means "prompt the user".
default: null,
},
"showImages": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show previews/thumbnails for images"),
default: true,
},
"showRightPanelInRoom": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
},
"showRightPanelInGroup": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: false,
},
"lastRightPanelPhaseForRoom": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
default: RightPanelPhases.RoomSummary,
},
"lastRightPanelPhaseForGroup": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
2020-07-30 14:53:54 +00:00
default: RightPanelPhases.GroupMemberList,
},
"enableEventIndexing": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("Enable message search in encrypted rooms"),
default: true,
2019-11-26 14:06:04 +00:00
},
"crawlerSleepTime": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("How fast should messages be downloaded."),
default: 3000,
},
"showCallButtonsInComposer": {
// Dev note: This is no longer "in composer" but is instead "in room header".
// TODO: Rename with settings v3
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: true,
2020-09-16 12:40:27 +00:00
controller: new UIFeatureController(UIFeature.Voip),
},
"e2ee.manuallyVerifyAllSessions": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("Manually verify all remote sessions"),
default: false,
controller: new OrderedMultiController([
// Apply the feature controller first to ensure that the setting doesn't
// show up and can't be toggled. PushToMatrixClientController doesn't
// do any overrides anyways.
new UIFeatureController(UIFeature.AdvancedEncryption),
new PushToMatrixClientController(
MatrixClient.prototype.setCryptoTrustCrossSignedDevices, true,
),
]),
},
"ircDisplayNameWidth": {
// We specifically want to have room-device > device so that users may set a device default
// with a per-room override.
2020-07-28 18:02:02 +00:00
supportedLevels: [SettingLevel.ROOM_DEVICE, SettingLevel.DEVICE],
supportedLevelsAreOrdered: true,
displayName: _td("IRC display name width"),
default: 80,
},
"layout": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: Layout.Group,
},
"Images.size": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: ImageSize.Normal,
},
"showChatEffects": {
supportedLevels: LEVELS_ROOM_SETTINGS_WITH_ROOM,
2021-02-17 17:28:23 +00:00
displayName: _td("Show chat effects (animations when receiving e.g. confetti)"),
default: true,
controller: new ReducedMotionController(),
2020-10-19 11:24:22 +00:00
},
"Performance.addSendMessageTimingMetadata": {
supportedLevels: [SettingLevel.CONFIG],
default: false,
},
"Widgets.pinned": { // deprecated
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,
default: {},
},
"Widgets.layout": {
2020-09-08 07:48:03 +00:00
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,
2020-09-08 15:27:09 +00:00
default: {},
2020-09-08 07:48:03 +00:00
},
"Widgets.leftPanel": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: null,
},
2021-07-30 11:20:02 +00:00
"Spaces.allRoomsInHome": {
displayName: _td("Show all rooms in Home"),
description: _td("All rooms you're in will appear in Home."),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
controller: new IncompatibleController("showCommunitiesInsteadOfSpaces", null),
},
2021-11-11 13:07:41 +00:00
"Spaces.enabledMetaSpaces": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: {
[MetaSpace.Home]: true,
},
controller: new IncompatibleController("feature_spaces_metaspaces", {
[MetaSpace.Home]: true,
}, false),
},
"showCommunitiesInsteadOfSpaces": {
displayName: _td("Display Communities instead of Spaces"),
2021-08-12 14:53:10 +00:00
description: _td("Temporarily show communities instead of Spaces for this session. " +
"Support for this will be removed in the near future. This will reload Element."),
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: false,
controller: new ReloadOnChangeController(),
},
"developerMode": {
displayName: _td("Developer mode"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
},
"automaticErrorReporting": {
displayName: _td("Automatically send debug logs on any error"),
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
default: false,
controller: new ReloadOnChangeController(),
},
[UIFeature.RoomHistorySettings]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.AdvancedEncryption]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.URLPreviews]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.Widgets]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
2020-09-16 12:40:27 +00:00
[UIFeature.Voip]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.Feedback]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.Registration]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.PasswordReset]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.Deactivate]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.ShareQRCode]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
[UIFeature.ShareSocial]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
2020-09-16 13:45:34 +00:00
[UIFeature.IdentityServer]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
// Identity server (discovery) settings make no sense if 3PIDs in general are hidden
controller: new UIFeatureController(UIFeature.ThirdPartyID),
2020-09-16 13:45:34 +00:00
},
2020-09-17 12:25:18 +00:00
[UIFeature.ThirdPartyID]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
2020-09-16 10:26:15 +00:00
[UIFeature.Flair]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
2020-09-16 11:55:04 +00:00
// Disable Flair when Communities are disabled
controller: new UIFeatureController(UIFeature.Communities),
},
[UIFeature.Communities]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
controller: new IncompatibleController("showCommunitiesInsteadOfSpaces", false, false),
2020-09-16 10:26:15 +00:00
},
[UIFeature.AdvancedSettings]: {
supportedLevels: LEVELS_UI_FEATURE,
default: true,
},
};