Skip to content

A local-first personal finance app

settings card redesign (#9112)

Matt Fiddaman93c1857fa870
diff --git a/packages/component-library/src/theme.ts b/packages/component-library/src/theme.ts
index c7b43b2985..8d6d1e5058 100644
--- a/packages/component-library/src/theme.ts
+++ b/packages/component-library/src/theme.ts
@@ -63,6 +63,8 @@ export const theme = {
sidebarBrand: 'var(--color-sidebarBrand)',
settingsCardBackground: 'var(--color-settingsCardBackground)',
settingsCardBorder: 'var(--color-settingsCardBorder)',
+ settingsCardText: 'var(--color-settingsCardText)',
+ settingsCardTextSubdued: 'var(--color-settingsCardTextSubdued)',
settingsNavItemText: 'var(--color-settingsNavItemText)',
settingsNavItemBackgroundHover: 'var(--color-settingsNavItemBackgroundHover)',
settingsNavItemAccentSelected: 'var(--color-settingsNavItemAccentSelected)',
diff --git a/packages/component-library/src/themes/dark.css b/packages/component-library/src/themes/dark.css
index fd2e1c5f62..33e4e7d701 100644
--- a/packages/component-library/src/themes/dark.css
+++ b/packages/component-library/src/themes/dark.css
@@ -83,6 +83,8 @@
--color-settingsCardBackground: var(--color-tableBackground);
--color-settingsCardBorder: var(--color-tableBorder);
+ --color-settingsCardText: var(--color-tableText);
+ --color-settingsCardTextSubdued: var(--palette-navy300);
--color-settingsNavItemText: var(--color-pageText);
--color-settingsNavItemBackgroundHover: color-mix(
in srgb,
diff --git a/packages/component-library/src/themes/light.css b/packages/component-library/src/themes/light.css
index 36a1a1bb82..d8ecb6df21 100644
--- a/packages/component-library/src/themes/light.css
+++ b/packages/component-library/src/themes/light.css
@@ -83,6 +83,8 @@
--color-settingsCardBackground: var(--color-tableBackground);
--color-settingsCardBorder: var(--color-tableBorder);
+ --color-settingsCardText: var(--color-tableText);
+ --color-settingsCardTextSubdued: var(--palette-navy600);
--color-settingsNavItemText: var(--color-pageText);
--color-settingsNavItemBackgroundHover: color-mix(
in srgb,
diff --git a/packages/component-library/src/themes/midnight.css b/packages/component-library/src/themes/midnight.css
index ae017a6e17..35463a6aee 100644
--- a/packages/component-library/src/themes/midnight.css
+++ b/packages/component-library/src/themes/midnight.css
@@ -83,6 +83,8 @@
--color-settingsCardBackground: var(--color-tableBackground);
--color-settingsCardBorder: var(--color-tableBorder);
+ --color-settingsCardText: var(--color-tableText);
+ --color-settingsCardTextSubdued: var(--palette-gray200);
--color-settingsNavItemText: var(--color-pageText);
--color-settingsNavItemBackgroundHover: color-mix(
in srgb,
diff --git a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-tracking-budget-forecast-report-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-tracking-budget-forecast-report-1-chromium-linux.png
index b57eda6a32..50608c0c29 100644
Binary files a/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-tracking-budget-forecast-report-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.ts-snapshots/Reports-balance-forecast-loads-tracking-budget-forecast-report-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png
index c20bd7e890..610c106951 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png
index 511d2fb36d..032557b6ea 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png
index 4bdb25a1ad..45b15a2cf6 100644
Binary files a/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png and b/packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-1-chromium-linux.png
index a8fc3b55ba..959c4e0afa 100644
Binary files a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png
index 3fa10b7527..d98f6d44fd 100644
Binary files a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-3-chromium-linux.png
index f150e8e931..c1c53acaf2 100644
Binary files a/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/settings.test.ts-snapshots/Settings-checks-the-page-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/settings/AuthSettings.tsx b/packages/desktop-client/src/components/settings/AuthSettings.tsx
index 0e1ef59790..4c215b7e73 100644
--- a/packages/desktop-client/src/components/settings/AuthSettings.tsx
+++ b/packages/desktop-client/src/components/settings/AuthSettings.tsx
@@ -2,17 +2,15 @@ import React from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
-import { Label } from '@actual-app/components/label';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { View } from '@actual-app/components/view';
import { useLoginMethod, useMultiuserEnabled } from '#components/ServerContext';
import { useSyncServerStatus } from '#hooks/useSyncServerStatus';
import { pushModal } from '#modals/modalsSlice';
import { useDispatch } from '#redux';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function AuthSettings() {
const { t } = useTranslation();
@@ -28,93 +26,53 @@ export function AuthSettings() {
}
const isOffline = serverStatus === 'offline';
+ const isUsingPassword = loginMethod === 'password';
return (
- <Setting
- primaryAction={
- <>
- <label>
- <Trans>OpenID is</Trans>{' '}
- <label style={{ fontWeight: 'bold' }}>
- {loginMethod === 'openid' ? t('enabled') : t('disabled')}
- </label>
- </label>
- {isOffline && (
- <View>
- <Text style={{ paddingTop: 5, color: theme.warningText }}>
- <Trans>
- Server is offline. OpenID settings are unavailable.
- </Trans>
- </Text>
- </View>
- )}
- {loginMethod === 'password' && (
- <>
- <Button
- id="start-using"
- style={{
- marginTop: '10px',
- }}
- variant="normal"
- isDisabled={isOffline}
- onPress={() =>
- dispatch(
- pushModal({
- modal: {
- name: 'enable-openid',
- options: {},
- },
- }),
- )
- }
- >
- <Trans>Start using OpenID</Trans>
- </Button>
- <Label
- style={{ paddingTop: 5 }}
- title={t('OpenID is required to enable multi-user mode.')}
- />
- </>
- )}
- {loginMethod !== 'password' && (
- <>
- <Button
- style={{
- marginTop: '10px',
- }}
- variant="normal"
- isDisabled={isOffline}
- onPress={() =>
- dispatch(
- pushModal({
- modal: {
- name: 'enable-password-auth',
- options: {},
- },
- }),
- )
- }
- >
- <Trans>Disable OpenID</Trans>
- </Button>
- {multiuserEnabled && (
- <Text style={{ paddingTop: 5, color: theme.errorText }}>
- <Trans>
- Disabling OpenID will deactivate multi-user mode.
- </Trans>
- </Text>
- )}
- </>
- )}
- </>
+ <SettingsRow
+ title={t('Authentication method')}
+ description={t(
+ 'Enable OpenID to let users log in through an OpenID provider instead of the server password. OpenID is required for multi-user mode.',
+ )}
+ control={
+ isUsingPassword ? (
+ <Button
+ id="start-using"
+ isDisabled={isOffline}
+ onPress={() =>
+ dispatch(
+ pushModal({ modal: { name: 'enable-openid', options: {} } }),
+ )
+ }
+ >
+ <Trans>Start using OpenID</Trans>
+ </Button>
+ ) : (
+ <Button
+ isDisabled={isOffline}
+ onPress={() =>
+ dispatch(
+ pushModal({
+ modal: { name: 'enable-password-auth', options: {} },
+ }),
+ )
+ }
+ >
+ <Trans>Disable OpenID</Trans>
+ </Button>
+ )
}
>
- <Text>
- <Trans>
- <strong>Authentication method</strong> modifies how users log in to
- the system.
- </Trans>
- </Text>
- </Setting>
+ {isOffline && (
+ <Text style={{ color: theme.warningText }}>
+ <Trans>Server is offline. OpenID settings are unavailable.</Trans>
+ </Text>
+ )}
+ {!isUsingPassword && multiuserEnabled && (
+ <Text style={{ color: theme.errorText }}>
+ <Trans>Disabling OpenID will deactivate multi-user mode.</Trans>
+ </Text>
+ )}
+ </SettingsRow>
);
}
diff --git a/packages/desktop-client/src/components/settings/Backups.tsx b/packages/desktop-client/src/components/settings/Backups.tsx
index 2715c438e8..460b1e8def 100644
--- a/packages/desktop-client/src/components/settings/Backups.tsx
+++ b/packages/desktop-client/src/components/settings/Backups.tsx
@@ -1,31 +1,26 @@
import React from 'react';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
-import { Text } from '@actual-app/components/text';
-
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function Backups() {
+ const { t } = useTranslation();
const BACKUP_FREQUENCY_MINS = 15;
const MAX_BACKUPS = 10;
return (
- <Setting>
- <Text>
- <strong>
- <Trans>Backups</Trans>
- </strong>
- <p>
- <Trans>
- Backups are taken every {{ BACKUP_FREQUENCY_MINS }} minutes and
- stored in{' '}
- <strong>
- <i>Actual's data directory</i>
- </strong>
- . Actual retains a maximum of {{ MAX_BACKUPS }} backups at any time.
- </Trans>
- </p>
- </Text>
- </Setting>
+ <SettingsRow
+ title={t('Backups')}
+ description={
+ <Trans>
+ Backups are taken every {{ BACKUP_FREQUENCY_MINS }} minutes and stored
+ in{' '}
+ <span>
+ <span>Actual's data directory</span>
+ </span>
+ . Actual retains a maximum of {{ MAX_BACKUPS }} backups at any time.
+ </Trans>
+ }
+ />
);
}
diff --git a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
index 362382f27d..afde7a9e88 100644
--- a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
+++ b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
@@ -1,16 +1,18 @@
import React, { useState } from 'react';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import { ButtonWithLoading } from '@actual-app/components/button';
import { Text } from '@actual-app/components/text';
+import { spacing } from '@actual-app/components/tokens';
import { send } from '@actual-app/core/platform/client/connection';
import { Link } from '#components/common/Link';
import { useSyncedPref } from '#hooks/useSyncedPref';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function BudgetTypeSettings() {
+ const { t } = useTranslation();
const [budgetType = 'envelope', setBudgetType] = useSyncedPref('budgetType');
const [isLoading, setIsLoading] = useState(false);
@@ -28,8 +30,43 @@ export function BudgetTypeSettings() {
}
return (
- <Setting
- primaryAction={
+ <SettingsRow
+ title={t('Budget type')}
+ description={
+ <>
+ <Text style={{ display: 'block' }}>
+ <Trans>
+ <span>Envelope budgeting</span> (recommended) digitally mimics
+ physical envelope budgeting system by allocating funds into
+ virtual envelopes for different expenses. It helps track spending
+ and ensure you don't overspend in any category.
+ </Trans>{' '}
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/getting-started/envelope-budgeting"
+ linkColor="purple"
+ >
+ <Trans>Learn more</Trans>
+ </Link>
+ </Text>
+ <Text style={{ display: 'block', marginTop: spacing.xs }}>
+ <Trans>
+ With <span>tracking budgeting</span>, category balances reset each
+ month, and funds are managed using a "Saved" metric instead of "To
+ Be Budgeted." Income is forecasted to plan future spending, rather
+ than relying on current available funds.
+ </Trans>{' '}
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/getting-started/tracking-budget"
+ linkColor="purple"
+ >
+ <Trans>Learn more</Trans>
+ </Link>
+ </Text>
+ </>
+ }
+ control={
<ButtonWithLoading onPress={onSwitchType} isLoading={isLoading}>
{budgetType === 'tracking' ? (
<Trans>Switch to envelope budgeting</Trans>
@@ -38,37 +75,6 @@ export function BudgetTypeSettings() {
)}
</ButtonWithLoading>
}
- >
- <Text>
- <Trans>
- <strong>Envelope budgeting</strong> (recommended) digitally mimics
- physical envelope budgeting system by allocating funds into virtual
- envelopes for different expenses. It helps track spending and ensure
- you don't overspend in any category.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/getting-started/envelope-budgeting"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- <Text>
- <Trans>
- With <strong>tracking budgeting</strong>, category balances reset each
- month, and funds are managed using a "Saved" metric instead of "To Be
- Budgeted." Income is forecasted to plan future spending, rather than
- relying on current available funds.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/getting-started/tracking-budget"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- </Setting>
+ />
);
}
diff --git a/packages/desktop-client/src/components/settings/Currency.tsx b/packages/desktop-client/src/components/settings/Currency.tsx
index 570dfa36ae..37d5bd452d 100644
--- a/packages/desktop-client/src/components/settings/Currency.tsx
+++ b/packages/desktop-client/src/components/settings/Currency.tsx
@@ -1,17 +1,16 @@
import React, { useMemo } from 'react';
-import { Trans, useTranslation } from 'react-i18next';
+import { useTranslation } from 'react-i18next';
import { Select } from '@actual-app/components/select';
-import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { View } from '@actual-app/components/view';
import { currencies, getCurrency } from '@actual-app/core/shared/currencies';
import { css } from '@emotion/css';
import { Checkbox } from '#components/forms';
import { useSyncedPref } from '#hooks/useSyncedPref';
-import { Column, Setting } from './UI';
+import { SettingsGroup } from './SettingsGroup';
+import { SettingsRow } from './SettingsRow';
export function CurrencySettings() {
const { t } = useTranslation();
@@ -137,79 +136,54 @@ export function CurrencySettings() {
}, [selectedCurrencyCode, spaceEnabled, t]);
return (
- <Setting
- primaryAction={
- <View
- style={{
- display: 'flex',
- flexDirection: 'column',
- gap: '1.5em',
- width: '100%',
- }}
- >
- <View style={{ display: 'flex', flexDirection: 'row', gap: '1.5em' }}>
- <Column title={t('Default Currency')}>
- <Select
- value={selectedCurrencyCode}
- onChange={handleCurrencyChange}
- options={currencyOptions}
- className={selectButtonClassName}
- style={{ width: '100%' }}
- />
- </Column>
-
- <Column
- title={t('Symbol Position')}
- style={{
- visibility: selectedCurrencyCode === '' ? 'hidden' : 'visible',
- }}
- >
- <Select
- value={symbolPosition || 'before'}
- onChange={value => setSymbolPositionPref(value)}
- options={symbolPositionOptions.map(f => [f.value, f.label])}
- className={selectButtonClassName}
- style={{ width: '100%' }}
- disabled={selectedCurrencyCode === ''}
- />
- </Column>
- </View>
-
- {selectedCurrencyCode !== '' && (
- <View
- style={{
- display: 'flex',
- flexDirection: 'row',
- alignItems: 'center',
- justifyContent: 'flex-start',
- }}
- >
- <Checkbox
- id="settings-spaceEnabled"
- checked={spaceEnabled === 'true'}
- onChange={e =>
- setSpaceEnabledPref(e.target.checked ? 'true' : 'false')
- }
- />
- <label
- htmlFor="settings-spaceEnabled"
- style={{ marginLeft: '0.5em' }}
- >
- <Trans>Add space between amount and symbol</Trans>
- </label>
- </View>
- )}
- </View>
- }
+ <SettingsGroup
+ title={t('Currency')}
+ description={t(
+ 'Currency settings affect how amounts are displayed throughout the application. Changing the currency also updates the number format, symbol position and whether decimal places are shown. These can be adjusted after the currency is set.',
+ )}
>
- <Text>
- <Trans>
- <strong>Currency settings</strong> affect how amounts are displayed
- throughout the application. Changing the currency will affect the
- number format, symbol position, and whether fractions are shown. These
- can be adjusted after the currency is set.
- </Trans>
- </Text>
- </Setting>
+ <SettingsRow
+ title={t('Default currency')}
+ control={
+ <Select
+ value={selectedCurrencyCode}
+ onChange={handleCurrencyChange}
+ options={currencyOptions}
+ className={selectButtonClassName}
+ style={{ maxWidth: '100%' }}
+ />
+ }
+ />
+ {selectedCurrencyCode !== '' && (
+ <SettingsRow
+ title={t('Symbol position')}
+ control={
+ <Select
+ value={symbolPosition || 'before'}
+ onChange={value => setSymbolPositionPref(value)}
+ options={symbolPositionOptions.map(f => [f.value, f.label])}
+ className={selectButtonClassName}
+ style={{ maxWidth: '100%' }}
+ />
+ }
+ />
+ )}
+ {selectedCurrencyCode !== '' && (
+ <SettingsRow
+ htmlFor="settings-spaceEnabled"
+ title={t('Add space between amount and symbol')}
+ control={
+ <Checkbox
+ id="settings-spaceEnabled"
+ checked={spaceEnabled === 'true'}
+ onChange={e =>
+ setSpaceEnabledPref(e.target.checked ? 'true' : 'false')
+ }
+ style={{ marginRight: 0 }}
+ />
+ }
+ />
+ )}
+ </SettingsGroup>
);
}
diff --git a/packages/desktop-client/src/components/settings/Encryption.tsx b/packages/desktop-client/src/components/settings/Encryption.tsx
index 2dd3ee672b..0073a2a5fe 100644
--- a/packages/desktop-client/src/components/settings/Encryption.tsx
+++ b/packages/desktop-client/src/components/settings/Encryption.tsx
@@ -1,7 +1,8 @@
import React from 'react';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
+import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
@@ -11,130 +12,87 @@ import { useMetadataPref } from '#hooks/useMetadataPref';
import { pushModal } from '#modals/modalsSlice';
import { useDispatch } from '#redux';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function EncryptionSettings() {
+ const { t } = useTranslation();
const dispatch = useDispatch();
const serverURL = useServerURL();
const [encryptKeyId] = useMetadataPref('encryptKeyId');
+ const [groupId] = useMetadataPref('groupId');
const missingCryptoAPI = !(window.crypto && crypto.subtle);
- function onChangeKey() {
+ if (!serverURL || !groupId) {
+ return null;
+ }
+
+ function onCreateKey() {
dispatch(
pushModal({
- modal: { name: 'create-encryption-key', options: { recreate: true } },
+ modal: {
+ name: 'create-encryption-key',
+ options: encryptKeyId ? { recreate: true } : {},
+ },
}),
);
}
- return encryptKeyId ? (
- <Setting
- primaryAction={
- <Button onPress={onChangeKey}>
- <Trans>Generate new key</Trans>
- </Button>
- }
- >
- <Text>
- <Text style={{ color: theme.noticeTextLight, fontWeight: 600 }}>
- <Trans>End-to-end Encryption is turned on.</Trans>
- </Text>{' '}
- <Trans>
- Your budget data is encrypted with a key that only you have before
- sending it out to the cloud. Local data remains unencrypted so if you
- forget your password you can re-encrypt it. Note: bank sync operations
- and secrets stored on the server are not covered by end-to-end
- encryption.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- </Setting>
- ) : missingCryptoAPI ? (
- <Setting
- primaryAction={
- <Button isDisabled>
- <Trans>Enable encryption</Trans>
- </Button>
- }
- >
- <Text>
- <Trans>
- <strong>End-to-end encryption</strong> is not available when making an
- unencrypted connection to a remote server. You'll need to enable HTTPS
- on your server to use end-to-end encryption. This problem may also
- occur if your browser is too old to work with Actual.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/config/https"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- </Setting>
- ) : serverURL ? (
- <Setting
- primaryAction={
- <Button
- onPress={() =>
- dispatch(
- pushModal({
- modal: { name: 'create-encryption-key', options: {} },
- }),
- )
- }
- >
- <Trans>Enable encryption</Trans>
- </Button>
+ const noteStyle = {
+ ...styles.smallText,
+ lineHeight: 1.5,
+ color: theme.settingsCardTextSubdued,
+ };
+
+ return (
+ <SettingsRow
+ title={t('End-to-end encryption')}
+ description={
+ <>
+ <Trans>
+ Enable this to encrypt your budget data with a key that only you
+ have before it is sent to the server. Local data stays unencrypted,
+ so you can re-encrypt it if you forget your password. Bank sync
+ operations and secrets stored on the server are not covered.
+ </Trans>{' '}
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption"
+ linkColor="purple"
+ >
+ <Trans>Learn more</Trans>
+ </Link>
+ </>
}
- >
- <Text>
- <Trans>
- <strong>End-to-end encryption</strong> is not enabled. Any data on the
- server is still protected by the server password, but it's not
- end-to-end encrypted which means the server owners have the ability to
- read it. If you want, you can use an additional password to encrypt
- your data on the server.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- </Setting>
- ) : (
- <Setting
- primaryAction={
- <Button isDisabled>
- <Trans>Enable encryption</Trans>
- </Button>
+ control={
+ encryptKeyId ? (
+ <Button onPress={onCreateKey}>
+ <Trans>Generate new key</Trans>
+ </Button>
+ ) : (
+ <Button isDisabled={missingCryptoAPI} onPress={onCreateKey}>
+ <Trans>Enable encryption</Trans>
+ </Button>
+ )
}
>
- <Text>
- <Trans>
- <strong>End-to-end encryption</strong> is not available when running
- without a server. Budget files are always kept unencrypted locally,
- and encryption is only applied when sending data to a server.
- </Trans>{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption"
- linkColor="purple"
- >
- <Trans>Learn more</Trans>
- </Link>
- </Text>
- </Setting>
+ {!encryptKeyId && missingCryptoAPI && (
+ <Text style={noteStyle}>
+ <Trans>
+ <span>End-to-end encryption</span> is not available when making an
+ unencrypted connection to a remote server. You'll need to enable
+ HTTPS on your server to use end-to-end encryption. This problem may
+ also occur if your browser is too old to work with Actual.
+ </Trans>{' '}
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/config/https"
+ linkColor="purple"
+ >
+ <Trans>Learn more</Trans>
+ </Link>
+ </Text>
+ )}
+ </SettingsRow>
);
}
diff --git a/packages/desktop-client/src/components/settings/Experimental.tsx b/packages/desktop-client/src/components/settings/Experimental.tsx
index 9ac170ad40..556ba6bb76 100644
--- a/packages/desktop-client/src/components/settings/Experimental.tsx
+++ b/packages/desktop-client/src/components/settings/Experimental.tsx
@@ -1,8 +1,9 @@
import type { ReactNode } from 'react';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
+import { spacing } from '@actual-app/components/tokens';
import { View } from '@actual-app/components/view';
import type { FeatureFlag, ServerPrefs } from '@actual-app/core/types/prefs';
@@ -16,7 +17,8 @@ import { useServerPref } from '#hooks/useServerPref';
import { useSyncedPref } from '#hooks/useSyncedPref';
import { useSyncServerStatus } from '#hooks/useSyncServerStatus';
-import { Setting } from './UI';
+import { SettingsGroup } from './SettingsGroup';
+import { SettingsRow } from './SettingsRow';
type FeatureToggleProps = {
flag: FeatureFlag;
@@ -25,6 +27,9 @@ type FeatureToggleProps = {
children: ReactNode;
feedbackLink?: string;
note?: ReactNode;
+ isSubFeature?: boolean;
+ subFeatures?: ReactNode;
+ onDisable?: () => void;
};
function FeatureToggle({
@@ -34,45 +39,81 @@ function FeatureToggle({
error,
children,
note,
+ isSubFeature = false,
+ subFeatures,
+ onDisable,
}: FeatureToggleProps) {
const enabled = useFeatureFlag(flagName);
const [_, setFlagPref] = useSyncedPref(`flags.${flagName}`);
+ const id = `settings-flag-${flagName}`;
return (
- <label style={{ display: 'flex' }}>
- <Checkbox
- checked={enabled}
- onChange={() => {
- setFlagPref(String(!enabled));
- }}
- disabled={disableToggle}
- />
- <View
- style={{ color: disableToggle ? theme.pageTextSubdued : 'inherit' }}
- >
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 5 }}>
- {children}
- {feedbackLink && (
- <Link variant="external" to={feedbackLink}>
- <Trans>(give feedback)</Trans>
- </Link>
- )}
- </View>
-
- {disableToggle && (
- <Text
- style={{
- color: theme.errorText,
- fontWeight: 500,
+ <SettingsRow
+ htmlFor={id}
+ title={children}
+ isNested={isSubFeature}
+ description={
+ (note || (disableToggle && error)) && (
+ <FeatureDetails note={note} error={disableToggle ? error : null} />
+ )
+ }
+ control={
+ <FeatureControl feedbackLink={feedbackLink}>
+ <Checkbox
+ id={id}
+ checked={enabled}
+ onChange={() => {
+ setFlagPref(String(!enabled));
+ if (enabled) {
+ onDisable?.();
+ }
}}
- >
- {error}
- </Text>
- )}
+ disabled={disableToggle}
+ style={{ marginRight: 0 }}
+ />
+ </FeatureControl>
+ }
+ >
+ {subFeatures}
+ </SettingsRow>
+ );
+}
+
+type FeatureDetailsProps = {
+ note?: ReactNode;
+ error?: ReactNode;
+};
- {note && <Text style={{ color: theme.warningText }}>{note}</Text>}
- </View>
- </label>
+function FeatureDetails({ note, error }: FeatureDetailsProps) {
+ return (
+ <>
+ {error && (
+ <Text style={{ color: theme.errorText, fontWeight: 500 }}>
+ {error}{' '}
+ </Text>
+ )}
+ {note && <Text style={{ color: theme.warningText }}>{note}</Text>}
+ </>
+ );
+}
+
+type FeatureControlProps = {
+ feedbackLink?: string;
+ children: ReactNode;
+};
+
+function FeatureControl({ feedbackLink, children }: FeatureControlProps) {
+ return (
+ <View
+ style={{ flexDirection: 'row', alignItems: 'center', gap: spacing.md }}
+ >
+ {feedbackLink && (
+ <Link variant="external" to={feedbackLink} linkColor="purple">
+ <Trans>Give feedback</Trans>
+ </Link>
+ )}
+ {children}
+ </View>
);
}
@@ -113,159 +154,150 @@ function ServerFeatureToggle({
return null;
}
- return (
- <label style={{ display: 'flex' }}>
- <Checkbox
- checked={enabled === 'true'}
- onChange={() => {
- setEnabled(enabled === 'true' ? 'false' : 'true');
- }}
- disabled={disableToggle}
- />
- <View
- style={{ color: disableToggle ? theme.pageTextSubdued : 'inherit' }}
- >
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 5 }}>
- {children}
- {feedbackLink && (
- <Link variant="external" to={feedbackLink}>
- <Trans>(give feedback)</Trans>
- </Link>
- )}
- </View>
+ const id = `settings-flag-${prefName}`;
- {disableToggle && (
- <Text
- style={{
- color: theme.errorText,
- fontWeight: 500,
+ return (
+ <SettingsRow
+ htmlFor={id}
+ title={children}
+ description={disableToggle && error && <FeatureDetails error={error} />}
+ control={
+ <FeatureControl feedbackLink={feedbackLink}>
+ <Checkbox
+ id={id}
+ checked={enabled === 'true'}
+ onChange={() => {
+ setEnabled(enabled === 'true' ? 'false' : 'true');
}}
- >
- {error}
- </Text>
- )}
- </View>
- </label>
+ disabled={disableToggle}
+ style={{ marginRight: 0 }}
+ />
+ </FeatureControl>
+ }
+ />
);
}
export function ExperimentalFeatures() {
+ const { t } = useTranslation();
const goalTemplatesEnabled = useFeatureFlag('goalTemplatesEnabled');
- const goalTemplatesUIEnabled = useFeatureFlag('goalTemplatesUIEnabled');
- const showGoalTemplatesUI = goalTemplatesEnabled || goalTemplatesUIEnabled;
+ const [, setGoalTemplatesUIPref] = useSyncedPref(
+ 'flags.goalTemplatesUIEnabled',
+ );
+ const isUsingServer = useSyncServerStatus() !== 'no-server';
const showServerPrefs =
localStorage.getItem('devEnableServerPrefs') === 'true';
return (
- <Setting
- primaryAction={
- <View style={{ gap: '1em' }}>
- <FeatureToggle flag="goalTemplatesEnabled">
- <Trans>Goal templates</Trans>
- </FeatureToggle>
- {showGoalTemplatesUI && (
- <View style={{ paddingLeft: 22 }}>
- <FeatureToggle
- flag="goalTemplatesUIEnabled"
- feedbackLink="https://github.com/actualbudget/actual/issues/7692"
- >
- <Trans>Subfeature: Budget automations UI</Trans>
- </FeatureToggle>
- </View>
- )}
- <FeatureToggle
- flag="actionTemplating"
- feedbackLink="https://github.com/actualbudget/actual/issues/3606"
- note={
- <Trans>
- Deprecated: this feature will be removed in a future release.
- Use Excel formula mode (Rule formulae) instead.
- </Trans>
- }
- >
- <Trans>Rule action templating</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="formulaMode"
- feedbackLink="https://github.com/actualbudget/actual/issues/5949"
- >
- <Trans>Excel formula mode (Formula cards & Rule formulas)</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="currency"
- feedbackLink="https://github.com/actualbudget/actual/issues/5191"
- >
- <Trans>Currency support</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="mobileCalculator"
- feedbackLink="https://github.com/actualbudget/actual/issues/8255"
- >
- <Trans>Mobile calculator</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="newSidebarUI"
- feedbackLink="https://github.com/actualbudget/actual/issues/9007"
- >
- <Trans>Redesigned sidebar</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="sankeyReport"
- feedbackLink="https://github.com/actualbudget/actual/issues/1919"
- >
- <Trans>Sankey report</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="balanceForecastReport"
- feedbackLink="https://github.com/actualbudget/actual/issues/7669"
- >
- <Trans>Balance Forecast Report</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="budgetAnalysisReport"
- feedbackLink="https://github.com/actualbudget/actual/issues/6742"
- >
- <Trans>Budget Analysis Report</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="monteCarloReport"
- feedbackLink="https://github.com/actualbudget/actual/issues/8571"
- >
- <Trans>Monte Carlo Analysis Report</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="enableBanking"
- feedbackLink="https://github.com/actualbudget/actual/issues/7799"
- >
- <Trans>Enable Banking sync (EU banks)</Trans>
- </FeatureToggle>
- <FeatureToggle
- flag="akahuBankSync"
- feedbackLink="https://github.com/actualbudget/actual/issues/8020"
- >
- <Trans>Akahu Bank Sync (NZ banks)</Trans>
- </FeatureToggle>
- {showServerPrefs && (
- <ServerFeatureToggle
- prefName="flags.plugins"
- disableToggle
- feedbackLink="https://github.com/actualbudget/actual/issues/5950"
- >
- <Trans>Client-Side plugins (soon)</Trans>
- </ServerFeatureToggle>
- )}
- </View>
- }
+ <SettingsGroup
+ title={t('Experimental features')}
+ description={t(
+ 'These features are not fully tested and may not work as expected. THEY MAY CAUSE IRRECOVERABLE DATA LOSS. They may do nothing at all. Only enable them if you know what you are doing.',
+ )}
>
- <Text>
- <Trans>
- <strong>Experimental features.</strong> These features are not fully
- tested and may not work as expected. THEY MAY CAUSE IRRECOVERABLE DATA
- LOSS. They may do nothing at all. Only enable them if you know what
- you are doing.
- </Trans>
- </Text>
- </Setting>
+ <FeatureToggle
+ flag="goalTemplatesEnabled"
+ onDisable={() => setGoalTemplatesUIPref('false')}
+ subFeatures={
+ goalTemplatesEnabled && (
+ <FeatureToggle
+ flag="goalTemplatesUIEnabled"
+ feedbackLink="https://github.com/actualbudget/actual/issues/7692"
+ isSubFeature
+ >
+ <Trans>Budget automations UI</Trans>
+ </FeatureToggle>
+ )
+ }
+ >
+ <Trans>Goal templates</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="actionTemplating"
+ feedbackLink="https://github.com/actualbudget/actual/issues/3606"
+ note={
+ <Trans>
+ Deprecated: this feature will be removed in a future release. Use
+ Excel formula mode (Rule formulae) instead.
+ </Trans>
+ }
+ >
+ <Trans>Rule action templating</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="formulaMode"
+ feedbackLink="https://github.com/actualbudget/actual/issues/5949"
+ >
+ <Trans>Excel formula mode (Formula cards & Rule formulas)</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="currency"
+ feedbackLink="https://github.com/actualbudget/actual/issues/5191"
+ >
+ <Trans>Currency support</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="mobileCalculator"
+ feedbackLink="https://github.com/actualbudget/actual/issues/8255"
+ >
+ <Trans>Mobile calculator</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="newSidebarUI"
+ feedbackLink="https://github.com/actualbudget/actual/issues/9007"
+ >
+ <Trans>Redesigned sidebar</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="sankeyReport"
+ feedbackLink="https://github.com/actualbudget/actual/issues/1919"
+ >
+ <Trans>Sankey report</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="balanceForecastReport"
+ feedbackLink="https://github.com/actualbudget/actual/issues/7669"
+ >
+ <Trans>Balance Forecast Report</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="budgetAnalysisReport"
+ feedbackLink="https://github.com/actualbudget/actual/issues/6742"
+ >
+ <Trans>Budget Analysis Report</Trans>
+ </FeatureToggle>
+ <FeatureToggle
+ flag="monteCarloReport"
+ feedbackLink="https://github.com/actualbudget/actual/issues/8571"
+ >
+ <Trans>Monte Carlo Analysis Report</Trans>
+ </FeatureToggle>
+ {isUsingServer && (
+ <FeatureToggle
+ flag="enableBanking"
+ feedbackLink="https://github.com/actualbudget/actual/issues/7799"
+ >
+ <Trans>Enable Banking sync (EU banks)</Trans>
+ </FeatureToggle>
+ )}
+ {isUsingServer && (
+ <FeatureToggle
+ flag="akahuBankSync"
+ feedbackLink="https://github.com/actualbudget/actual/issues/8020"
+ >
+ <Trans>Akahu Bank Sync (NZ banks)</Trans>
+ </FeatureToggle>
+ )}
+ {showServerPrefs && (
+ <ServerFeatureToggle
+ prefName="flags.plugins"
+ disableToggle
+ feedbackLink="https://github.com/actualbudget/actual/issues/5950"
+ >
+ <Trans>Client-Side plugins (soon)</Trans>
+ </ServerFeatureToggle>
+ )}
+ </SettingsGroup>
);
}
diff --git a/packages/desktop-client/src/components/settings/Export.tsx b/packages/desktop-client/src/components/settings/Export.tsx
index efc39c800f..35d4c1b03c 100644
--- a/packages/desktop-client/src/components/settings/Export.tsx
+++ b/packages/desktop-client/src/components/settings/Export.tsx
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';
-import { Block } from '@actual-app/components/block';
import { ButtonWithLoading } from '@actual-app/components/button';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
@@ -10,7 +9,7 @@ import { format } from 'date-fns';
import { useMetadataPref } from '#hooks/useMetadataPref';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function ExportBudget() {
const { t } = useTranslation();
@@ -46,54 +45,58 @@ export function ExportBudget() {
}
return (
- <Setting
- primaryAction={
+ <SettingsRow
+ title={t('Export')}
+ description={
<>
- <ButtonWithLoading onPress={onExport} isLoading={isLoading}>
- <Trans>Export data</Trans>
- </ButtonWithLoading>
- {error && (
- <Block style={{ color: theme.errorText, marginTop: 15 }}>
- {t(
- 'An unknown error occurred while exporting. Please report this as a new issue on GitHub.',
- )}
- </Block>
- )}
- {warnings.includes('exceeds-import-size-limit') && (
- <Block style={{ color: theme.warningText, marginTop: 15 }}>
- <Trans>
- This export is larger than Actual can safely re-import. You may
- not be able to restore this backup.
- </Trans>
- </Block>
- )}
- {warnings.includes('may-exceed-available-memory') && (
- <Block style={{ color: theme.warningText, marginTop: 15 }}>
+ <Trans>
+ <span>Export</span> your data as a zip file containing{' '}
+ <code>db.sqlite</code> and <code>metadata.json</code> files. It can
+ be imported into another Actual instance by closing an open file (if
+ any), then clicking the "Import file" button, then choosing
+ "Actual."
+ </Trans>
+ {encryptKeyId ? (
+ <>
+ {' '}
<Trans>
- This export is larger than the memory available on this device.
- Restoring it here may fail.
+ Even though encryption is enabled, the exported zip file will
+ not have any encryption.
</Trans>
- </Block>
- )}
+ </>
+ ) : null}
</>
}
+ control={
+ <ButtonWithLoading onPress={onExport} isLoading={isLoading}>
+ <Trans>Export data</Trans>
+ </ButtonWithLoading>
+ }
>
- <Text>
- <Trans>
- <strong>Export</strong> your data as a zip file containing{' '}
- <code>db.sqlite</code> and <code>metadata.json</code> files. It can be
- imported into another Actual instance by closing an open file (if
- any), then clicking the "Import file" button, then choosing "Actual."
- </Trans>
- </Text>
- {encryptKeyId ? (
- <Text>
+ {error && (
+ <Text style={{ color: theme.errorText }}>
+ <Trans>
+ An unknown error occurred while exporting. Please report this as a
+ new issue on GitHub.
+ </Trans>
+ </Text>
+ )}
+ {warnings.includes('exceeds-import-size-limit') && (
+ <Text style={{ color: theme.warningText }}>
+ <Trans>
+ This export is larger than Actual can safely re-import. You may not
+ be able to restore this backup.
+ </Trans>
+ </Text>
+ )}
+ {warnings.includes('may-exceed-available-memory') && (
+ <Text style={{ color: theme.warningText }}>
<Trans>
- Even though encryption is enabled, the exported zip file will not
- have any encryption.
+ This export is larger than the memory available on this device.
+ Restoring it here may fail.
</Trans>
</Text>
- ) : null}
- </Setting>
+ )}
+ </SettingsRow>
);
}
diff --git a/packages/desktop-client/src/components/settings/Format.tsx b/packages/desktop-client/src/components/settings/Format.tsx
index 9d2cc53c0e..f2d9f7d540 100644
--- a/packages/desktop-client/src/components/settings/Format.tsx
+++ b/packages/desktop-client/src/components/settings/Format.tsx
@@ -3,23 +3,20 @@ import React from 'react';
import { Trans, useTranslation } from 'react-i18next';
import { Select } from '@actual-app/components/select';
-import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { tokens } from '@actual-app/components/tokens';
-import { View } from '@actual-app/components/view';
import { numberFormats } from '@actual-app/core/shared/util';
import type { SyncedPrefs } from '@actual-app/core/types/prefs';
import { css } from '@emotion/css';
import { Checkbox } from '#components/forms';
-import { useSidebar } from '#components/sidebar/SidebarProvider';
import { useDateFormat } from '#hooks/useDateFormat';
import { useDaysOfWeek } from '#hooks/useDaysOfWeek';
import { useSyncedPref } from '#hooks/useSyncedPref';
import { saveSyncedPrefs } from '#prefs/prefsSlice';
import { useDispatch } from '#redux';
-import { Column, Setting } from './UI';
+import { SettingsGroup } from './SettingsGroup';
+import { SettingsRow } from './SettingsRow';
const dateFormats: { value: SyncedPrefs['dateFormat']; label: string }[] = [
{ value: 'MM/dd/yyyy', label: 'MM/DD/YYYY' },
@@ -34,7 +31,6 @@ export function FormatSettings() {
const { t } = useTranslation();
const dispatch = useDispatch();
- const sidebar = useSidebar();
const [_firstDayOfWeekIdx, setFirstDayOfWeekIdxPref] =
useSyncedPref('firstDayOfWeekIdx'); // Sunday;
const firstDayOfWeekIdx = _firstDayOfWeekIdx || '0';
@@ -53,78 +49,68 @@ export function FormatSettings() {
});
return (
- <Setting
- primaryAction={
- <View
- style={{
- flexDirection: 'column',
- gap: '1em',
- width: '100%',
- [`@media (min-width: ${
- sidebar.floating
- ? tokens.breakpoint_small
- : tokens.breakpoint_medium
- })`]: {
- flexDirection: 'row',
- },
- }}
- >
- <Column title={t('Numbers')}>
- <Select
- key={String(hideFraction)} // needed because label does not update
- value={numberFormat}
- onChange={format => {
- void dispatch(
- saveSyncedPrefs({ prefs: { numberFormat: format } }),
- );
- }}
- options={numberFormats.map(f => [
- f.value,
- String(hideFraction) === 'true' ? f.labelNoFraction : f.label,
- ])}
- className={selectButtonClassName}
- />
-
- <Text style={{ display: 'flex' }}>
- <Checkbox
- id="settings-textDecimal"
- checked={String(hideFraction) === 'true'}
- onChange={e =>
- setHideFractionPref(String(e.currentTarget.checked))
- }
- />
- <label htmlFor="settings-textDecimal">
- <Trans>Hide decimal places</Trans>
- </label>
- </Text>
- </Column>
-
- <Column title={t('Dates')}>
- <Select
- value={dateFormat}
- onChange={format => setDateFormatPref(format)}
- options={dateFormats.map(f => [f.value, f.label])}
- className={selectButtonClassName}
- />
- </Column>
-
- <Column title={t('First day of the week')}>
- <Select
- value={firstDayOfWeekIdx}
- onChange={idx => setFirstDayOfWeekIdxPref(idx)}
- options={Object.entries(daysOfWeek)}
- className={selectButtonClassName}
- />
- </Column>
- </View>
- }
- >
- <Text>
+ <SettingsGroup
+ title={t('Formatting')}
+ description={
<Trans>
- <strong>Formatting</strong> does not affect how budget data is stored,
- and can be changed at any time.
+ <span>Formatting</span> does not affect how budget data is stored, and
+ can be changed at any time.
</Trans>
- </Text>
- </Setting>
+ }
+ >
+ <SettingsRow
+ title={t('Number format')}
+ control={
+ <Select
+ key={String(hideFraction)} // needed because label does not update
+ value={numberFormat}
+ onChange={format => {
+ void dispatch(
+ saveSyncedPrefs({ prefs: { numberFormat: format } }),
+ );
+ }}
+ options={numberFormats.map(f => [
+ f.value,
+ String(hideFraction) === 'true' ? f.labelNoFraction : f.label,
+ ])}
+ className={selectButtonClassName}
+ />
+ }
+ />
+ <SettingsRow
+ htmlFor="settings-textDecimal"
+ title={t('Hide decimal places')}
+ control={
+ <Checkbox
+ id="settings-textDecimal"
+ checked={String(hideFraction) === 'true'}
+ onChange={e => setHideFractionPref(String(e.currentTarget.checked))}
+ style={{ marginRight: 0 }}
+ />
+ }
+ />
+ <SettingsRow
+ title={t('Date format')}
+ control={
+ <Select
+ value={dateFormat}
+ onChange={format => setDateFormatPref(format)}
+ options={dateFormats.map(f => [f.value, f.label])}
+ className={selectButtonClassName}
+ />
+ }
+ />
+ <SettingsRow
+ title={t('First day of the week')}
+ control={
+ <Select
+ value={firstDayOfWeekIdx}
+ onChange={idx => setFirstDayOfWeekIdxPref(idx)}
+ options={Object.entries(daysOfWeek)}
+ className={selectButtonClassName}
+ />
+ }
+ />
+ </SettingsGroup>
);
}
diff --git a/packages/desktop-client/src/components/settings/LanguageSettings.tsx b/packages/desktop-client/src/components/settings/LanguageSettings.tsx
index 25d1a83d96..5c014b92ca 100644
--- a/packages/desktop-client/src/components/settings/LanguageSettings.tsx
+++ b/packages/desktop-client/src/components/settings/LanguageSettings.tsx
@@ -4,14 +4,14 @@ import { Trans, useTranslation } from 'react-i18next';
import { Menu } from '@actual-app/components/menu';
import { Select } from '@actual-app/components/select';
import type { SelectOption } from '@actual-app/components/select';
-import { Text } from '@actual-app/components/text';
import type { TFunction } from 'i18next';
import { Link } from '#components/common/Link';
import { useGlobalPref } from '#hooks/useGlobalPref';
import { availableLanguages, setI18NextLanguage } from '#i18n';
-import { Setting } from './UI';
+import { SettingsGroup } from './SettingsGroup';
+import { SettingsRow } from './SettingsRow';
const languageDisplayNameOverride: { [key: string]: string } = {
'pt-BR': 'Português (Brasil)',
@@ -38,56 +38,59 @@ export function LanguageSettings() {
const isEnabled = !!availableLanguages.length;
return (
- <Setting
- primaryAction={
- <Select
- aria-label={t('Select language')}
- options={languageOptions(t)}
- value={isEnabled ? (language ?? '') : 'not-available'}
- defaultLabel={
- isEnabled ? t('Select language') : t('No languages available')
- }
- onChange={value => {
- setLanguage(value);
- setI18NextLanguage(value);
- }}
- disabled={!isEnabled}
- />
- }
- >
- <Text>
- {isEnabled ? (
- <Trans>
- <strong>Language</strong> is the display language of all text.
- Please note that no warranty is provided for the accuracy or
- completeness of non-English translations. If you encounter a
- translation error, feel free to make a suggestion on{' '}
- <Link
- variant="external"
- to={
- 'https://hosted.weblate.org/projects/actualbudget/actual/' +
- (language ?? '')
- }
- linkColor="purple"
- >
- Weblate
- </Link>
- .
- </Trans>
- ) : (
- <Trans>
- <strong>Language</strong> support is not available. Please follow
- the instructions{' '}
- <Link
- variant="external"
- to="https://actualbudget.org/docs/install/build-from-source#translations"
- >
- here
- </Link>{' '}
- to add missing translation files.
- </Trans>
- )}
- </Text>
- </Setting>
+ <SettingsGroup title={t('Language')}>
+ <SettingsRow
+ title={t('Display language')}
+ description={
+ isEnabled ? (
+ <Trans>
+ <span>Language</span> is the display language of all text. Please
+ note that no warranty is provided for the accuracy or completeness
+ of non-English translations. If you encounter a translation error,
+ feel free to make a suggestion on{' '}
+ <Link
+ variant="external"
+ to={
+ 'https://hosted.weblate.org/projects/actualbudget/actual/' +
+ (language ?? '')
+ }
+ linkColor="purple"
+ >
+ Weblate
+ </Link>
+ .
+ </Trans>
+ ) : (
+ <Trans>
+ <span>Language</span> support is not available. Please follow the
+ instructions{' '}
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/install/build-from-source#translations"
+ linkColor="purple"
+ >
+ here
+ </Link>{' '}
+ to add missing translation files.
+ </Trans>
+ )
+ }
+ control={
+ <Select
+ aria-label={t('Select language')}
+ options={languageOptions(t)}
+ value={isEnabled ? (language ?? '') : 'not-available'}
+ defaultLabel={
+ isEnabled ? t('Select language') : t('No languages available')
+ }
+ onChange={value => {
+ setLanguage(value);
+ setI18NextLanguage(value);
+ }}
+ disabled={!isEnabled}
+ />
+ }
+ />
+ </SettingsGroup>
);
}
diff --git a/packages/desktop-client/src/components/settings/RepairTransactions.tsx b/packages/desktop-client/src/components/settings/RepairTransactions.tsx
index 36bfb6bbf9..9c14d8a4d0 100644
--- a/packages/desktop-client/src/components/settings/RepairTransactions.tsx
+++ b/packages/desktop-client/src/components/settings/RepairTransactions.tsx
@@ -3,13 +3,13 @@ import { Trans, useTranslation } from 'react-i18next';
import { ButtonWithLoading } from '@actual-app/components/button';
import { Paragraph } from '@actual-app/components/paragraph';
-import { Text } from '@actual-app/components/text';
+import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
-import { View } from '@actual-app/components/view';
+import { spacing } from '@actual-app/components/tokens';
import { send } from '@actual-app/core/platform/client/connection';
import type { Handlers } from '@actual-app/core/types/handlers';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
type Results = Awaited<ReturnType<Handlers['tools/fix-split-transactions']>>;
@@ -114,6 +114,7 @@ function useRenderResults() {
}
export function RepairTransactions() {
+ const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const [results, setResults] = useState<Results | null>(null);
@@ -128,62 +129,62 @@ export function RepairTransactions() {
}
return (
- <Setting
- primaryAction={
- <View
- style={{
- flexDirection: 'column',
- alignItems: 'flex-start',
- gap: '1em',
- }}
- >
- <ButtonWithLoading isLoading={loading} onPress={onFix}>
- <Trans>Repair transactions</Trans>
- </ButtonWithLoading>
- {results && renderResults(results)}
- </View>
+ <SettingsRow
+ title={t('Split transactions and transfers')}
+ description={
+ <Trans>
+ If you are experiencing bugs relating to split transactions or
+ transfers and the "Reset budget cache" button above does not help,
+ this tool may fix them. Some examples of bugs include seeing blank
+ payees on splits or incorrect account balances. This tool does six
+ things:
+ </Trans>
+ }
+ control={
+ <ButtonWithLoading isLoading={loading} onPress={onFix}>
+ <Trans>Repair transactions</Trans>
+ </ButtonWithLoading>
}
>
- <Trans>
- <Text>
- <strong>Repair transactions</strong> if you are experiencing bugs
- relating to split transactions or transfers and the "Reset budget
- cache" button above does not help, this tool may fix them. Some
- examples of bugs include seeing blank payees on splits or incorrect
- account balances. This tool does six things:
- </Text>
- <ul style={{ margin: 0, paddingLeft: '1.5em' }}>
- <li style={{ marginBottom: '0.5em' }}>
- Ensures that deleted split transactions are fully deleted. In
- previous versions of the app, certain split transactions may appear
- deleted but not all of them are actually deleted. This causes the
- transactions list to look correct, but certain balances may be
- incorrect when filtering.
- </li>
- <li>
- Sync the payee and cleared flag of a split transaction to the main
- or "parent" transaction, if appropriate. The payee will only be set
- if it currently doesn't have one.
- </li>
- <li>
- Checks that the sum of all child transactions adds up to the total
- amount. If not, these will be flagged below to allow you to easily
- locate and fix the amounts.
- </li>
- <li>
- Checks for any non-split transactions with erroneous split errors
- and removes the errors if found.
- </li>
- <li>
- Check if you have any budget transfers that erroneously contain a
- category, and remove the category.
- </li>
- <li>
- Checks for any parent transactions with a category and removes the
- category if found.
- </li>
+ <details style={{ ...styles.smallText, lineHeight: 1.5 }}>
+ <summary style={{ cursor: 'pointer' }}>
+ <Trans>What this repairs</Trans>
+ </summary>
+ <ul style={{ margin: `${spacing.sm}px 0 0`, paddingLeft: '1.5em' }}>
+ <Trans>
+ <li>
+ Ensures that deleted split transactions are fully deleted. In
+ previous versions of the app, certain split transactions may
+ appear deleted but not all of them are actually deleted. This
+ causes the transactions list to look correct, but certain balances
+ may be incorrect when filtering.
+ </li>
+ <li>
+ Sync the payee and cleared flag of a split transaction to the main
+ or "parent" transaction, if appropriate. The payee will only be
+ set if it currently doesn't have one.
+ </li>
+ <li>
+ Checks that the sum of all child transactions adds up to the total
+ amount. If not, these will be flagged below to allow you to easily
+ locate and fix the amounts.
+ </li>
+ <li>
+ Checks for any non-split transactions with erroneous split errors
+ and removes the errors if found.
+ </li>
+ <li>
+ Check if you have any budget transfers that erroneously contain a
+ category, and remove the category.
+ </li>
+ <li>
+ Checks for any parent transactions with a category and removes the
+ category if found.
+ </li>
+ </Trans>
</ul>
- </Trans>
- </Setting>
+ </details>
+ {results && renderResults(results)}
+ </SettingsRow>
);
}
diff --git a/packages/desktop-client/src/components/settings/Reset.tsx b/packages/desktop-client/src/components/settings/Reset.tsx
index d09582f226..87f2c2c4dd 100644
--- a/packages/desktop-client/src/components/settings/Reset.tsx
+++ b/packages/desktop-client/src/components/settings/Reset.tsx
@@ -1,17 +1,17 @@
import React, { useState } from 'react';
-import { Trans } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
import { ButtonWithLoading } from '@actual-app/components/button';
-import { Text } from '@actual-app/components/text';
import { send } from '@actual-app/core/platform/client/connection';
import { resetSync } from '#app/appSlice';
import { useMetadataPref } from '#hooks/useMetadataPref';
import { useDispatch } from '#redux';
-import { Setting } from './UI';
+import { SettingsRow } from './SettingsRow';
export function ResetCache() {
+ const { t } = useTranslation();
const [resetting, setResetting] = useState(false);
async function onResetCache() {
@@ -21,29 +21,29 @@ export function ResetCache() {
}
return (
- <Setting
- primaryAction={
+ <SettingsRow
+ title={t('Budget cache')}
+ description={
+ <Trans>
+ <span>Reset budget cache</span> will clear all cached values for the
+ budget and recalculate the entire budget. All values in the budget are
+ cached for performance reasons, and if there is a bug in the cache you
+ won't see correct values. There is no danger in resetting the cache.
+ Hopefully you never have to do this.
+ </Trans>
+ }
+ control={
<ButtonWithLoading isLoading={resetting} onPress={onResetCache}>
<Trans>Reset budget cache</Trans>
</ButtonWithLoading>
}
- >
- <Text>
- <Trans>
- <strong>Reset budget cache</strong> will clear all cached values for
- the budget and recalculate the entire budget. All values in the budget
- are cached for performance reasons, and if there is a bug in the cache
- you won't see correct values. There is no danger in resetting the
- cache. Hopefully you never have to do this.
- </Trans>
- </Text>
- </Setting>
+ />
);
}
export function ResetSync() {
+ const { t } = useTranslation();
const [groupId] = useMetadataPref('groupId');
- const isEnabled = !!groupId;
const dispatch = useDispatch();
const [resetting, setResetting] = useState(false);
@@ -54,36 +54,27 @@ export function ResetSync() {
setResetting(false);
}
+ if (!groupId) {
+ return null;
+ }
+
return (
- <Setting
- primaryAction={
- <ButtonWithLoading
- isLoading={resetting}
- isDisabled={!isEnabled}
- onPress={onResetSync}
- >
+ <SettingsRow
+ title={t('Sync')}
+ description={
+ <Trans>
+ Reset sync will remove all local data used to track changes for
+ syncing, and create a fresh sync ID on the server. This file on other
+ devices will have to be re-downloaded to use the new sync ID. Use this
+ if there is a problem with syncing and you want to start fresh. This
+ can also improve performance on large budgets.
+ </Trans>
+ }
+ control={
+ <ButtonWithLoading isLoading={resetting} onPress={onResetSync}>
<Trans>Reset sync</Trans>
</ButtonWithLoading>
}
- >
- {isEnabled ? (
- <Text>
- <Trans>
- <strong>Reset sync</strong> will remove all local data used to track
- changes for syncing, and create a fresh sync ID on the server. This
- file on other devices will have to be re-downloaded to use the new
- sync ID. Use this if there is a problem with syncing and you want to
- start fresh.
- </Trans>
- </Text>
- ) : (
- <Text>
- <Trans>
- <strong>Reset sync</strong> is only available when syncing is
- enabled.
- </Trans>
- </Text>
- )}
- </Setting>
+ />
);
}
diff --git a/packages/desktop-client/src/components/settings/SettingsGroup.tsx b/packages/desktop-client/src/components/settings/SettingsGroup.tsx
new file mode 100644
index 0000000000..f0d55e5bdc
--- /dev/null
+++ b/packages/desktop-client/src/components/settings/SettingsGroup.tsx
@@ -0,0 +1,53 @@
+import type { ReactNode } from 'react';
+
+import { styles } from '@actual-app/components/styles';
+import { Text } from '@actual-app/components/text';
+import { theme } from '@actual-app/components/theme';
+import { spacing } from '@actual-app/components/tokens';
+import { View } from '@actual-app/components/view';
+
+type SettingsGroupProps = {
+ title: ReactNode;
+ description?: ReactNode;
+ children: ReactNode;
+};
+
+export function SettingsGroup({
+ title,
+ description,
+ children,
+}: SettingsGroupProps) {
+ return (
+ <View style={{ flexShrink: 0, gap: spacing.sm }}>
+ <View style={{ gap: spacing.xxs }}>
+ <h2 style={{ ...styles.mediumText, fontWeight: 600, margin: 0 }}>
+ {title}
+ </h2>
+ {description && (
+ <Text
+ style={{
+ ...styles.smallText,
+ lineHeight: 1.5,
+ color: theme.settingsCardTextSubdued,
+ }}
+ >
+ {description}
+ </Text>
+ )}
+ </View>
+ <View
+ style={{
+ color: theme.settingsCardText,
+ backgroundColor: theme.settingsCardBackground,
+ border: `1px solid ${theme.settingsCardBorder}`,
+ borderRadius: 6,
+ '&& > * + *': {
+ borderTop: `1px solid ${theme.settingsCardBorder}`,
+ },
+ }}
+ >
+ {children}
+ </View>
+ </View>
+ );
+}
diff --git a/packages/desktop-client/src/components/settings/SettingsRow.tsx b/packages/desktop-client/src/components/settings/SettingsRow.tsx
new file mode 100644
index 0000000000..6d4dc82c7f
--- /dev/null
+++ b/packages/desktop-client/src/components/settings/SettingsRow.tsx
@@ -0,0 +1,82 @@
+import type { ReactNode } from 'react';
+
+import { styles } from '@actual-app/components/styles';
+import { Text } from '@actual-app/components/text';
+import { theme } from '@actual-app/components/theme';
+import { spacing } from '@actual-app/components/tokens';
+import { View } from '@actual-app/components/view';
+
+type SettingsRowProps = {
+ title: ReactNode;
+ description?: ReactNode;
+ control?: ReactNode;
+ htmlFor?: string;
+ isNested?: boolean;
+ children?: ReactNode;
+};
+
+export function SettingsRow({
+ title,
+ description,
+ control,
+ htmlFor,
+ isNested = false,
+ children,
+}: SettingsRowProps) {
+ const titleStyle = { ...styles.smallText, fontWeight: 500 };
+
+ return (
+ <View
+ style={{
+ flexShrink: 0,
+ gap: spacing.md,
+ padding: isNested
+ ? `0 0 0 ${spacing.lg}px`
+ : `${spacing.md}px ${spacing.lg}px`,
+ }}
+ >
+ <View
+ style={{
+ flexDirection: 'row',
+ flexWrap: 'wrap',
+ alignItems: 'center',
+ gap: `${spacing.sm}px ${spacing.lg}px`,
+ }}
+ >
+ <View style={{ flex: '1 1 160px', minWidth: 0, gap: spacing.xxs }}>
+ {htmlFor != null ? (
+ <label htmlFor={htmlFor} style={titleStyle}>
+ {title}
+ </label>
+ ) : (
+ <Text style={titleStyle}>{title}</Text>
+ )}
+ {description && (
+ <Text
+ style={{
+ ...styles.smallText,
+ lineHeight: 1.5,
+ color: theme.settingsCardTextSubdued,
+ }}
+ >
+ {description}
+ </Text>
+ )}
+ </View>
+ {control != null && (
+ <View
+ style={{
+ flexDirection: 'row',
+ alignItems: 'center',
+ flexShrink: 0,
+ maxWidth: '100%',
+ }}
+ >
+ {control}
+ </View>
+ )}
+ </View>
+ {children}
+ </View>
+ );
+}
diff --git a/packages/desktop-client/src/components/settings/Themes.tsx b/packages/desktop-client/src/components/settings/Themes.tsx
index ec2ecb4735..40a12dca39 100644
--- a/packages/desktop-client/src/components/settings/Themes.tsx
+++ b/packages/desktop-client/src/components/settings/Themes.tsx
@@ -5,14 +5,12 @@ import { Button } from '@actual-app/components/button';
import { SvgCode } from '@actual-app/components/icons/v1';
import { Menu } from '@actual-app/components/menu';
import { Select } from '@actual-app/components/select';
-import { Text } from '@actual-app/components/text';
import { theme as themeStyle } from '@actual-app/components/theme';
-import { tokens } from '@actual-app/components/tokens';
+import { spacing } from '@actual-app/components/tokens';
import { View } from '@actual-app/components/view';
import type { DarkTheme, Theme } from '@actual-app/core/types/prefs';
import { css } from '@emotion/css';
-import { useSidebar } from '#components/sidebar/SidebarProvider';
import { useGlobalPref } from '#hooks/useGlobalPref';
import {
darkThemeOptions,
@@ -26,8 +24,9 @@ import {
} from '#style/customThemes';
import type { InstalledTheme } from '#style/customThemes';
+import { SettingsGroup } from './SettingsGroup';
+import { SettingsRow } from './SettingsRow';
import { ThemeInstaller } from './ThemeInstaller';
-import { Column, Setting } from './UI';
const INSTALL_NEW_VALUE = '__install_new__';
const INSTALL_CUSTOM_LIGHT = '__install_custom_light__';
@@ -41,7 +40,6 @@ type InstallerState = {
export function ThemeSettings() {
const { t } = useTranslation();
- const sidebar = useSidebar();
const [theme, switchTheme] = useTheme();
const [darkTheme, switchDarkTheme] = usePreferredDarkTheme();
const [showInstaller, setShowInstaller] = useState<InstallerState>(null);
@@ -192,123 +190,116 @@ export function ThemeSettings() {
);
}, [theme]);
+ if (showInstaller) {
+ return (
+ <SettingsGroup
+ title={t('Themes')}
+ description={
+ <Trans>
+ <span>Themes</span> change the user interface colors.
+ </Trans>
+ }
+ >
+ <View style={{ padding: spacing.lg }}>
+ <ThemeInstaller
+ onInstall={handleInstall}
+ onClose={handleInstallerClose}
+ installedTheme={
+ showInstaller.slot === 'dark'
+ ? installedCustomDarkTheme
+ : installedCustomLightTheme
+ }
+ mode={showInstaller.catalogMode}
+ />
+ </View>
+ </SettingsGroup>
+ );
+ }
+
return (
- <Setting
- primaryAction={
- <View
- style={{
- flexDirection: 'column',
- gap: '1em',
- width: '100%',
- }}
- >
- {!showInstaller && (
- <View
- style={{
- flexDirection: 'column',
- gap: '1em',
- width: '100%',
- [`@media (min-width: ${
- sidebar.floating
- ? tokens.breakpoint_small
- : tokens.breakpoint_medium
- })`]: {
- flexDirection: 'row',
+ <SettingsGroup
+ title={t('Themes')}
+ description={
+ <Trans>
+ <span>Themes</span> change the user interface colors.
+ </Trans>
+ }
+ >
+ <SettingsRow
+ title={t('Theme')}
+ control={
+ <Select<string>
+ onChange={handleThemeChange}
+ value={getCurrentValue()}
+ options={buildOptions()}
+ className={css({
+ '&[data-hovered]': {
+ backgroundColor: themeStyle.buttonNormalBackgroundHover,
+ },
+ maxWidth: '100%',
+ })}
+ />
+ }
+ />
+ {theme === 'auto' && (
+ <SettingsRow
+ title={t('Light theme')}
+ control={
+ <Select<string>
+ onChange={handleLightThemeChange}
+ value={
+ installedCustomLightTheme
+ ? `custom-light:${installedCustomLightTheme.id}`
+ : 'light'
+ }
+ options={buildLightOptions()}
+ className={css({
+ '&[data-hovered]': {
+ backgroundColor: themeStyle.buttonNormalBackgroundHover,
},
- }}
- >
- <Column title={t('Theme')}>
- <Select<string>
- onChange={handleThemeChange}
- value={getCurrentValue()}
- options={buildOptions()}
- className={css({
- '&[data-hovered]': {
- backgroundColor: themeStyle.buttonNormalBackgroundHover,
- },
- maxWidth: '100%',
- })}
- />
- </Column>
- {theme === 'auto' && (
- <>
- <Column title={t('Light theme')}>
- <Select<string>
- onChange={handleLightThemeChange}
- value={
- installedCustomLightTheme
- ? `custom-light:${installedCustomLightTheme.id}`
- : 'light'
- }
- options={buildLightOptions()}
- className={css({
- '&[data-hovered]': {
- backgroundColor:
- themeStyle.buttonNormalBackgroundHover,
- },
- maxWidth: '100%',
- })}
- />
- </Column>
- <Column title={t('Dark theme')}>
- <Select<string>
- onChange={handleDarkThemeChange}
- value={
- installedCustomDarkTheme
- ? `custom-dark:${installedCustomDarkTheme.id}`
- : darkTheme
- }
- options={buildDarkOptions()}
- className={css({
- '&[data-hovered]': {
- backgroundColor:
- themeStyle.buttonNormalBackgroundHover,
- },
- maxWidth: '100%',
- })}
- />
- </Column>
- </>
- )}
- </View>
- )}
-
- {!showInstaller && hasCustomCssOverride && (
+ maxWidth: '100%',
+ })}
+ />
+ }
+ />
+ )}
+ {theme === 'auto' && (
+ <SettingsRow
+ title={t('Dark theme')}
+ control={
+ <Select<string>
+ onChange={handleDarkThemeChange}
+ value={
+ installedCustomDarkTheme
+ ? `custom-dark:${installedCustomDarkTheme.id}`
+ : darkTheme
+ }
+ options={buildDarkOptions()}
+ className={css({
+ '&[data-hovered]': {
+ backgroundColor: themeStyle.buttonNormalBackgroundHover,
+ },
+ maxWidth: '100%',
+ })}
+ />
+ }
+ />
+ )}
+ {hasCustomCssOverride && (
+ <SettingsRow
+ title={t('Custom CSS is active')}
+ control={
<Button
- variant="bare"
aria-label={t('Custom CSS override active — click to edit')}
onPress={handleEditOverride}
- style={{
- alignSelf: 'flex-start',
- color: themeStyle.pageTextPositive,
- gap: 6,
- }}
+ style={{ gap: spacing.xs }}
>
- <Trans>Custom CSS is active</Trans>
+ <Trans>Edit</Trans>
<SvgCode style={{ width: 14, height: 14 }} />
</Button>
- )}
-
- {showInstaller && (
- <ThemeInstaller
- onInstall={handleInstall}
- onClose={handleInstallerClose}
- installedTheme={
- showInstaller.slot === 'dark'
- ? installedCustomDarkTheme
- : installedCustomLightTheme
- }
- mode={showInstaller.catalogMode}
- />
- )}
- </View>
- }
- >
- <Text>
- <Trans>
- <strong>Themes</strong> change the user interface colors.
- </Trans>
- </Text>
- </Setting>
+ }
+ />
+ )}
+ </SettingsGroup>
);
}
diff --git a/packages/desktop-client/src/components/settings/UI.tsx b/packages/desktop-client/src/components/settings/UI.tsx
index 828d345810..5d8a420bb6 100644
--- a/packages/desktop-client/src/components/settings/UI.tsx
+++ b/packages/desktop-client/src/components/settings/UI.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import type { ReactNode } from 'react';
import type { CSSProperties } from '@actual-app/components/styles';
-import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
@@ -42,30 +41,3 @@ export const Setting = ({ primaryAction, style, children }: SettingProps) => {
</View>
);
};
-
-export function Column({
- title,
- children,
- style,
-}: {
- title: string;
- children: ReactNode;
- style?: CSSProperties;
-}) {
- return (
- <View
- style={{
- alignItems: 'flex-start',
- flexGrow: 1,
- gap: '0.5em',
- width: '100%',
- ...style,
- }}
- >
- <Text style={{ fontWeight: 500 }}>{title}</Text>
- <View style={{ alignItems: 'flex-start', gap: '1em', width: '100%' }}>
- {children}
- </View>
- </View>
- );
-}
diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx
index 5743f95f9d..42dd210737 100644
--- a/packages/desktop-client/src/components/settings/index.tsx
+++ b/packages/desktop-client/src/components/settings/index.tsx
@@ -6,13 +6,13 @@ import { Navigate, Outlet } from 'react-router';
import { Button } from '@actual-app/components/button';
import { useResponsive } from '@actual-app/components/hooks/useResponsive';
import { Input } from '@actual-app/components/input';
+import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { spacing, tokens } from '@actual-app/components/tokens';
+import { spacing } from '@actual-app/components/tokens';
import { View } from '@actual-app/components/view';
import { listen } from '@actual-app/core/platform/client/connection';
import { isElectron } from '@actual-app/core/shared/environment';
-import { css } from '@emotion/css';
import { getLatestAppVersion } from '#app/appSlice';
import { closeBudget } from '#budgetfiles/budgetfilesSlice';
@@ -20,7 +20,7 @@ import { Link } from '#components/common/Link';
import { Checkbox, FormField, FormLabel } from '#components/forms';
import { MOBILE_NAV_HEIGHT } from '#components/mobile/MobileNavTabs';
import { MobilePageHeader, Page } from '#components/Page';
-import { useServerVersion } from '#components/ServerContext';
+import { useServerURL, useServerVersion } from '#components/ServerContext';
import { useFeatureFlag } from '#hooks/useFeatureFlag';
import { useGlobalPref } from '#hooks/useGlobalPref';
import { useMetadataPref } from '#hooks/useMetadataPref';
@@ -39,11 +39,14 @@ import { LanguageSettings } from './LanguageSettings';
import { RepairTransactions } from './RepairTransactions';
import { ResetCache, ResetSync } from './Reset';
import { SettingsBackButton } from './SettingsBackButton';
+import { SettingsGroup } from './SettingsGroup';
import { SettingsNav } from './SettingsNav';
+import { SettingsRow } from './SettingsRow';
import { ThemeSettings } from './Themes';
-import { Setting } from './UI';
function About() {
+ const { t } = useTranslation();
+ const serverURL = useServerURL();
const version = useServerVersion();
const versionInfo = useSelector(state => state.app.versionInfo);
const [notifyWhenUpdateIsAvailable, setNotifyWhenUpdateIsAvailablePref] =
@@ -55,138 +58,120 @@ function About() {
const isNewsFeedEnabled = Boolean(showNewsFeed);
return (
- <Setting>
- <Text>
+ <SettingsGroup
+ title={t('About')}
+ description={
<Trans>
- <strong>Actual</strong> is a super fast privacy-focused app for
- managing your finances.
+ <span>Actual</span> is a super fast privacy-focused app for managing
+ your finances.
</Trans>
- </Text>
- <View
- style={{
- flexDirection: 'column',
- gap: 10,
- }}
- className={css({
- [`@media (min-width: ${tokens.breakpoint_small})`]: {
- display: 'grid',
- gridTemplateRows: '1fr 1fr',
- gridTemplateColumns: '50% 50%',
- columnGap: '2em',
- gridAutoFlow: 'column',
- },
- })}
- data-vrt-mask
- >
- <Text>
- <Trans>
- Client version: {{ version: `v${window.Actual?.ACTUAL_VERSION}` }}
- </Trans>
- </Text>
- <Text>
- <Trans>Server version: {{ version }}</Trans>
- </Text>
-
- {notifyWhenUpdateIsAvailable && versionInfo?.isOutdated ? (
- <Link
- variant="external"
- to="https://actualbudget.org/docs/releases"
- linkColor="purple"
- >
+ }
+ >
+ <SettingsRow
+ title={t('Client version')}
+ control={
+ <Text data-vrt-mask style={styles.tnum}>
+ {`v${window.Actual?.ACTUAL_VERSION}`}
+ </Text>
+ }
+ />
+ {serverURL && (
+ <SettingsRow
+ title={t('Server version')}
+ control={
+ <Text data-vrt-mask style={styles.tnum}>
+ {version}
+ </Text>
+ }
+ />
+ )}
+ <SettingsRow
+ title={t('Updates')}
+ description={
+ notifyWhenUpdateIsAvailable &&
+ (versionInfo?.isOutdated ? (
<Trans>New version available: {versionInfo.latestVersion}</Trans>
- </Link>
- ) : (
- <Text style={{ color: theme.noticeText, fontWeight: 600 }}>
- {notifyWhenUpdateIsAvailable ? (
+ ) : (
+ <Text style={{ color: theme.noticeText, fontWeight: 600 }}>
<Trans>You're up to date!</Trans>
- ) : null}
- </Text>
- )}
- <Text>
- <Link
- variant="external"
- to="https://actualbudget.org/docs/releases"
- linkColor="purple"
- >
- <Trans>Release Notes</Trans>
- </Link>
- {isNewsFeedEnabled && (
- <>
- {' · '}
+ </Text>
+ ))
+ }
+ control={
+ <View style={{ flexDirection: 'row', gap: spacing.md }}>
+ <Link
+ variant="external"
+ to="https://actualbudget.org/docs/releases"
+ linkColor="purple"
+ >
+ <Trans>Release Notes</Trans>
+ </Link>
+ {isNewsFeedEnabled && (
<Link variant="internal" to="/notifications">
<Trans>Notifications</Trans>
</Link>
- </>
- )}
- </Text>
- </View>
- <View style={{ gap: 5 }}>
- <Text style={{ display: 'flex' }}>
+ )}
+ </View>
+ }
+ />
+ <SettingsRow
+ htmlFor="settings-notifyWhenUpdateIsAvailable"
+ title={t('Update notifications')}
+ description={t('Display a notification when updates are available.')}
+ control={
<Checkbox
id="settings-notifyWhenUpdateIsAvailable"
checked={notifyWhenUpdateIsAvailable}
onChange={e =>
setNotifyWhenUpdateIsAvailablePref(e.currentTarget.checked)
}
+ style={{ marginRight: 0 }}
/>
- <label htmlFor="settings-notifyWhenUpdateIsAvailable">
- <Trans>Display a notification when updates are available</Trans>
- </label>
- </Text>
- <Text style={{ display: 'flex' }}>
+ }
+ />
+ <SettingsRow
+ htmlFor="settings-showNewsFeed"
+ title={t('In-app notifications')}
+ description={t('Show release notes and announcements in the app.')}
+ control={
<Checkbox
id="settings-showNewsFeed"
checked={showNewsFeed}
onChange={e => setShowNewsFeedPref(e.currentTarget.checked)}
+ style={{ marginRight: 0 }}
/>
- <label htmlFor="settings-showNewsFeed">
- <Trans>
- Show in-app notifications (release notes and announcements)
- </Trans>
- </label>
- </Text>
- </View>
- </Setting>
+ }
+ />
+ </SettingsGroup>
);
}
-function IDName({ children }: { children: ReactNode }) {
- return <Text style={{ fontWeight: 500 }}>{children}</Text>;
-}
-
function AdvancedAbout() {
const [budgetId] = useMetadataPref('id');
const [groupId] = useMetadataPref('groupId');
const { t } = useTranslation();
+ const idStyle = { userSelect: 'text', wordBreak: 'break-all' } as const;
return (
- <Setting>
- <Text>
- <Trans>
- <strong>IDs</strong> are the names Actual uses to identify your budget
- internally. There are several different IDs associated with your
- budget. The Budget ID is used to identify your budget file. The Sync
- ID is used to access the budget on the server.
- </Trans>
- </Text>
- <Text>
- <Trans>
- <IDName>Budget ID:</IDName> {{ budgetId }}
- </Trans>
- </Text>
- <Text style={{ color: theme.pageText }}>
- <Trans>
- <IDName>Sync ID:</IDName> {{ syncId: groupId || t('(none)') }}
- </Trans>
- </Text>
- {/* low priority todo: eliminate some or all of these, or decide when/if to show them */}
- {/* <Text>
- <IDName>Cloud File ID:</IDName> {prefs.cloudFileId || t('(none)')}
- </Text>
- <Text>
- <IDName>User ID:</IDName> {prefs.userId || t('(none)')}
- </Text> */}
- </Setting>
+ <SettingsGroup
+ title={t('Budget file')}
+ description={t(
+ 'IDs are the names Actual uses to identify your budget internally.',
+ )}
+ >
+ <SettingsRow
+ title={t('Budget ID')}
+ description={t('Identifies the budget file.')}
+ control={<Text style={idStyle}>{budgetId}</Text>}
+ />
+ {groupId && (
+ <SettingsRow
+ title={t('Sync ID')}
+ description={t('Used to access the budget on the server.')}
+ control={<Text style={idStyle}>{groupId}</Text>}
+ />
+ )}
+ </SettingsGroup>
);
}
@@ -204,9 +189,9 @@ function SettingsSections({ title, children }: SettingsSectionsProps) {
style={{
marginTop: isNarrowWidth ? 10 : 0,
flexShrink: 0,
- maxWidth: 530,
+ maxWidth: 640,
width: '100%',
- gap: 30,
+ gap: spacing.xl,
paddingBottom: MOBILE_NAV_HEIGHT,
}}
>
@@ -283,6 +268,7 @@ export function SettingsIndex() {
export function GeneralSettings() {
const { t } = useTranslation();
const isCurrencyExperimentalEnabled = useFeatureFlag('currency');
+ const serverURL = useServerURL();
return (
<SettingsSections title={t('General')}>
@@ -291,11 +277,19 @@ export function GeneralSettings() {
<FormatSettings />
{isCurrencyExperimentalEnabled && <CurrencySettings />}
<LanguageSettings />
- <AuthSettings />
- <EncryptionSettings />
- <BudgetTypeSettings />
- {isElectron() && <Backups />}
- <ExportBudget />
+ <SettingsGroup title={t('Budget')}>
+ <BudgetTypeSettings />
+ </SettingsGroup>
+ {serverURL && (
+ <SettingsGroup title={t('Security')}>
+ <AuthSettings />
+ <EncryptionSettings />
+ </SettingsGroup>
+ )}
+ <SettingsGroup title={t('Data')}>
+ {isElectron() && <Backups />}
+ <ExportBudget />
+ </SettingsGroup>
</SettingsSections>
);
}
@@ -306,9 +300,11 @@ export function AdvancedSettings() {
return (
<SettingsSections title={t('Advanced')}>
<AdvancedAbout />
- <ResetCache />
- <ResetSync />
- <RepairTransactions />
+ <SettingsGroup title={t('Troubleshooting')}>
+ <ResetCache />
+ <ResetSync />
+ <RepairTransactions />
+ </SettingsGroup>
</SettingsSections>
);
}
diff --git a/upcoming-release-notes/settings-grouped-rows.md b/upcoming-release-notes/settings-grouped-rows.md
new file mode 100644
index 0000000000..8c399e5d6f
--- /dev/null
+++ b/upcoming-release-notes/settings-grouped-rows.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [matt-fidd]
+---
+
+Redesign the settings pages as grouped rows with shorter descriptions