feat(settings): new settings pages, collapsed pickers, privacy choice, grouped calls (#453 phase 2) #466
No files matched your search
@@ -1,22 +1,31 @@
|
|||||||
- navigation "Settings sections":
|
- navigation "Settings sections":
|
||||||
- button "General" [pressed]:
|
- button "Account" [pressed]:
|
||||||
- img
|
|
||||||
- paragraph: General
|
|
||||||
- button "Account":
|
|
||||||
- img
|
- img
|
||||||
- paragraph: Account
|
- paragraph: Account
|
||||||
|
- button "Appearance":
|
||||||
|
- img
|
||||||
|
- paragraph: Appearance
|
||||||
|
- button "Messages":
|
||||||
|
- img
|
||||||
|
- paragraph: Messages
|
||||||
- button "Notifications":
|
- button "Notifications":
|
||||||
- img
|
- img
|
||||||
- paragraph: Notifications
|
- paragraph: Notifications
|
||||||
- button "Devices":
|
- button "Calls & audio":
|
||||||
- img
|
- img
|
||||||
- paragraph: Devices
|
- paragraph: Calls & audio
|
||||||
- button "Emojis & Stickers":
|
- button "Privacy & security":
|
||||||
- img
|
- img
|
||||||
- paragraph: Emojis & Stickers
|
- paragraph: Privacy & security
|
||||||
- button "Developer Tools":
|
- button "Data & storage":
|
||||||
- img
|
- img
|
||||||
- paragraph: Developer Tools
|
- paragraph: Data & storage
|
||||||
|
- button "Emojis & stickers":
|
||||||
|
- img
|
||||||
|
- paragraph: Emojis & stickers
|
||||||
|
- button "Advanced":
|
||||||
|
- img
|
||||||
|
- paragraph: Advanced
|
||||||
- button "About":
|
- button "About":
|
||||||
- img
|
- img
|
||||||
- paragraph: About
|
- paragraph: About
|
||||||
@@ -31,7 +31,7 @@ test.describe('key upload recovery (#201)', () => {
|
|||||||
expect(rejected).toBeGreaterThanOrEqual(3);
|
expect(rejected).toBeGreaterThanOrEqual(3);
|
||||||
|
|
||||||
await banner.getByRole('button', { name: 'Details' }).click();
|
await banner.getByRole('button', { name: 'Details' }).click();
|
||||||
await expect(banner).toContainText('Settings → Devices');
|
await expect(banner).toContainText('Settings → Privacy & security');
|
||||||
await expect(banner).toContainText('already exists');
|
await expect(banner).toContainText('already exists');
|
||||||
|
|
||||||
await banner.getByRole('button', { name: /Fix: sign out/ }).click();
|
await banner.getByRole('button', { name: /Fix: sign out/ }).click();
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ test.describe('security nudge (#110, #123)', () => {
|
|||||||
await expect(strip(page)).toHaveCount(0);
|
await expect(strip(page)).toHaveCount(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('no key backup: "Set up key backup" opens Settings → Devices', async ({ page }) => {
|
test('no key backup: "Set up key backup" opens Settings → Privacy & security', async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
test.setTimeout(150_000);
|
test.setTimeout(150_000);
|
||||||
await loginUI(page, user);
|
await loginUI(page, user);
|
||||||
await pastGrace(page);
|
await pastGrace(page);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ test.describe('your data (#114)', () => {
|
|||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
const openGeneral = async () => {
|
const openGeneral = async () => {
|
||||||
await page.getByRole('button', { name: 'User Settings' }).click();
|
await page.getByRole('button', { name: 'User Settings' }).click();
|
||||||
await page.getByRole('dialog').getByText('General', { exact: true }).first().click();
|
await page.getByRole('dialog').getByText('Data & storage', { exact: true }).first().click();
|
||||||
await page
|
await page
|
||||||
.getByRole('dialog')
|
.getByRole('dialog')
|
||||||
.getByText('Your data', { exact: true })
|
.getByText('Your data', { exact: true })
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { useModalStyle } from '../hooks/useModalStyle';
|
|||||||
* cinny-desktop #5: the first time the window is closed, ask whether Lotus Chat
|
* cinny-desktop #5: the first time the window is closed, ask whether Lotus Chat
|
||||||
* should keep running in the tray (calls, messages, notifications) or quit —
|
* should keep running in the tray (calls, messages, notifications) or quit —
|
||||||
* and, in the same moment, whether it should start when you sign in. Asked
|
* and, in the same moment, whether it should start when you sign in. Asked
|
||||||
* once; changeable in Settings → General. The native side sends
|
* once; changeable in Settings → Desktop. The native side sends
|
||||||
* `lotus-close-requested` only while the choice is still "ask", and never
|
* `lotus-close-requested` only while the choice is still "ask", and never
|
||||||
* during a call (a call always goes to the tray).
|
* during a call (a call always goes to the tray).
|
||||||
*/
|
*/
|
||||||
@@ -149,7 +149,7 @@ export function CloseBehaviorPrompt() {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Text size="T200" priority="300">
|
<Text size="T200" priority="300">
|
||||||
You can change this in Settings → General.
|
You can change this in Settings → Desktop.
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export function RoomRetention({ permissions }: RoomRetentionProps) {
|
|||||||
>
|
>
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Message Retention"
|
title="Message Retention"
|
||||||
description="Messages older than this window disappear from the timeline. Each member can opt in to permanently delete their own expired messages in Settings → General; full server-side deletion also requires homeserver retention to be configured."
|
description="Messages older than this window disappear from the timeline. Each member can opt in to permanently delete their own expired messages in Settings → Messages; full server-side deletion also requires homeserver retention to be configured."
|
||||||
>
|
>
|
||||||
<Box gap="200" alignItems="Center" style={{ flexWrap: 'wrap' }}>
|
<Box gap="200" alignItems="Center" style={{ flexWrap: 'wrap' }}>
|
||||||
{RETENTION_PRESETS.map((preset) => {
|
{RETENTION_PRESETS.map((preset) => {
|
||||||
|
|||||||
@@ -15,7 +15,16 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
} from 'folds';
|
} from 'folds';
|
||||||
import FocusTrap from 'focus-trap-react';
|
import FocusTrap from 'focus-trap-react';
|
||||||
import { General } from './general';
|
import {
|
||||||
|
AdvancedDisplayOptions,
|
||||||
|
AppearancePage,
|
||||||
|
CallsPage,
|
||||||
|
DataStoragePage,
|
||||||
|
DesktopPage,
|
||||||
|
MessagesPage,
|
||||||
|
Privacy,
|
||||||
|
} from './general';
|
||||||
|
import { isTauri as isTauriEnv } from '../../hooks/useTauri';
|
||||||
import { PageNav, PageNavContent, PageNavHeader, PageRoot } from '../../components/page';
|
import { PageNav, PageNavContent, PageNavHeader, PageRoot } from '../../components/page';
|
||||||
import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize';
|
import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize';
|
||||||
import { Account } from './account';
|
import { Account } from './account';
|
||||||
@@ -45,43 +54,23 @@ type SettingsMenuItem = {
|
|||||||
|
|
||||||
const useSettingsMenuItems = (): SettingsMenuItem[] =>
|
const useSettingsMenuItems = (): SettingsMenuItem[] =>
|
||||||
useMemo(
|
useMemo(
|
||||||
() => [
|
() =>
|
||||||
{
|
[
|
||||||
page: SettingsPages.GeneralPage,
|
{ page: SettingsPages.AccountPage, name: 'Account', icon: Icons.User },
|
||||||
name: 'General',
|
{ page: SettingsPages.AppearancePage, name: 'Appearance', icon: Icons.Sun },
|
||||||
icon: Icons.Setting,
|
{ page: SettingsPages.MessagesPage, name: 'Messages', icon: Icons.Message },
|
||||||
},
|
{ page: SettingsPages.NotificationPage, name: 'Notifications', icon: Icons.Bell },
|
||||||
{
|
{ page: SettingsPages.CallsPage, name: 'Calls & audio', icon: Icons.Phone },
|
||||||
page: SettingsPages.AccountPage,
|
{ page: SettingsPages.DevicesPage, name: 'Privacy & security', icon: Icons.ShieldUser },
|
||||||
name: 'Account',
|
{ page: SettingsPages.DataStoragePage, name: 'Data & storage', icon: Icons.Download },
|
||||||
icon: Icons.User,
|
// [Gitea #459] Desktop-only options: nothing to show in a browser.
|
||||||
},
|
...(isTauriEnv()
|
||||||
{
|
? [{ page: SettingsPages.DesktopPage, name: 'Desktop', icon: Icons.Monitor }]
|
||||||
page: SettingsPages.NotificationPage,
|
: []),
|
||||||
name: 'Notifications',
|
{ page: SettingsPages.EmojisStickersPage, name: 'Emojis & stickers', icon: Icons.Smile },
|
||||||
icon: Icons.Bell,
|
{ page: SettingsPages.DeveloperToolsPage, name: 'Advanced', icon: Icons.Terminal },
|
||||||
},
|
{ page: SettingsPages.AboutPage, name: 'About', icon: Icons.Info },
|
||||||
{
|
] as SettingsMenuItem[],
|
||||||
page: SettingsPages.DevicesPage,
|
|
||||||
name: 'Devices',
|
|
||||||
icon: Icons.Monitor,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
page: SettingsPages.EmojisStickersPage,
|
|
||||||
name: 'Emojis & Stickers',
|
|
||||||
icon: Icons.Smile,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
page: SettingsPages.DeveloperToolsPage,
|
|
||||||
name: 'Developer Tools',
|
|
||||||
icon: Icons.Terminal,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
page: SettingsPages.AboutPage,
|
|
||||||
name: 'About',
|
|
||||||
icon: Icons.Info,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -102,7 +91,7 @@ export function Settings({ initialPage, requestClose }: SettingsProps) {
|
|||||||
const screenSize = useScreenSizeContext();
|
const screenSize = useScreenSizeContext();
|
||||||
const [activePage, setActivePage] = useState<SettingsPages | undefined>(() => {
|
const [activePage, setActivePage] = useState<SettingsPages | undefined>(() => {
|
||||||
if (initialPage) return initialPage;
|
if (initialPage) return initialPage;
|
||||||
return screenSize === ScreenSize.Mobile ? undefined : SettingsPages.GeneralPage;
|
return screenSize === ScreenSize.Mobile ? undefined : SettingsPages.AccountPage;
|
||||||
});
|
});
|
||||||
const menuItems = useSettingsMenuItems();
|
const menuItems = useSettingsMenuItems();
|
||||||
|
|
||||||
@@ -207,8 +196,20 @@ export function Settings({ initialPage, requestClose }: SettingsProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{activePage === SettingsPages.GeneralPage && (
|
{activePage === SettingsPages.AppearancePage && (
|
||||||
<General requestClose={handlePageRequestClose} />
|
<AppearancePage requestClose={handlePageRequestClose} />
|
||||||
|
)}
|
||||||
|
{activePage === SettingsPages.MessagesPage && (
|
||||||
|
<MessagesPage requestClose={handlePageRequestClose} />
|
||||||
|
)}
|
||||||
|
{activePage === SettingsPages.CallsPage && (
|
||||||
|
<CallsPage requestClose={handlePageRequestClose} />
|
||||||
|
)}
|
||||||
|
{activePage === SettingsPages.DataStoragePage && (
|
||||||
|
<DataStoragePage requestClose={handlePageRequestClose} />
|
||||||
|
)}
|
||||||
|
{activePage === SettingsPages.DesktopPage && (
|
||||||
|
<DesktopPage requestClose={handlePageRequestClose} />
|
||||||
)}
|
)}
|
||||||
{activePage === SettingsPages.AccountPage && (
|
{activePage === SettingsPages.AccountPage && (
|
||||||
<Account requestClose={handlePageRequestClose} />
|
<Account requestClose={handlePageRequestClose} />
|
||||||
@@ -217,13 +218,21 @@ export function Settings({ initialPage, requestClose }: SettingsProps) {
|
|||||||
<Notifications requestClose={handlePageRequestClose} />
|
<Notifications requestClose={handlePageRequestClose} />
|
||||||
)}
|
)}
|
||||||
{activePage === SettingsPages.DevicesPage && (
|
{activePage === SettingsPages.DevicesPage && (
|
||||||
<Devices requestClose={handlePageRequestClose} />
|
<Devices
|
||||||
|
title="Privacy & security"
|
||||||
|
before={<Privacy />}
|
||||||
|
requestClose={handlePageRequestClose}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{activePage === SettingsPages.EmojisStickersPage && (
|
{activePage === SettingsPages.EmojisStickersPage && (
|
||||||
<EmojisStickers requestClose={handlePageRequestClose} />
|
<EmojisStickers requestClose={handlePageRequestClose} />
|
||||||
)}
|
)}
|
||||||
{activePage === SettingsPages.DeveloperToolsPage && (
|
{activePage === SettingsPages.DeveloperToolsPage && (
|
||||||
<DeveloperTools requestClose={handlePageRequestClose} />
|
<DeveloperTools
|
||||||
|
title="Advanced"
|
||||||
|
before={<AdvancedDisplayOptions />}
|
||||||
|
requestClose={handlePageRequestClose}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{activePage === SettingsPages.AboutPage && <About requestClose={handlePageRequestClose} />}
|
{activePage === SettingsPages.AboutPage && <About requestClose={handlePageRequestClose} />}
|
||||||
</PageRoot>
|
</PageRoot>
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ function ProfileDisplayName({ profile, userId }: ProfileProps) {
|
|||||||
<SettingTile
|
<SettingTile
|
||||||
title={
|
title={
|
||||||
<Text as="span" size="L400">
|
<Text as="span" size="L400">
|
||||||
Display Name
|
Display name
|
||||||
</Text>
|
</Text>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -576,7 +576,7 @@ function ProfileStatus() {
|
|||||||
<SettingTile
|
<SettingTile
|
||||||
title={
|
title={
|
||||||
<Text as="span" size="L400">
|
<Text as="span" size="L400">
|
||||||
Status Message
|
Status message
|
||||||
</Text>
|
</Text>
|
||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ export function ProfileDecoration() {
|
|||||||
|
|
||||||
const [current, setCurrent] = useState<string | null>(null);
|
const [current, setCurrent] = useState<string | null>(null);
|
||||||
const [selected, setSelected] = useState<string | null>(null);
|
const [selected, setSelected] = useState<string | null>(null);
|
||||||
|
// [Gitea #460] The catalog stays closed until "Change"; it was always open.
|
||||||
|
const [browsing, setBrowsing] = useState(false);
|
||||||
// Distinguish "confirmed no decoration" from "failed to load": a fetch
|
// Distinguish "confirmed no decoration" from "failed to load": a fetch
|
||||||
// failure must not be shown as (and saved over) "None".
|
// failure must not be shown as (and saved over) "None".
|
||||||
const [loadError, setLoadError] = useState(false);
|
const [loadError, setLoadError] = useState(false);
|
||||||
@@ -199,7 +201,7 @@ export function ProfileDecoration() {
|
|||||||
<SettingTile
|
<SettingTile
|
||||||
title={
|
title={
|
||||||
<Text as="span" size="L400">
|
<Text as="span" size="L400">
|
||||||
Avatar Decoration
|
Avatar decoration
|
||||||
</Text>
|
</Text>
|
||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
@@ -282,6 +284,20 @@ export function ProfileDecoration() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
{!loadError && (
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
size="300"
|
||||||
|
radii="300"
|
||||||
|
variant="Secondary"
|
||||||
|
fill="Soft"
|
||||||
|
outlined
|
||||||
|
aria-expanded={browsing}
|
||||||
|
onClick={() => setBrowsing((b) => !b)}
|
||||||
|
>
|
||||||
|
<Text size="B300">{browsing ? 'Done' : 'Change'}</Text>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
{hasChanges && !loadError && (
|
{hasChanges && !loadError && (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -324,6 +340,8 @@ export function ProfileDecoration() {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{browsing && (
|
||||||
|
<>
|
||||||
{/* Search + category tabs. Only one category (or the search results)
|
{/* Search + category tabs. Only one category (or the search results)
|
||||||
is mounted at a time so the picker never loads the whole catalog. */}
|
is mounted at a time so the picker never loads the whole catalog. */}
|
||||||
<Input
|
<Input
|
||||||
@@ -391,6 +409,8 @@ export function ProfileDecoration() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</SettingTile>
|
</SettingTile>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState, ReactNode } from 'react';
|
||||||
import { Box, Text, IconButton, Icon, Icons, Scroll, Switch, Button } from 'folds';
|
import { Box, Text, IconButton, Icon, Icons, Scroll, Switch, Button } from 'folds';
|
||||||
import { Page, PageContent, PageHeader } from '../../../components/page';
|
import { Page, PageContent, PageHeader } from '../../../components/page';
|
||||||
import { SequenceCard } from '../../../components/sequence-card';
|
import { SequenceCard } from '../../../components/sequence-card';
|
||||||
@@ -18,8 +18,12 @@ import { CryptoDiagnostics } from '../developer/CryptoDiagnostics';
|
|||||||
|
|
||||||
type DeveloperToolsProps = {
|
type DeveloperToolsProps = {
|
||||||
requestClose: () => void;
|
requestClose: () => void;
|
||||||
|
/** [Gitea #459] Shown as the page title (the menu entry's name). */
|
||||||
|
title?: string;
|
||||||
|
/** [Gitea #459] Sections shown above this page's own. */
|
||||||
|
before?: ReactNode;
|
||||||
};
|
};
|
||||||
export function DeveloperTools({ requestClose }: DeveloperToolsProps) {
|
export function DeveloperTools({ requestClose, title, before }: DeveloperToolsProps) {
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
const [developerTools, setDeveloperTools] = useSetting(settingsAtom, 'developerTools');
|
const [developerTools, setDeveloperTools] = useSetting(settingsAtom, 'developerTools');
|
||||||
const [expand, setExpend] = useState(false);
|
const [expand, setExpend] = useState(false);
|
||||||
@@ -49,7 +53,7 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) {
|
|||||||
<Box grow="Yes" gap="200">
|
<Box grow="Yes" gap="200">
|
||||||
<Box grow="Yes" alignItems="Center" gap="200">
|
<Box grow="Yes" alignItems="Center" gap="200">
|
||||||
<Text size="H3" truncate>
|
<Text size="H3" truncate>
|
||||||
Developer Tools
|
{title ?? 'Developer Tools'}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box shrink="No">
|
<Box shrink="No">
|
||||||
@@ -63,6 +67,7 @@ export function DeveloperTools({ requestClose }: DeveloperToolsProps) {
|
|||||||
<Scroll hideTrack visibility="Hover">
|
<Scroll hideTrack visibility="Hover">
|
||||||
<PageContent>
|
<PageContent>
|
||||||
<Box direction="Column" gap="700">
|
<Box direction="Column" gap="700">
|
||||||
|
{before}
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
<Text size="L400">Options</Text>
|
<Text size="L400">Options</Text>
|
||||||
<SequenceCard
|
<SequenceCard
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ function DeviceRename({ device, onCancel, onRename, refreshDeviceList }: DeviceR
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box as="form" onSubmit={handleSubmit} direction="Column" gap="100">
|
<Box as="form" onSubmit={handleSubmit} direction="Column" gap="100">
|
||||||
<Text size="L400">Device Name</Text>
|
<Text size="L400">Device name</Text>
|
||||||
<Box gap="200">
|
<Box gap="200">
|
||||||
<Box grow="Yes" direction="Column">
|
<Box grow="Yes" direction="Column">
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { Box, Text, IconButton, Icon, Icons, Scroll } from 'folds';
|
import { Box, Text, IconButton, Icon, Icons, Scroll } from 'folds';
|
||||||
import { Page, PageContent, PageHeader } from '../../../components/page';
|
import { Page, PageContent, PageHeader } from '../../../components/page';
|
||||||
import { SequenceCard } from '../../../components/sequence-card';
|
import { SequenceCard } from '../../../components/sequence-card';
|
||||||
@@ -38,8 +38,12 @@ function DevicesPlaceholder() {
|
|||||||
|
|
||||||
type DevicesProps = {
|
type DevicesProps = {
|
||||||
requestClose: () => void;
|
requestClose: () => void;
|
||||||
|
/** [Gitea #459] Shown as the page title (the menu entry's name). */
|
||||||
|
title?: string;
|
||||||
|
/** [Gitea #459] Sections shown above this page's own. */
|
||||||
|
before?: ReactNode;
|
||||||
};
|
};
|
||||||
export function Devices({ requestClose }: DevicesProps) {
|
export function Devices({ requestClose, title, before }: DevicesProps) {
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
const crypto = mx.getCrypto();
|
const crypto = mx.getCrypto();
|
||||||
const crossSigningActive = useCrossSigningActive();
|
const crossSigningActive = useCrossSigningActive();
|
||||||
@@ -70,7 +74,7 @@ export function Devices({ requestClose }: DevicesProps) {
|
|||||||
<Box grow="Yes" gap="200">
|
<Box grow="Yes" gap="200">
|
||||||
<Box grow="Yes" alignItems="Center" gap="200">
|
<Box grow="Yes" alignItems="Center" gap="200">
|
||||||
<Text size="H3" truncate>
|
<Text size="H3" truncate>
|
||||||
Devices
|
{title ?? 'Devices'}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box shrink="No">
|
<Box shrink="No">
|
||||||
@@ -84,6 +88,7 @@ export function Devices({ requestClose }: DevicesProps) {
|
|||||||
<Scroll hideTrack visibility="Hover">
|
<Scroll hideTrack visibility="Hover">
|
||||||
<PageContent>
|
<PageContent>
|
||||||
<Box direction="Column" gap="700">
|
<Box direction="Column" gap="700">
|
||||||
|
{before}
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
<Text size="L400">Security</Text>
|
<Text size="L400">Security</Text>
|
||||||
<SequenceCard
|
<SequenceCard
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function ExportKeys() {
|
|||||||
{(match, doMatch, passRef, confPassRef) => (
|
{(match, doMatch, passRef, confPassRef) => (
|
||||||
<>
|
<>
|
||||||
<Box grow="Yes" direction="Column" gap="100">
|
<Box grow="Yes" direction="Column" gap="100">
|
||||||
<Text size="L400">New Password</Text>
|
<Text size="L400">New password</Text>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
ref={passRef}
|
ref={passRef}
|
||||||
name="passwordInput"
|
name="passwordInput"
|
||||||
@@ -82,7 +82,7 @@ function ExportKeys() {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Box grow="Yes" direction="Column" gap="100">
|
<Box grow="Yes" direction="Column" gap="100">
|
||||||
<Text size="L400">Confirm Password</Text>
|
<Text size="L400">Confirm password</Text>
|
||||||
<PasswordInput
|
<PasswordInput
|
||||||
ref={confPassRef}
|
ref={confPassRef}
|
||||||
style={{ color: match ? undefined : color.Critical.Main }}
|
style={{ color: match ? undefined : color.Critical.Main }}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import React, {
|
|||||||
FormEventHandler,
|
FormEventHandler,
|
||||||
KeyboardEventHandler,
|
KeyboardEventHandler,
|
||||||
MouseEventHandler,
|
MouseEventHandler,
|
||||||
|
ReactNode,
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
@@ -32,6 +33,7 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
Text,
|
Text,
|
||||||
toRem,
|
toRem,
|
||||||
|
RadioButton,
|
||||||
} from 'folds';
|
} from 'folds';
|
||||||
import { isKeyHotkey } from 'is-hotkey';
|
import { isKeyHotkey } from 'is-hotkey';
|
||||||
import { HexColorPicker } from 'react-colorful';
|
import { HexColorPicker } from 'react-colorful';
|
||||||
@@ -543,7 +545,7 @@ function PageZoomInput() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Appearance() {
|
export function Appearance() {
|
||||||
const [systemTheme, setSystemTheme] = useSetting(settingsAtom, 'useSystemTheme');
|
const [systemTheme, setSystemTheme] = useSetting(settingsAtom, 'useSystemTheme');
|
||||||
const allThemes = useThemes();
|
const allThemes = useThemes();
|
||||||
const [themeId, setThemeId] = useSetting(settingsAtom, 'themeId');
|
const [themeId, setThemeId] = useSetting(settingsAtom, 'themeId');
|
||||||
@@ -595,7 +597,7 @@ function Appearance() {
|
|||||||
settingsAtom,
|
settingsAtom,
|
||||||
'seasonalThemeOverride',
|
'seasonalThemeOverride',
|
||||||
);
|
);
|
||||||
const [, setChatBackground] = useSetting(settingsAtom, 'chatBackground');
|
const [chatBackground, setChatBackground] = useSetting(settingsAtom, 'chatBackground');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
@@ -672,13 +674,13 @@ function Appearance() {
|
|||||||
direction="Column"
|
direction="Column"
|
||||||
gap="200"
|
gap="200"
|
||||||
>
|
>
|
||||||
<SettingTile
|
<CollapsiblePicker
|
||||||
title="Chat background"
|
title="Chat background"
|
||||||
description="Pattern applied behind the message timeline."
|
description="Pattern applied behind the message timeline."
|
||||||
/>
|
current={BG_OPTIONS.find((o) => o.value === chatBackground)?.label ?? 'None'}
|
||||||
<Box style={{ padding: `0 ${config.space.S400} ${config.space.S300}` }}>
|
>
|
||||||
<ChatBgGrid />
|
<ChatBgGrid />
|
||||||
</Box>
|
</CollapsiblePicker>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
@@ -695,11 +697,14 @@ function Appearance() {
|
|||||||
direction="Column"
|
direction="Column"
|
||||||
gap="200"
|
gap="200"
|
||||||
>
|
>
|
||||||
<SettingTile
|
<CollapsiblePicker
|
||||||
title="Seasonal theme"
|
title="Seasonal theme"
|
||||||
description="Decorative overlays for holidays and events. “Auto” follows the calendar — each theme below shows the dates it turns on. Click to select."
|
description="Decorative overlays for holidays and events. Auto follows the calendar."
|
||||||
/>
|
current={
|
||||||
<Box style={{ padding: `0 ${config.space.S400} ${config.space.S300}` }}>
|
SEASONAL_OPTIONS.find((o) => o.value === (seasonalThemeOverride ?? 'auto'))?.label ??
|
||||||
|
'Auto'
|
||||||
|
}
|
||||||
|
>
|
||||||
<SeasonalBgGrid
|
<SeasonalBgGrid
|
||||||
value={seasonalThemeOverride ?? 'auto'}
|
value={seasonalThemeOverride ?? 'auto'}
|
||||||
onChange={(v) => {
|
onChange={(v) => {
|
||||||
@@ -711,7 +716,7 @@ function Appearance() {
|
|||||||
if (v !== 'off') setChatBackground('none');
|
if (v !== 'off') setChatBackground('none');
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</CollapsiblePicker>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
@@ -1308,7 +1313,7 @@ function SelectDateFormat() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DateAndTime() {
|
export function DateAndTime() {
|
||||||
const [hour24Clock, setHour24Clock] = useSetting(settingsAtom, 'hour24Clock');
|
const [hour24Clock, setHour24Clock] = useSetting(settingsAtom, 'hour24Clock');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -1487,7 +1492,7 @@ function ComposerToolbarReorder({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Editor() {
|
export function Editor() {
|
||||||
const [enterForNewline, setEnterForNewline] = useSetting(settingsAtom, 'enterForNewline');
|
const [enterForNewline, setEnterForNewline] = useSetting(settingsAtom, 'enterForNewline');
|
||||||
const [isMarkdown, setIsMarkdown] = useSetting(settingsAtom, 'isMarkdown');
|
const [isMarkdown, setIsMarkdown] = useSetting(settingsAtom, 'isMarkdown');
|
||||||
const [offerCodePaste, setOfferCodePaste] = useSetting(settingsAtom, 'offerCodePaste');
|
const [offerCodePaste, setOfferCodePaste] = useSetting(settingsAtom, 'offerCodePaste');
|
||||||
@@ -1578,7 +1583,7 @@ function Editor() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Privacy() {
|
export function Privacy() {
|
||||||
const [hideActivity, setHideActivity] = useSetting(settingsAtom, 'hideActivity');
|
const [hideActivity, setHideActivity] = useSetting(settingsAtom, 'hideActivity');
|
||||||
const [hidePresence, setHidePresence] = useSetting(settingsAtom, 'hidePresence');
|
const [hidePresence, setHidePresence] = useSetting(settingsAtom, 'hidePresence');
|
||||||
const [privateReadReceipts, setPrivateReadReceipts] = useSetting(
|
const [privateReadReceipts, setPrivateReadReceipts] = useSetting(
|
||||||
@@ -1589,7 +1594,19 @@ function Privacy() {
|
|||||||
settingsAtom,
|
settingsAtom,
|
||||||
'warnOnUnverifiedDevices',
|
'warnOnUnverifiedDevices',
|
||||||
);
|
);
|
||||||
|
const [urlPreview, setUrlPreview] = useSetting(settingsAtom, 'urlPreview');
|
||||||
|
const [encUrlPreview, setEncUrlPreview] = useSetting(settingsAtom, 'encUrlPreview');
|
||||||
const [stripTracking, setStripTracking] = useSetting(settingsAtom, 'stripTrackingParams');
|
const [stripTracking, setStripTracking] = useSetting(settingsAtom, 'stripTrackingParams');
|
||||||
|
// [Gitea #461] One choice instead of two overlapping switches. Maps onto the
|
||||||
|
// existing settings, so every old combination keeps its behaviour:
|
||||||
|
// hideActivity also hides typing and other people's receipts from you.
|
||||||
|
let activity: 'everyone' | 'private' | 'hidden' = 'everyone';
|
||||||
|
if (hideActivity) activity = 'hidden';
|
||||||
|
else if (privateReadReceipts) activity = 'private';
|
||||||
|
const chooseActivity = (next: typeof activity) => {
|
||||||
|
setHideActivity(next === 'hidden');
|
||||||
|
setPrivateReadReceipts(next !== 'everyone');
|
||||||
|
};
|
||||||
const [stripImageMeta, setStripImageMeta] = useSetting(settingsAtom, 'stripImageMetadata');
|
const [stripImageMeta, setStripImageMeta] = useSetting(settingsAtom, 'stripImageMetadata');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -1611,24 +1628,88 @@ function Privacy() {
|
|||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Hide typing and read receipts"
|
title="Link previews"
|
||||||
description="Turn off both typing status and read receipts to keep your activity private."
|
description="Your homeserver fetches and caches link previews. It will see the URLs of all links you preview."
|
||||||
after={<Switch variant="Primary" value={hideActivity} onChange={setHideActivity} />}
|
after={<Switch variant="Primary" value={urlPreview} onChange={setUrlPreview} />}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Private read receipts"
|
title="Link previews in encrypted rooms"
|
||||||
description="Send read receipts only to you and the server — other users won't see when you've read messages."
|
description={
|
||||||
after={
|
<Box direction="Column" gap="100">
|
||||||
<Switch
|
<Text size="T200" priority="300">
|
||||||
variant="Primary"
|
Your homeserver fetches link previews on your behalf. It cannot decrypt your
|
||||||
value={privateReadReceipts}
|
messages, but will see every URL you preview in encrypted rooms, potentially
|
||||||
onChange={setPrivateReadReceipts}
|
revealing conversation topics.
|
||||||
/>
|
</Text>
|
||||||
|
<Chip
|
||||||
|
variant="Warning"
|
||||||
|
fill="Soft"
|
||||||
|
radii="300"
|
||||||
|
size="400"
|
||||||
|
style={{ alignSelf: 'flex-start' }}
|
||||||
|
>
|
||||||
|
<Text size="T200">Privacy risk — enabled by default</Text>
|
||||||
|
</Chip>
|
||||||
|
</Box>
|
||||||
}
|
}
|
||||||
|
after={<Switch variant="Primary" value={encUrlPreview} onChange={setEncUrlPreview} />}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
<SequenceCard
|
||||||
|
className={SequenceCardStyle}
|
||||||
|
variant="SurfaceVariant"
|
||||||
|
direction="Column"
|
||||||
|
gap="300"
|
||||||
|
>
|
||||||
|
<SettingTile
|
||||||
|
title="Read receipts and typing"
|
||||||
|
description="Who can see that you've read a message or are typing."
|
||||||
|
/>
|
||||||
|
<Box
|
||||||
|
direction="Column"
|
||||||
|
gap="200"
|
||||||
|
role="radiogroup"
|
||||||
|
aria-label="Read receipts and typing"
|
||||||
|
style={{ padding: `0 ${config.space.S400} ${config.space.S300}` }}
|
||||||
|
>
|
||||||
|
{(
|
||||||
|
[
|
||||||
|
['everyone', 'Everyone', "Others see what you've read and when you're typing."],
|
||||||
|
[
|
||||||
|
'private',
|
||||||
|
'Private read receipts',
|
||||||
|
"Others don't see what you've read (only you and your server do). Typing still shows.",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'hidden',
|
||||||
|
'Hide my activity',
|
||||||
|
"No typing indicator and private read receipts. You also won't see other people's read receipts.",
|
||||||
|
],
|
||||||
|
] as const
|
||||||
|
).map(([value, label, help]) => (
|
||||||
|
<label
|
||||||
|
key={value}
|
||||||
|
style={{ display: 'flex', gap: config.space.S200, cursor: 'pointer' }}
|
||||||
|
>
|
||||||
|
<RadioButton
|
||||||
|
name="activity-privacy"
|
||||||
|
variant="Primary"
|
||||||
|
size="300"
|
||||||
|
checked={activity === value}
|
||||||
|
onClick={() => chooseActivity(value)}
|
||||||
|
/>
|
||||||
|
<Box direction="Column">
|
||||||
|
<Text size="T300">{label}</Text>
|
||||||
|
<Text size="T200" priority="300">
|
||||||
|
{help}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
</label>
|
||||||
|
))}
|
||||||
|
</Box>
|
||||||
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Hide online status"
|
title="Hide online status"
|
||||||
@@ -1655,7 +1736,7 @@ function Privacy() {
|
|||||||
|
|
||||||
// [Gitea #104] Sync toggle + the two manual actions. The toggle is itself
|
// [Gitea #104] Sync toggle + the two manual actions. The toggle is itself
|
||||||
// device-local (never synced) so switching it off here sticks.
|
// device-local (never synced) so switching it off here sticks.
|
||||||
function SettingsSyncSection() {
|
export function SettingsSyncSection() {
|
||||||
const isMobile = useScreenSize() === ScreenSize.Mobile;
|
const isMobile = useScreenSize() === ScreenSize.Mobile;
|
||||||
const [settingsSync, setSettingsSync] = useSetting(settingsAtom, 'settingsSync');
|
const [settingsSync, setSettingsSync] = useSetting(settingsAtom, 'settingsSync');
|
||||||
const { pushNow, clearRemote } = useSettingsSyncActions();
|
const { pushNow, clearRemote } = useSettingsSyncActions();
|
||||||
@@ -1788,7 +1869,7 @@ function useKeyBind(setter: (code: string) => void, otherKey?: string) {
|
|||||||
const keyLabel = (code: string) =>
|
const keyLabel = (code: string) =>
|
||||||
code === 'Space' ? 'Space' : code.replace('Key', '').replace('Digit', '');
|
code === 'Space' ? 'Space' : code.replace('Key', '').replace('Digit', '');
|
||||||
|
|
||||||
function Calls() {
|
export function Calls() {
|
||||||
const [cameraOnJoin, setCameraOnJoin] = useSetting(settingsAtom, 'cameraOnJoin');
|
const [cameraOnJoin, setCameraOnJoin] = useSetting(settingsAtom, 'cameraOnJoin');
|
||||||
const [callNoiseSuppression, setCallNoiseSuppression] = useSetting(
|
const [callNoiseSuppression, setCallNoiseSuppression] = useSetting(
|
||||||
settingsAtom,
|
settingsAtom,
|
||||||
@@ -1852,8 +1933,10 @@ function Calls() {
|
|||||||
const selectedDenoiseModel = DENOISE_MODELS.find((m) => m.id === callDenoiseModel);
|
const selectedDenoiseModel = DENOISE_MODELS.find((m) => m.id === callDenoiseModel);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
// [Gitea #462] Fixed groups in every mode (it was one flat list).
|
||||||
|
<Box direction="Column" gap="700">
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
<Text size="L400">Calls</Text>
|
<Text size="L400">Joining</Text>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Join with camera on"
|
title="Join with camera on"
|
||||||
@@ -1861,6 +1944,38 @@ function Calls() {
|
|||||||
after={<Switch variant="Primary" value={cameraOnJoin} onChange={setCameraOnJoin} />}
|
after={<Switch variant="Primary" value={cameraOnJoin} onChange={setCameraOnJoin} />}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
<SequenceCard
|
||||||
|
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
||||||
|
variant="SurfaceVariant"
|
||||||
|
direction="Column"
|
||||||
|
gap="400"
|
||||||
|
>
|
||||||
|
<SettingTile
|
||||||
|
title="Rejoin calls after a restart"
|
||||||
|
description="If Lotus crashes, reloads or restarts for an update while you are in a voice room, put you back in."
|
||||||
|
after={
|
||||||
|
<SettingsSelect<'ask' | 'auto' | 'off'>
|
||||||
|
value={callRejoin}
|
||||||
|
onChange={setCallRejoin}
|
||||||
|
options={[
|
||||||
|
{ value: 'ask', label: 'Ask' },
|
||||||
|
{ value: 'auto', label: 'Rejoin automatically' },
|
||||||
|
{ value: 'off', label: 'Do nothing' },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<SettingTile
|
||||||
|
title="Summary after calls"
|
||||||
|
description="When a call ends, show how long it was and how the connection held up, with a Details button for who was there, network numbers and your own talk/mute time."
|
||||||
|
after={
|
||||||
|
<Switch variant="Primary" value={callSummaryToast} onChange={setCallSummaryToast} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Microphone and noise</Text>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Noise suppression"
|
title="Noise suppression"
|
||||||
@@ -1868,8 +1983,9 @@ function Calls() {
|
|||||||
<Box direction="Column" gap="200">
|
<Box direction="Column" gap="200">
|
||||||
{/* [Gitea #271] T200 like every other setting description. */}
|
{/* [Gitea #271] T200 like every other setting description. */}
|
||||||
<Text size="T200">
|
<Text size="T200">
|
||||||
Filter background noise from your mic during calls. Browser-native uses the built-in
|
Filter background noise from your mic during calls. Browser-native uses the
|
||||||
WebRTC suppressor (Google NSNet2). ML runs a dedicated model for stronger removal.
|
built-in WebRTC suppressor (Google NSNet2). ML runs a dedicated model for stronger
|
||||||
|
removal.
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{!mlSupported && (
|
{!mlSupported && (
|
||||||
@@ -2051,7 +2167,11 @@ function Calls() {
|
|||||||
title="Noise gate"
|
title="Noise gate"
|
||||||
description="Hard-cut audio when you aren't speaking to ensure absolute silence between sentences."
|
description="Hard-cut audio when you aren't speaking to ensure absolute silence between sentences."
|
||||||
after={
|
after={
|
||||||
<Switch variant="Primary" value={callDenoiseGate} onChange={setCallDenoiseGate} />
|
<Switch
|
||||||
|
variant="Primary"
|
||||||
|
value={callDenoiseGate}
|
||||||
|
onChange={setCallDenoiseGate}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -2086,8 +2206,8 @@ function Calls() {
|
|||||||
>
|
>
|
||||||
<Text size="L400">Test and calibrate</Text>
|
<Text size="L400">Test and calibrate</Text>
|
||||||
<Text size="T200" priority="300">
|
<Text size="T200" priority="300">
|
||||||
Audition the selected model and tune the gate without joining a call. Changes to the
|
Audition the selected model and tune the gate without joining a call. Changes to
|
||||||
settings above apply the next time you start a monitor or play a clip.
|
the settings above apply the next time you start a monitor or play a clip.
|
||||||
</Text>
|
</Text>
|
||||||
<DenoiseTester
|
<DenoiseTester
|
||||||
model={callDenoiseModel}
|
model={callDenoiseModel}
|
||||||
@@ -2099,115 +2219,6 @@ function Calls() {
|
|||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard
|
|
||||||
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
|
||||||
variant="SurfaceVariant"
|
|
||||||
direction="Column"
|
|
||||||
gap="400"
|
|
||||||
>
|
|
||||||
<SettingTile
|
|
||||||
title="Rejoin calls after a restart"
|
|
||||||
description="If Lotus crashes, reloads or restarts for an update while you are in a voice room, put you back in."
|
|
||||||
after={
|
|
||||||
<SettingsSelect<'ask' | 'auto' | 'off'>
|
|
||||||
value={callRejoin}
|
|
||||||
onChange={setCallRejoin}
|
|
||||||
options={[
|
|
||||||
{ value: 'ask', label: 'Ask' },
|
|
||||||
{ value: 'auto', label: 'Rejoin automatically' },
|
|
||||||
{ value: 'off', label: 'Do nothing' },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<SettingTile
|
|
||||||
title="Summary after calls"
|
|
||||||
description="When a call ends, show how long it was and how the connection held up, with a Details button for who was there, network numbers and your own talk/mute time."
|
|
||||||
after={
|
|
||||||
<Switch variant="Primary" value={callSummaryToast} onChange={setCallSummaryToast} />
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{hapticsSupported() && (
|
|
||||||
<SettingTile
|
|
||||||
title="Haptic feedback"
|
|
||||||
description="A short vibration when push-to-talk engages or releases and when you send a reaction. Off automatically when your system prefers reduced motion."
|
|
||||||
after={<Switch variant="Primary" value={haptics} onChange={setHaptics} />}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<SettingTile
|
|
||||||
title="Push to talk"
|
|
||||||
description="Mute your microphone by default. Hold the PTT key to speak."
|
|
||||||
after={<Switch variant="Primary" value={pttMode} onChange={setPttMode} />}
|
|
||||||
/>
|
|
||||||
{pttMode && (
|
|
||||||
<SettingTile
|
|
||||||
title="Push-to-talk key"
|
|
||||||
description={pttBind.error ?? 'Press a key to bind it as your push-to-talk key.'}
|
|
||||||
after={
|
|
||||||
<Button
|
|
||||||
size="300"
|
|
||||||
variant={pttBind.listening ? 'Warning' : 'Secondary'}
|
|
||||||
fill={pttBind.listening ? 'Solid' : 'Soft'}
|
|
||||||
radii="300"
|
|
||||||
outlined
|
|
||||||
onClick={pttBind.startListening}
|
|
||||||
style={{ minWidth: '90px' }}
|
|
||||||
>
|
|
||||||
<Text size="B300">{pttBind.listening ? 'Press a key…' : keyLabel(pttKey)}</Text>
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<SettingTile
|
|
||||||
title="Push to deafen"
|
|
||||||
description={
|
|
||||||
deafenBind.error ??
|
|
||||||
(deafenHotkey
|
|
||||||
? `${
|
|
||||||
// [Gitea #279] The Escape hint only applies while rebinding.
|
|
||||||
deafenBind.listening
|
|
||||||
? 'Press a key to bind it, or Escape to cancel.'
|
|
||||||
: `Press ${keyLabel(deafenKey)} during a call to mute your speakers.`
|
|
||||||
}${
|
|
||||||
!isSafeGlobalToggleKey(deafenKey)
|
|
||||||
? ` A letter, digit or Space only works in the call view — on a chat screen typing takes priority${
|
|
||||||
isTauriEnv() && globalCallHotkeys ? ' and other apps are never watched' : ''
|
|
||||||
}. Bind an F-key or Numpad key to make it work everywhere.`
|
|
||||||
: ''
|
|
||||||
}`
|
|
||||||
: 'Off — no key toggles deafen. Use the headphone button in the call bar.')
|
|
||||||
}
|
|
||||||
after={
|
|
||||||
<Box alignItems="Center" gap="200">
|
|
||||||
<Switch variant="Primary" value={deafenHotkey} onChange={setDeafenHotkey} />
|
|
||||||
{deafenHotkey && (
|
|
||||||
<Button
|
|
||||||
size="300"
|
|
||||||
variant={deafenBind.listening ? 'Warning' : 'Secondary'}
|
|
||||||
fill={deafenBind.listening ? 'Solid' : 'Soft'}
|
|
||||||
radii="300"
|
|
||||||
outlined
|
|
||||||
onClick={deafenBind.startListening}
|
|
||||||
style={{ minWidth: '90px' }}
|
|
||||||
>
|
|
||||||
<Text size="B300">
|
|
||||||
{deafenBind.listening ? 'Press a key…' : keyLabel(deafenKey)}
|
|
||||||
</Text>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{isTauriEnv() && (
|
|
||||||
<SettingTile
|
|
||||||
title="Hotkeys work outside the window"
|
|
||||||
description="Keep Push to Talk and Push to Deafen working while a game or another app has focus. The keys are only watched during a call and are never blocked from other apps. Windows only; some anti-cheat systems may prevent it."
|
|
||||||
after={
|
|
||||||
<Switch variant="Primary" value={globalCallHotkeys} onChange={setGlobalCallHotkeys} />
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</SequenceCard>
|
|
||||||
<SequenceCard
|
<SequenceCard
|
||||||
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
||||||
variant="SurfaceVariant"
|
variant="SurfaceVariant"
|
||||||
@@ -2246,6 +2257,105 @@ function Calls() {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Push to talk and hotkeys</Text>
|
||||||
|
<SequenceCard
|
||||||
|
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
||||||
|
variant="SurfaceVariant"
|
||||||
|
direction="Column"
|
||||||
|
gap="400"
|
||||||
|
>
|
||||||
|
<SettingTile
|
||||||
|
title="Push to talk"
|
||||||
|
description="Mute your microphone by default. Hold the PTT key to speak."
|
||||||
|
after={<Switch variant="Primary" value={pttMode} onChange={setPttMode} />}
|
||||||
|
/>
|
||||||
|
{pttMode && (
|
||||||
|
<SettingTile
|
||||||
|
title="Push-to-talk key"
|
||||||
|
description={pttBind.error ?? 'Press a key to bind it as your push-to-talk key.'}
|
||||||
|
after={
|
||||||
|
<Button
|
||||||
|
size="300"
|
||||||
|
variant={pttBind.listening ? 'Warning' : 'Secondary'}
|
||||||
|
fill={pttBind.listening ? 'Solid' : 'Soft'}
|
||||||
|
radii="300"
|
||||||
|
outlined
|
||||||
|
onClick={pttBind.startListening}
|
||||||
|
style={{ minWidth: '90px' }}
|
||||||
|
>
|
||||||
|
<Text size="B300">{pttBind.listening ? 'Press a key…' : keyLabel(pttKey)}</Text>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<SettingTile
|
||||||
|
title="Push to deafen"
|
||||||
|
description={
|
||||||
|
deafenBind.error ??
|
||||||
|
(deafenHotkey
|
||||||
|
? `${
|
||||||
|
// [Gitea #279] The Escape hint only applies while rebinding.
|
||||||
|
deafenBind.listening
|
||||||
|
? 'Press a key to bind it, or Escape to cancel.'
|
||||||
|
: `Press ${keyLabel(deafenKey)} during a call to mute your speakers.`
|
||||||
|
}${
|
||||||
|
!isSafeGlobalToggleKey(deafenKey)
|
||||||
|
? ` A letter, digit or Space only works in the call view — on a chat screen typing takes priority${
|
||||||
|
isTauriEnv() && globalCallHotkeys
|
||||||
|
? ' and other apps are never watched'
|
||||||
|
: ''
|
||||||
|
}. Bind an F-key or Numpad key to make it work everywhere.`
|
||||||
|
: ''
|
||||||
|
}`
|
||||||
|
: 'Off — no key toggles deafen. Use the headphone button in the call bar.')
|
||||||
|
}
|
||||||
|
after={
|
||||||
|
<Box alignItems="Center" gap="200">
|
||||||
|
<Switch variant="Primary" value={deafenHotkey} onChange={setDeafenHotkey} />
|
||||||
|
{deafenHotkey && (
|
||||||
|
<Button
|
||||||
|
size="300"
|
||||||
|
variant={deafenBind.listening ? 'Warning' : 'Secondary'}
|
||||||
|
fill={deafenBind.listening ? 'Solid' : 'Soft'}
|
||||||
|
radii="300"
|
||||||
|
outlined
|
||||||
|
onClick={deafenBind.startListening}
|
||||||
|
style={{ minWidth: '90px' }}
|
||||||
|
>
|
||||||
|
<Text size="B300">
|
||||||
|
{deafenBind.listening ? 'Press a key…' : keyLabel(deafenKey)}
|
||||||
|
</Text>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{isTauriEnv() && (
|
||||||
|
<SettingTile
|
||||||
|
title="Hotkeys work outside the window"
|
||||||
|
description="Keep Push to Talk and Push to Deafen working while a game or another app has focus. The keys are only watched during a call and are never blocked from other apps. Windows only; some anti-cheat systems may prevent it."
|
||||||
|
after={
|
||||||
|
<Switch
|
||||||
|
variant="Primary"
|
||||||
|
value={globalCallHotkeys}
|
||||||
|
onChange={setGlobalCallHotkeys}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{hapticsSupported() && (
|
||||||
|
<SettingTile
|
||||||
|
title="Haptic feedback"
|
||||||
|
description="A short vibration when push-to-talk engages or releases and when you send a reaction. Off automatically when your system prefers reduced motion."
|
||||||
|
after={<Switch variant="Primary" value={haptics} onChange={setHaptics} />}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Sounds</Text>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Ringtone"
|
title="Ringtone"
|
||||||
@@ -2260,7 +2370,10 @@ function Calls() {
|
|||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile title="Ringtone volume" description="Volume of the incoming call ringtone." />
|
<SettingTile
|
||||||
|
title="Ringtone volume"
|
||||||
|
description="Volume of the incoming call ringtone."
|
||||||
|
/>
|
||||||
<Box
|
<Box
|
||||||
direction="Row"
|
direction="Row"
|
||||||
alignItems="Center"
|
alignItems="Center"
|
||||||
@@ -2289,7 +2402,9 @@ function Calls() {
|
|||||||
after={
|
after={
|
||||||
<SettingsSelect
|
<SettingsSelect
|
||||||
value={callJoinLeaveSound}
|
value={callJoinLeaveSound}
|
||||||
onChange={(v) => handleJoinLeaveSoundChange(v as 'off' | 'chime' | 'soft' | 'retro')}
|
onChange={(v) =>
|
||||||
|
handleJoinLeaveSoundChange(v as 'off' | 'chime' | 'soft' | 'retro')
|
||||||
|
}
|
||||||
options={[
|
options={[
|
||||||
{ value: 'off', label: 'Off' },
|
{ value: 'off', label: 'Off' },
|
||||||
{ value: 'chime', label: 'Chime' },
|
{ value: 'chime', label: 'Chime' },
|
||||||
@@ -2300,7 +2415,9 @@ function Calls() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Quality</Text>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Microphone bitrate"
|
title="Microphone bitrate"
|
||||||
@@ -2314,7 +2431,6 @@ function Calls() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Screen share bitrate"
|
title="Screen share bitrate"
|
||||||
@@ -2328,7 +2444,6 @@ function Calls() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Screen share frame rate"
|
title="Screen share frame rate"
|
||||||
@@ -2342,7 +2457,9 @@ function Calls() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Soundboard</Text>
|
||||||
<SequenceCard
|
<SequenceCard
|
||||||
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
className={`${SequenceCardStyle} ${SettingTileGroup}`}
|
||||||
variant="SurfaceVariant"
|
variant="SurfaceVariant"
|
||||||
@@ -2381,6 +2498,7 @@ function Calls() {
|
|||||||
)}
|
)}
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
</Box>
|
</Box>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2404,6 +2522,65 @@ const SEASONAL_OPTIONS: {
|
|||||||
{ value: 'deepspace', label: 'Deep Space', emoji: '🚀' },
|
{ value: 'deepspace', label: 'Deep Space', emoji: '🚀' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [Gitea #460] A picker grid behind one row: the current choice and a Change
|
||||||
|
* button. The big grids (27 backgrounds, 13 seasonal themes) used to be always
|
||||||
|
* open and made Appearance about 2.5 screens long. Closes after a choice.
|
||||||
|
*/
|
||||||
|
export function CollapsiblePicker({
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
current,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
description?: ReactNode;
|
||||||
|
current: string;
|
||||||
|
children: ReactNode;
|
||||||
|
}) {
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const [openedWith, setOpenedWith] = useState(current);
|
||||||
|
useEffect(() => {
|
||||||
|
if (open && current !== openedWith) setOpen(false);
|
||||||
|
}, [open, current, openedWith]);
|
||||||
|
const id = `picker-${title.replace(/[^a-z0-9]+/gi, '-').toLowerCase()}`;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SettingTile
|
||||||
|
title={title}
|
||||||
|
description={description}
|
||||||
|
after={
|
||||||
|
<Box alignItems="Center" gap="200" shrink="No">
|
||||||
|
<Text size="T300" priority="300">
|
||||||
|
{current}
|
||||||
|
</Text>
|
||||||
|
<Button
|
||||||
|
size="300"
|
||||||
|
variant="Secondary"
|
||||||
|
fill="Soft"
|
||||||
|
radii="300"
|
||||||
|
outlined
|
||||||
|
aria-expanded={open}
|
||||||
|
aria-controls={id}
|
||||||
|
onClick={() => {
|
||||||
|
setOpenedWith(current);
|
||||||
|
setOpen((o) => !o);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text size="B300">{open ? 'Done' : 'Change'}</Text>
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{open && (
|
||||||
|
<Box id={id} style={{ padding: `0 ${config.space.S400} ${config.space.S300}` }}>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function SeasonalBgGrid({
|
function SeasonalBgGrid({
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
@@ -2663,11 +2840,7 @@ function SelectMessageSpacing() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Messages() {
|
export function Messages() {
|
||||||
const [legacyUsernameColor, setLegacyUsernameColor] = useSetting(
|
|
||||||
settingsAtom,
|
|
||||||
'legacyUsernameColor',
|
|
||||||
);
|
|
||||||
const [hideMembershipEvents, setHideMembershipEvents] = useSetting(
|
const [hideMembershipEvents, setHideMembershipEvents] = useSetting(
|
||||||
settingsAtom,
|
settingsAtom,
|
||||||
'hideMembershipEvents',
|
'hideMembershipEvents',
|
||||||
@@ -2677,10 +2850,7 @@ function Messages() {
|
|||||||
'hideNickAvatarEvents',
|
'hideNickAvatarEvents',
|
||||||
);
|
);
|
||||||
const [mediaAutoLoad, setMediaAutoLoad] = useSetting(settingsAtom, 'mediaAutoLoad');
|
const [mediaAutoLoad, setMediaAutoLoad] = useSetting(settingsAtom, 'mediaAutoLoad');
|
||||||
const [urlPreview, setUrlPreview] = useSetting(settingsAtom, 'urlPreview');
|
|
||||||
const [encUrlPreview, setEncUrlPreview] = useSetting(settingsAtom, 'encUrlPreview');
|
|
||||||
const [inlineMediaEmbeds, setInlineMediaEmbeds] = useSetting(settingsAtom, 'inlineMediaEmbeds');
|
const [inlineMediaEmbeds, setInlineMediaEmbeds] = useSetting(settingsAtom, 'inlineMediaEmbeds');
|
||||||
const [showHiddenEvents, setShowHiddenEvents] = useSetting(settingsAtom, 'showHiddenEvents');
|
|
||||||
const [enforceRetentionLocally, setEnforceRetentionLocally] = useSetting(
|
const [enforceRetentionLocally, setEnforceRetentionLocally] = useSetting(
|
||||||
settingsAtom,
|
settingsAtom,
|
||||||
'enforceRetentionLocally',
|
'enforceRetentionLocally',
|
||||||
@@ -2707,18 +2877,6 @@ function Messages() {
|
|||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile title="Message spacing" after={<SelectMessageSpacing />} />
|
<SettingTile title="Message spacing" after={<SelectMessageSpacing />} />
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
|
||||||
<SettingTile
|
|
||||||
title="Legacy username colour"
|
|
||||||
after={
|
|
||||||
<Switch
|
|
||||||
variant="Primary"
|
|
||||||
value={legacyUsernameColor}
|
|
||||||
onChange={setLegacyUsernameColor}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</SequenceCard>
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Hide joins and leaves"
|
title="Hide joins and leaves"
|
||||||
@@ -2755,37 +2913,6 @@ function Messages() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
|
||||||
<SettingTile
|
|
||||||
title="Link previews"
|
|
||||||
description="Your homeserver fetches and caches link previews. It will see the URLs of all links you preview."
|
|
||||||
after={<Switch variant="Primary" value={urlPreview} onChange={setUrlPreview} />}
|
|
||||||
/>
|
|
||||||
</SequenceCard>
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
|
||||||
<SettingTile
|
|
||||||
title="Link previews in encrypted rooms"
|
|
||||||
description={
|
|
||||||
<Box direction="Column" gap="100">
|
|
||||||
<Text size="T200" priority="300">
|
|
||||||
Your homeserver fetches link previews on your behalf. It cannot decrypt your
|
|
||||||
messages, but will see every URL you preview in encrypted rooms, potentially
|
|
||||||
revealing conversation topics.
|
|
||||||
</Text>
|
|
||||||
<Chip
|
|
||||||
variant="Warning"
|
|
||||||
fill="Soft"
|
|
||||||
radii="300"
|
|
||||||
size="400"
|
|
||||||
style={{ alignSelf: 'flex-start' }}
|
|
||||||
>
|
|
||||||
<Text size="T200">Privacy risk — enabled by default</Text>
|
|
||||||
</Chip>
|
|
||||||
</Box>
|
|
||||||
}
|
|
||||||
after={<Switch variant="Primary" value={encUrlPreview} onChange={setEncUrlPreview} />}
|
|
||||||
/>
|
|
||||||
</SequenceCard>
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Inline media players"
|
title="Inline media players"
|
||||||
@@ -2808,14 +2935,6 @@ function Messages() {
|
|||||||
/>
|
/>
|
||||||
</SequenceCard>
|
</SequenceCard>
|
||||||
)}
|
)}
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
|
||||||
<SettingTile
|
|
||||||
title="Show hidden events"
|
|
||||||
after={
|
|
||||||
<Switch variant="Primary" value={showHiddenEvents} onChange={setShowHiddenEvents} />
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</SequenceCard>
|
|
||||||
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
<SettingTile
|
<SettingTile
|
||||||
title="Enforce message retention"
|
title="Enforce message retention"
|
||||||
@@ -2940,7 +3059,7 @@ function PackageUpdate({ help }: { help: NonNullable<ReturnType<typeof packageUp
|
|||||||
* inside Appearance, between Monochrome Mode and Twitter Emoji). Renders
|
* inside Appearance, between Monochrome Mode and Twitter Emoji). Renders
|
||||||
* nothing outside the desktop app.
|
* nothing outside the desktop app.
|
||||||
*/
|
*/
|
||||||
function DesktopSettings() {
|
export function DesktopSettings() {
|
||||||
if (!isTauriEnv()) return null;
|
if (!isTauriEnv()) return null;
|
||||||
return (
|
return (
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
@@ -2952,7 +3071,7 @@ function DesktopSettings() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AppUpdates() {
|
export function AppUpdates() {
|
||||||
const { isTauri, status, check, install, installKind } = useTauriUpdater();
|
const { isTauri, status, check, install, installKind } = useTauriUpdater();
|
||||||
if (!isTauri) return null;
|
if (!isTauri) return null;
|
||||||
const packageHelp = packageUpdateHelp(installKind);
|
const packageHelp = packageUpdateHelp(installKind);
|
||||||
@@ -3031,14 +3150,60 @@ function AppUpdates() {
|
|||||||
type GeneralProps = {
|
type GeneralProps = {
|
||||||
requestClose: () => void;
|
requestClose: () => void;
|
||||||
};
|
};
|
||||||
export function General({ requestClose }: GeneralProps) {
|
|
||||||
|
/** [Gitea #459] Display options for people who want to see the plumbing. */
|
||||||
|
export function AdvancedDisplayOptions() {
|
||||||
|
const [legacyUsernameColor, setLegacyUsernameColor] = useSetting(
|
||||||
|
settingsAtom,
|
||||||
|
'legacyUsernameColor',
|
||||||
|
);
|
||||||
|
const [showHiddenEvents, setShowHiddenEvents] = useSetting(settingsAtom, 'showHiddenEvents');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box direction="Column" gap="100">
|
||||||
|
<Text size="L400">Display</Text>
|
||||||
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
|
<SettingTile
|
||||||
|
title="Legacy username colour"
|
||||||
|
after={
|
||||||
|
<Switch
|
||||||
|
variant="Primary"
|
||||||
|
value={legacyUsernameColor}
|
||||||
|
onChange={setLegacyUsernameColor}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</SequenceCard>
|
||||||
|
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
|
||||||
|
<SettingTile
|
||||||
|
title="Show hidden events"
|
||||||
|
after={
|
||||||
|
<Switch variant="Primary" value={showHiddenEvents} onChange={setShowHiddenEvents} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</SequenceCard>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [Gitea #459] General used to hold 76 of the ~110 settings (11 screens). Its
|
||||||
|
* sections now live on pages named for what people come to do; Privacy goes
|
||||||
|
* to Privacy & security (devices/Devices.tsx) and the display plumbing to
|
||||||
|
* Advanced (developer-tools).
|
||||||
|
*/
|
||||||
|
function SectionPage({
|
||||||
|
title,
|
||||||
|
requestClose,
|
||||||
|
children,
|
||||||
|
}: GeneralProps & { title: string; children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<PageHeader outlined={false}>
|
<PageHeader outlined={false}>
|
||||||
<Box grow="Yes" gap="200">
|
<Box grow="Yes" gap="200">
|
||||||
<Box grow="Yes" alignItems="Center" gap="200">
|
<Box grow="Yes" alignItems="Center" gap="200">
|
||||||
<Text size="H3" truncate>
|
<Text size="H3" truncate>
|
||||||
General
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box shrink="No">
|
<Box shrink="No">
|
||||||
@@ -3052,17 +3217,7 @@ export function General({ requestClose }: GeneralProps) {
|
|||||||
<Scroll hideTrack visibility="Hover">
|
<Scroll hideTrack visibility="Hover">
|
||||||
<PageContent>
|
<PageContent>
|
||||||
<Box direction="Column" gap="700">
|
<Box direction="Column" gap="700">
|
||||||
<Appearance />
|
{children}
|
||||||
<DateAndTime />
|
|
||||||
<Editor />
|
|
||||||
<Messages />
|
|
||||||
<Privacy />
|
|
||||||
<StorageUsage />
|
|
||||||
<SettingsSyncSection />
|
|
||||||
<YourDataSection />
|
|
||||||
<Calls />
|
|
||||||
<DesktopSettings />
|
|
||||||
<AppUpdates />
|
|
||||||
</Box>
|
</Box>
|
||||||
</PageContent>
|
</PageContent>
|
||||||
</Scroll>
|
</Scroll>
|
||||||
@@ -3070,3 +3225,49 @@ export function General({ requestClose }: GeneralProps) {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function AppearancePage({ requestClose }: GeneralProps) {
|
||||||
|
return (
|
||||||
|
<SectionPage title="Appearance" requestClose={requestClose}>
|
||||||
|
<Appearance />
|
||||||
|
</SectionPage>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MessagesPage({ requestClose }: GeneralProps) {
|
||||||
|
return (
|
||||||
|
<SectionPage title="Messages" requestClose={requestClose}>
|
||||||
|
<Messages />
|
||||||
|
<Editor />
|
||||||
|
<DateAndTime />
|
||||||
|
</SectionPage>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CallsPage({ requestClose }: GeneralProps) {
|
||||||
|
return (
|
||||||
|
<SectionPage title="Calls & audio" requestClose={requestClose}>
|
||||||
|
<Calls />
|
||||||
|
</SectionPage>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DataStoragePage({ requestClose }: GeneralProps) {
|
||||||
|
return (
|
||||||
|
<SectionPage title="Data & storage" requestClose={requestClose}>
|
||||||
|
<StorageUsage />
|
||||||
|
<SettingsSyncSection />
|
||||||
|
<YourDataSection />
|
||||||
|
</SectionPage>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Desktop app only (the menu hides it elsewhere). */
|
||||||
|
export function DesktopPage({ requestClose }: GeneralProps) {
|
||||||
|
return (
|
||||||
|
<SectionPage title="Desktop" requestClose={requestClose}>
|
||||||
|
<DesktopSettings />
|
||||||
|
<AppUpdates />
|
||||||
|
</SectionPage>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useRef, useState } from 'react';
|
import React, { useCallback, useRef, useState } from 'react';
|
||||||
import { useAtom } from 'jotai';
|
import { useAtom } from 'jotai';
|
||||||
import { Method } from 'matrix-js-sdk';
|
import { Method } from 'matrix-js-sdk';
|
||||||
import { Box, Button, Text, color } from 'folds';
|
import { Box, Button, RadioButton, Text, color } from 'folds';
|
||||||
import { SequenceCard } from '../../../components/sequence-card';
|
import { SequenceCard } from '../../../components/sequence-card';
|
||||||
import { SequenceCardStyle } from '../styles.css';
|
import { SequenceCardStyle } from '../styles.css';
|
||||||
import { SettingTile } from '../../../components/setting-tile';
|
import { SettingTile } from '../../../components/setting-tile';
|
||||||
@@ -224,22 +224,24 @@ export function YourDataSection() {
|
|||||||
here:
|
here:
|
||||||
</Text>
|
</Text>
|
||||||
<label>
|
<label>
|
||||||
<input
|
<RadioButton
|
||||||
type="radio"
|
|
||||||
name="your-data-conflicts"
|
name="your-data-conflicts"
|
||||||
|
variant="Primary"
|
||||||
|
size="300"
|
||||||
checked={!preferFile}
|
checked={!preferFile}
|
||||||
onChange={() => setPreferFile(false)}
|
onClick={() => setPreferFile(false)}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
<Text as="span" size="T200">
|
<Text as="span" size="T200">
|
||||||
Keep mine
|
Keep mine
|
||||||
</Text>
|
</Text>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input
|
<RadioButton
|
||||||
type="radio"
|
|
||||||
name="your-data-conflicts"
|
name="your-data-conflicts"
|
||||||
|
variant="Primary"
|
||||||
|
size="300"
|
||||||
checked={preferFile}
|
checked={preferFile}
|
||||||
onChange={() => setPreferFile(true)}
|
onClick={() => setPreferFile(true)}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
<Text as="span" size="T200">
|
<Text as="span" size="T200">
|
||||||
Use the file's
|
Use the file's
|
||||||
|
|||||||
@@ -334,6 +334,11 @@ export function PushRuleEditor() {
|
|||||||
return (
|
return (
|
||||||
<Box direction="Column" gap="100">
|
<Box direction="Column" gap="100">
|
||||||
<Text size="L400">Advanced push rules</Text>
|
<Text size="L400">Advanced push rules</Text>
|
||||||
|
{/* [Gitea #459] Matrix terms kept, with one line on what they are. */}
|
||||||
|
<Text size="T200" priority="300">
|
||||||
|
The raw Matrix notification rules behind the options above, checked in this order: override,
|
||||||
|
room, sender, then underride. You rarely need to change these.
|
||||||
|
</Text>
|
||||||
<RuleSection title="Override rules" kind={PushRuleKind.Override} rules={overrideRules} />
|
<RuleSection title="Override rules" kind={PushRuleKind.Override} rules={overrideRules} />
|
||||||
<RuleSection
|
<RuleSection
|
||||||
title="Room rules"
|
title="Room rules"
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
/** Settings dialog pages. Kept apart from Settings.tsx so callers can name a
|
/** Settings dialog pages. Kept apart from Settings.tsx so callers can name a
|
||||||
* page without pulling the dialog into the entry chunk. */
|
* page without pulling the dialog into the entry chunk. */
|
||||||
export enum SettingsPages {
|
export enum SettingsPages {
|
||||||
GeneralPage,
|
|
||||||
AccountPage,
|
AccountPage,
|
||||||
|
// [Gitea #459] These replace the old catch-all General page.
|
||||||
|
AppearancePage,
|
||||||
|
MessagesPage,
|
||||||
NotificationPage,
|
NotificationPage,
|
||||||
|
CallsPage,
|
||||||
|
/** "Privacy & security": privacy options plus devices and encryption. */
|
||||||
DevicesPage,
|
DevicesPage,
|
||||||
|
DataStoragePage,
|
||||||
|
/** Desktop app only. */
|
||||||
|
DesktopPage,
|
||||||
EmojisStickersPage,
|
EmojisStickersPage,
|
||||||
|
/** "Advanced": developer tools and display plumbing. */
|
||||||
DeveloperToolsPage,
|
DeveloperToolsPage,
|
||||||
AboutPage,
|
AboutPage,
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ export function useSettingsSync(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manual actions for Settings → General → Sync. `pushNow` stamps a fresh
|
* Manual actions for Settings → Data & storage → Sync. `pushNow` stamps a fresh
|
||||||
* snapshot of THIS device so it wins on every other device; `clearRemote`
|
* snapshot of THIS device so it wins on every other device; `clearRemote`
|
||||||
* blanks the account-data event (other devices ignore the invalid content and
|
* blanks the account-data event (other devices ignore the invalid content and
|
||||||
* keep their local settings until someone pushes again).
|
* keep their local settings until someone pushes again).
|
||||||
|
|||||||
@@ -1015,13 +1015,13 @@ function TauriUpdateFeature() {
|
|||||||
dismissToast(UPDATE_PROGRESS_TOAST);
|
dismissToast(UPDATE_PROGRESS_TOAST);
|
||||||
if (!failure) return;
|
if (!failure) return;
|
||||||
// Short on purpose; the full explanation and a Download installer button
|
// Short on purpose; the full explanation and a Download installer button
|
||||||
// are in Settings → General → App updates.
|
// are in Settings → Desktop → App updates.
|
||||||
const busy = failure.phase !== 'install' && isNetworkUpdateError(failure.message);
|
const busy = failure.phase !== 'install' && isNetworkUpdateError(failure.message);
|
||||||
setToast({
|
setToast({
|
||||||
id: UPDATE_FAILED_TOAST,
|
id: UPDATE_FAILED_TOAST,
|
||||||
iconSrc: Icons.Warning,
|
iconSrc: Icons.Warning,
|
||||||
displayName: 'Update didn’t install',
|
displayName: 'Update didn’t install',
|
||||||
body: `${busy ? 'The update server seems busy. ' : ''}Click to try again, or get the installer in Settings → General → App updates.`,
|
body: `${busy ? 'The update server seems busy. ' : ''}Click to try again, or get the installer in Settings → Desktop → App updates.`,
|
||||||
roomName: 'System',
|
roomName: 'System',
|
||||||
roomId: '',
|
roomId: '',
|
||||||
sticky: true,
|
sticky: true,
|
||||||
@@ -1062,7 +1062,7 @@ function TauriUpdateFeature() {
|
|||||||
roomName: 'System',
|
roomName: 'System',
|
||||||
roomId: '',
|
roomId: '',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (viaPackage) requestSettings('general');
|
if (viaPackage) requestSettings('desktop');
|
||||||
else installFromToast();
|
else installFromToast();
|
||||||
},
|
},
|
||||||
sticky: true,
|
sticky: true,
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ import { AutoDiscovery } from './AutoDiscovery';
|
|||||||
|
|
||||||
// Capture-only E2EE diagnostics ring buffer (KE-1→4 signatures) — installed at
|
// Capture-only E2EE diagnostics ring buffer (KE-1→4 signatures) — installed at
|
||||||
// module load so it sees crypto warnings from the very first sync. Idempotent;
|
// module load so it sees crypto warnings from the very first sync. Idempotent;
|
||||||
// report download lives in Settings → Developer Tools → Crypto Diagnostics.
|
// report download lives in Settings → Advanced → Crypto diagnostics.
|
||||||
installCryptoDiagLog();
|
installCryptoDiagLog();
|
||||||
|
|
||||||
function ClientRootLoading() {
|
function ClientRootLoading() {
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ export function KeyUploadBanner() {
|
|||||||
rejects every new upload and other people can't start fresh encrypted sessions
|
rejects every new upload and other people can't start fresh encrypted sessions
|
||||||
with you. This usually happens after the browser cleared this site's storage
|
with you. This usually happens after the browser cleared this site's storage
|
||||||
while you stayed signed in. Before signing out, make sure this device is verified or
|
while you stayed signed in. Before signing out, make sure this device is verified or
|
||||||
key backup is on (Settings → Devices), so your message history comes back when you
|
key backup is on (Settings → Privacy & security), so your message history comes back
|
||||||
sign in again.
|
when you sign in again.
|
||||||
</Text>
|
</Text>
|
||||||
{lastError && (
|
{lastError && (
|
||||||
<Text size="T200" align="Center" priority="300" style={{ wordBreak: 'break-word' }}>
|
<Text size="T200" align="Center" priority="300" style={{ wordBreak: 'break-word' }}>
|
||||||
|
|||||||
@@ -180,7 +180,10 @@ export function SettingsTab() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!settingsRequest) return;
|
if (!settingsRequest) return;
|
||||||
const page = {
|
const page = {
|
||||||
general: SettingsPages.GeneralPage,
|
// [Gitea #459] General is gone; its old deep links land on Appearance.
|
||||||
|
general: SettingsPages.AppearancePage,
|
||||||
|
appearance: SettingsPages.AppearancePage,
|
||||||
|
desktop: SettingsPages.DesktopPage,
|
||||||
account: SettingsPages.AccountPage,
|
account: SettingsPages.AccountPage,
|
||||||
notifications: SettingsPages.NotificationPage,
|
notifications: SettingsPages.NotificationPage,
|
||||||
devices: SettingsPages.DevicesPage,
|
devices: SettingsPages.DevicesPage,
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { atom } from 'jotai';
|
import { atom } from 'jotai';
|
||||||
|
|
||||||
export type SettingsRequestPage = 'general' | 'account' | 'notifications' | 'devices';
|
export type SettingsRequestPage =
|
||||||
|
| 'general'
|
||||||
|
| 'account'
|
||||||
|
| 'notifications'
|
||||||
|
| 'devices'
|
||||||
|
| 'desktop'
|
||||||
|
| 'appearance';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ask the sidebar to open User Settings at a page from anywhere in the app
|
* Ask the sidebar to open User Settings at a page from anywhere in the app
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* cross-signing: the setup flow does both).
|
* cross-signing: the setup flow does both).
|
||||||
*
|
*
|
||||||
* - stale-sessions (#113, lowest priority): sessions of this account not used
|
* - stale-sessions (#113, lowest priority): sessions of this account not used
|
||||||
* for 90+ days; Review opens Settings → Devices with them ticked to sign out.
|
* for 90+ days; Review opens Settings → Privacy & security with them ticked to sign out.
|
||||||
*
|
*
|
||||||
* Anything not yet known (crypto still loading) → no nudge. Timing: not in
|
* Anything not yet known (crypto still loading) → no nudge. Timing: not in
|
||||||
* the first 24 h on a device (onboarding), "Not now" snoozes 7 days, three
|
* the first 24 h on a device (onboarding), "Not now" snoozes 7 days, three
|
||||||
|
|||||||
Reference in new issue
Block a user