Skip to content

A local-first personal finance app

Customize tags colors (#5032)

POGMAN405c8b986f39
diff --git a/packages/component-library/package.json b/packages/component-library/package.json
index 985afd48d0..ed330f0a0a 100644
--- a/packages/component-library/package.json
+++ b/packages/component-library/package.json
@@ -48,7 +48,8 @@
"./tokens": "./src/tokens.ts",
"./toggle": "./src/Toggle.tsx",
"./tooltip": "./src/Tooltip.tsx",
- "./view": "./src/View.tsx"
+ "./view": "./src/View.tsx",
+ "./color-picker": "./src/ColorPicker.tsx"
},
"scripts": {
"generate:icons": "rm src/icons/*/*.tsx; cd src/icons && svgr --template template.ts --index-template index-template.ts --typescript --expand-props start -d . .",
diff --git a/packages/component-library/src/ColorPicker.tsx b/packages/component-library/src/ColorPicker.tsx
new file mode 100644
index 0000000000..ea27e8be3d
--- /dev/null
+++ b/packages/component-library/src/ColorPicker.tsx
@@ -0,0 +1,135 @@
+import { ChangeEvent, ReactNode } from 'react';
+import {
+ ColorPicker as AriaColorPicker,
+ ColorPickerProps as AriaColorPickerProps,
+ Dialog,
+ DialogTrigger,
+ ColorSwatch as AriaColorSwatch,
+ ColorSwatchProps,
+ ColorSwatchPicker as AriaColorSwatchPicker,
+ ColorSwatchPickerItem,
+ ColorField,
+ parseColor,
+} from 'react-aria-components';
+
+import { css } from '@emotion/css';
+
+import { Input } from './Input';
+import { Popover } from './Popover';
+
+function ColorSwatch(props: ColorSwatchProps) {
+ return (
+ <AriaColorSwatch
+ {...props}
+ style={({ color }) => ({
+ background: color.toString('hex'),
+ width: '32px',
+ height: '32px',
+ borderRadius: '4px',
+ boxShadow: 'inset 0 0 0 1px rgba(0, 0, 0, 0.1)',
+ })}
+ />
+ );
+}
+
+// colors from https://materialui.co/colors
+const colorsets = [
+ ['#D32F2F', '#C2185B', '#7B1FA2', '#512DA8', '#303F9F'],
+ ['#1976D2', '#0288D1', '#0097A7', '#00796B', '#388E3C'],
+ ['#689F38', '#AFB42B', '#FBC02D', '#FFA000', '#F57C00'],
+ ['#E64A19', '#5D4037', '#616161', '#455A64', '#690CB0'],
+];
+
+function ColorSwatchPicker() {
+ return (
+ <>
+ {colorsets.map((colors, idx) => (
+ <AriaColorSwatchPicker
+ key={`colorset-${idx}`}
+ style={{
+ display: 'flex',
+ gap: '8px',
+ flexWrap: 'wrap',
+ }}
+ >
+ {colors.map(color => (
+ <ColorSwatchPickerItem
+ key={color}
+ color={color}
+ className={css({
+ position: 'relative',
+ outline: 'none',
+ borderRadius: '4px',
+ width: 'fit-content',
+ forcedColorAdjust: 'none',
+ cursor: 'pointer',
+
+ '&[data-selected]::after': {
+ content: '‘’',
+ position: 'absolute',
+ inset: 0,
+ border: '2px solid black',
+ outline: '2px solid white',
+ outlineOffset: '-4px',
+ borderRadius: 'inherit',
+ },
+ })}
+ >
+ <ColorSwatch />
+ </ColorSwatchPickerItem>
+ ))}
+ </AriaColorSwatchPicker>
+ ))}
+ </>
+ );
+}
+const isColor = (value: string) => /^#[0-9a-fA-F]{6}$/.test(value);
+
+interface ColorPickerProps extends AriaColorPickerProps {
+ children?: ReactNode;
+}
+
+export function ColorPicker({ children, ...props }: ColorPickerProps) {
+ const onInput = (value: string) => {
+ if (!isColor(value)) {
+ return;
+ }
+
+ const color = parseColor(value);
+ if (color) {
+ props.onChange?.(color);
+ }
+ };
+
+ return (
+ <AriaColorPicker {...props}>
+ <DialogTrigger>
+ {children}
+ <Popover>
+ <Dialog
+ style={{
+ outline: 'none',
+ padding: '15px',
+ display: 'flex',
+ flexDirection: 'column',
+ gap: '8px',
+ minWidth: '192px',
+ maxHeight: 'inherit',
+ boxSizing: 'border-box',
+ overflow: 'auto',
+ }}
+ >
+ <ColorSwatchPicker />
+ <ColorField
+ onInput={({ target: { value } }: ChangeEvent<HTMLInputElement>) =>
+ onInput(value)
+ }
+ >
+ <Input placeholder="#RRGGBB" style={{ width: '100px' }} />
+ </ColorField>
+ </Dialog>
+ </Popover>
+ </DialogTrigger>
+ </AriaColorPicker>
+ );
+}
diff --git a/packages/component-library/src/theme.ts b/packages/component-library/src/theme.ts
index b6662d8e6c..fad11b59c2 100644
--- a/packages/component-library/src/theme.ts
+++ b/packages/component-library/src/theme.ts
@@ -188,6 +188,7 @@ export const theme = {
reportsInnerLabel: 'var(--color-reportsInnerLabel)',
noteTagBackground: 'var(--color-noteTagBackground)',
noteTagBackgroundHover: 'var(--color-noteTagBackgroundHover)',
+ noteTagDefault: 'var(--color-noteTagDefault)',
noteTagText: 'var(--color-noteTagText)',
budgetOtherMonth: 'var(--color-budgetOtherMonth)',
budgetCurrentMonth: 'var(--color-budgetCurrentMonth)',
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-1-chromium-linux.png
index 399b277d27..24d12e3fcf 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-2-chromium-linux.png
index dd997ba4ac..4fa0707ee4 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-3-chromium-linux.png
index 8dfd4e2056..327e89227b 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-applies-budget-template-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--14404-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--14404-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png
index b2a740010e..ddf02a1ca4 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--14404-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--14404-in-the-page-header-opens-the-month-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--321fd-ed-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--321fd-ed-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png
index 379c966e0c..c05594460c 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--321fd-ed-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--321fd-ed-amount-opens-the-budget-summary-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--4bb70-ed-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--4bb70-ed-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png
index c3b972ed46..827ffd23a4 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--4bb70-ed-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--4bb70-ed-amount-opens-the-budget-summary-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6ab37-roup-name-opens-the-category-group-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6ab37-roup-name-opens-the-category-group-menu-modal-1-chromium-linux.png
index 12047a7b84..732af162c1 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6ab37-roup-name-opens-the-category-group-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6ab37-roup-name-opens-the-category-group-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6dbdb-page-header-shows-the-previous-month-s-budget-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6dbdb-page-header-shows-the-previous-month-s-budget-1-chromium-linux.png
index 6d8e2462eb..7ea0871f54 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6dbdb-page-header-shows-the-previous-month-s-budget-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--6dbdb-page-header-shows-the-previous-month-s-budget-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a79-roup-name-opens-the-category-group-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a79-roup-name-opens-the-category-group-menu-modal-2-chromium-linux.png
index 3fe49e5161..3b18beb750 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a79-roup-name-opens-the-category-group-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a79-roup-name-opens-the-category-group-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a85-ed-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a85-ed-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png
index 6b22b84dc9..dc10517cfe 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a85-ed-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--94a85-ed-amount-opens-the-budget-summary-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--96ebb-page-header-shows-the-previous-month-s-budget-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--96ebb-page-header-shows-the-previous-month-s-budget-3-chromium-linux.png
index 3bd805f017..04f39afc80 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--96ebb-page-header-shows-the-previous-month-s-budget-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--96ebb-page-header-shows-the-previous-month-s-budget-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--9e6aa-in-the-page-header-opens-the-budget-page-menu-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--9e6aa-in-the-page-header-opens-the-budget-page-menu-1-chromium-linux.png
index 2196dc6bcb..1fa166fcb0 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--9e6aa-in-the-page-header-opens-the-budget-page-menu-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--9e6aa-in-the-page-header-opens-the-budget-page-menu-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bbde3-roup-name-opens-the-category-group-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bbde3-roup-name-opens-the-category-group-menu-modal-3-chromium-linux.png
index d32a3ac154..07140a5e9e 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bbde3-roup-name-opens-the-category-group-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bbde3-roup-name-opens-the-category-group-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bed18-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bed18-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png
index 3d2d312f45..f3943803b8 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bed18-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--bed18-in-the-page-header-opens-the-month-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ceb3a-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ceb3a-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png
index 0215a1dc35..2f896600a7 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ceb3a-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--ceb3a-in-the-page-header-opens-the-month-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d270d-in-the-page-header-opens-the-budget-page-menu-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d270d-in-the-page-header-opens-the-budget-page-menu-2-chromium-linux.png
index 4013a9a836..8946c64efe 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d270d-in-the-page-header-opens-the-budget-page-menu-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d270d-in-the-page-header-opens-the-budget-page-menu-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d7184-page-header-shows-the-previous-month-s-budget-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d7184-page-header-shows-the-previous-month-s-budget-2-chromium-linux.png
index 9fc270e6e0..e8d2d2ba2d 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d7184-page-header-shows-the-previous-month-s-budget-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--d7184-page-header-shows-the-previous-month-s-budget-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--fdd57-in-the-page-header-opens-the-budget-page-menu-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--fdd57-in-the-page-header-opens-the-budget-page-menu-3-chromium-linux.png
index 2346c53450..bd8aa8b03b 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--fdd57-in-the-page-header-opens-the-budget-page-menu-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking--fdd57-in-the-page-header-opens-the-budget-page-menu-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-1-chromium-linux.png
index 62b1ffb765..d791491a36 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-2-chromium-linux.png
index 3bcbd9acd5..1ebb489500 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-3-chromium-linux.png
index a3e9748341..6bcf376add 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-balance-cell-opens-the-balance-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png
index 4cbfdeafa7..84274920fe 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png
index 2434209b89..5357b38377 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png
index 30475581c8..1d4ea41a85 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-budgeted-cell-opens-the-budget-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-1-chromium-linux.png
index 624787633a..87c0cbc80e 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-2-chromium-linux.png
index 444a9998c9..8307d6bd1a 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-3-chromium-linux.png
index 76a08b5f5d..37c213369a 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-checks-that-clicking-the-category-name-opens-the-category-menu-modal-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-1-chromium-linux.png
index 157a316302..a9f2610add 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-2-chromium-linux.png
index 4b83745deb..d1d2f9337c 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-3-chromium-linux.png
index 5e99467983..3f0dca84b0 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-copies-last-month-s-budget-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png
index 5284e0d8b1..58d4c00f74 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png
index 5d01e8e982..46339a1d88 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png
index 6b945521b7..965f6bb57f 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-loads-the-budget-page-with-budgeted-amounts-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-1-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-1-chromium-linux.png
index f3324c4664..943d007986 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-1-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-2-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-2-chromium-linux.png
index 39c12e6a9b..068aade9d3 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-2-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-3-chromium-linux.png b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-3-chromium-linux.png
index 4900b7158b..45dd0d1c34 100644
Binary files a/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-3-chromium-linux.png and b/packages/desktop-client/e2e/budget.mobile.test.ts-snapshots/Mobile-Budget-Envelope-updates-the-budgeted-amount-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-1-chromium-linux.png
index 206fd3ef04..98a756543f 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-2-chromium-linux.png
index e58ae43564..9f6e5f47bd 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-3-chromium-linux.png
index 957c4c90a6..61de822d5e 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-4-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-4-chromium-linux.png
index c0e407722b..0676d55a6b 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-4-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-4-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-5-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-5-chromium-linux.png
index ea94dbb9d6..399c38bc0f 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-5-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-5-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-6-chromium-linux.png b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-6-chromium-linux.png
index 6bd365161a..eddfcc2b7a 100644
Binary files a/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-6-chromium-linux.png and b/packages/desktop-client/e2e/payees.test.ts-snapshots/Payees-checks-the-payees-page-visuals-6-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-1-chromium-linux.png
index 7d66ee7e5e..bf812243c4 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png
index a3fadb521a..299b4db909 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-3-chromium-linux.png
index a952776561..963d73ab0d 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-checks-the-page-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png
index ce99e012c0..3ab6726d4e 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png
index 09c8fdea6c..9bf1c51a8c 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png
index 576b226cbe..cf72c29978 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png
index 8488fab56f..d866aebce9 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-4-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png
index e8ea47c75c..ba4eb6de92 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-5-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png
index fe0dfd8d43..fe667fd714 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-6-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png
index f3a9dea74d..ab43b1d7d7 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png
index 4fdc327775..af8709749d 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png
index aa1ed73bac..741fd45550 100644
Binary files a/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png and b/packages/desktop-client/e2e/rules.test.ts-snapshots/Rules-creates-a-split-transaction-rule-and-makes-sure-it-is-applied-when-creating-a-transaction-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-10-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-10-chromium-linux.png
index ec89b479f7..0475e8ac9e 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-10-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-10-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-11-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-11-chromium-linux.png
index 1922ea9bdf..5db6825996 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-11-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-11-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png
index bb994e22b5..922aa864fd 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-12-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png
index dcab91a82d..cba4f6ed84 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-13-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png
index 2cc21d9a2e..9624705d7e 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-14-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-chromium-linux.png b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-chromium-linux.png
index dd1c09f996..7fdfb46b3c 100644
Binary files a/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-chromium-linux.png and b/packages/desktop-client/e2e/schedules.test.ts-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-15-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 3ffacba588..7b23880301 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 b7296d48d8..cc820f6d42 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 b1331d277b..15d42dca9a 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 9c427bda03..b5f174d884 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 be2dc15032..1b2250e23d 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 88b38e20de..ae521a2c58 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/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-7-chromium-linux.png b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-7-chromium-linux.png
index 5d4dcc5dd0..21de503750 100644
Binary files a/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-7-chromium-linux.png and b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-7-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-8-chromium-linux.png b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-8-chromium-linux.png
index 951569f562..0362b387ed 100644
Binary files a/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-8-chromium-linux.png and b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-8-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-9-chromium-linux.png b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-9-chromium-linux.png
index 3ac0392c9b..700fb72903 100644
Binary files a/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-9-chromium-linux.png and b/packages/desktop-client/e2e/transactions.mobile.test.ts-snapshots/Mobile-Transactions-creates-a-transaction-via-footer-button-9-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/CommandBar.tsx b/packages/desktop-client/src/components/CommandBar.tsx
index 83d8627077..9ee4e92672 100644
--- a/packages/desktop-client/src/components/CommandBar.tsx
+++ b/packages/desktop-client/src/components/CommandBar.tsx
@@ -13,6 +13,7 @@ import {
SvgPiggyBank,
SvgReports,
SvgStoreFront,
+ SvgTag,
SvgTuning,
SvgWallet,
} from '@actual-app/components/icons/v1';
@@ -67,6 +68,7 @@ export function CommandBar() {
},
{ id: 'payees', name: t('Payees'), path: '/payees', Icon: SvgStoreFront },
{ id: 'rules', name: t('Rules'), path: '/rules', Icon: SvgTuning },
+ { id: 'tags', name: t('Tags'), path: '/tags', Icon: SvgTag },
{ id: 'settings', name: t('Settings'), path: '/settings', Icon: SvgCog },
],
[t],
diff --git a/packages/desktop-client/src/components/FinancesApp.tsx b/packages/desktop-client/src/components/FinancesApp.tsx
index 2497184c99..d0a382446a 100644
--- a/packages/desktop-client/src/components/FinancesApp.tsx
+++ b/packages/desktop-client/src/components/FinancesApp.tsx
@@ -28,6 +28,7 @@ import { ScrollProvider } from './ScrollProvider';
import { useMultiuserEnabled } from './ServerContext';
import { Settings } from './settings';
import { FloatableSidebar } from './sidebar';
+import { ManageTagsPage } from './tags/ManageTagsPage';
import { Titlebar } from './Titlebar';
import { sync } from '@desktop-client/app/appSlice';
@@ -258,6 +259,7 @@ export function FinancesApp() {
<Route path="/payees" element={<ManagePayeesPage />} />
<Route path="/rules" element={<ManageRulesPage />} />
<Route path="/bank-sync" element={<BankSync />} />
+ <Route path="/tags" element={<ManageTagsPage />} />
<Route path="/settings" element={<Settings />} />
<Route
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
index d2e3aea107..f6fdf4ae2d 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
@@ -47,6 +47,7 @@ import { useCachedSchedules } from '@desktop-client/hooks/useCachedSchedules';
import { useCategories } from '@desktop-client/hooks/useCategories';
import { useDisplayPayee } from '@desktop-client/hooks/useDisplayPayee';
import { usePayee } from '@desktop-client/hooks/usePayee';
+import { NotesTagFormatter } from '@desktop-client/notes/NotesTagFormatter';
import { useSelector } from '@desktop-client/redux';
const ROW_HEIGHT = 60;
@@ -285,7 +286,7 @@ export function TransactionListItem({
opacity: 0.85,
}}
>
- {notes}
+ <NotesTagFormatter notes={notes} />
</TextOneLine>
)}
</View>
diff --git a/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx b/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
index cd08330010..f8cec43e51 100644
--- a/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
+++ b/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
@@ -9,6 +9,7 @@ import {
SvgCreditCard,
SvgReports,
SvgStoreFront,
+ SvgTag,
SvgTuning,
SvgWallet,
} from '@actual-app/components/icons/v1';
@@ -77,6 +78,12 @@ export function PrimaryButtons() {
indent={15}
/>
)}
+ <SecondaryItem
+ title={t('Tags')}
+ Icon={SvgTag}
+ to="/tags"
+ indent={15}
+ />
<SecondaryItem
title={t('Settings')}
Icon={SvgCog}
diff --git a/packages/desktop-client/src/components/tags/ManageTags.tsx b/packages/desktop-client/src/components/tags/ManageTags.tsx
new file mode 100644
index 0000000000..84e868b9c2
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/ManageTags.tsx
@@ -0,0 +1,135 @@
+import React, { useCallback, useMemo, useState } from 'react';
+import { Trans, useTranslation } from 'react-i18next';
+
+import { Button } from '@actual-app/components/button';
+import { SvgAdd } from '@actual-app/components/icons/v1';
+import { Stack } from '@actual-app/components/stack';
+import { theme } from '@actual-app/components/theme';
+import { View } from '@actual-app/components/view';
+
+import { getNormalisedString } from 'loot-core/shared/normalisation';
+
+import { TagCreationRow } from './TagCreationRow';
+import { TagsHeader } from './TagsHeader';
+import { TagsList } from './TagsList';
+
+import { Search } from '@desktop-client/components/common/Search';
+import {
+ SelectedProvider,
+ useSelected,
+} from '@desktop-client/hooks/useSelected';
+import { deleteAllTags } from '@desktop-client/queries/queriesSlice';
+import { useDispatch } from '@desktop-client/redux';
+import { useTags } from '@desktop-client/style/tags';
+
+export function ManageTags() {
+ const { t } = useTranslation();
+ const dispatch = useDispatch();
+ const [filter, setFilter] = useState('');
+ const [hoveredTag, setHoveredTag] = useState<string>();
+ const [create, setCreate] = useState(false);
+ const tags = useTags();
+
+ const defaultTag = useMemo(
+ () => ({
+ id: '*',
+ tag: '*',
+ color: theme.noteTagDefault,
+ description: t('Default tag color'),
+ ...tags.find(tag => tag.tag === '*'),
+ }),
+ [t, tags],
+ );
+
+ const filteredTags = useMemo(() => {
+ return filter === ''
+ ? [defaultTag, ...tags.filter(tag => tag.tag !== '*')]
+ : tags.filter(tag =>
+ getNormalisedString(tag.tag).includes(getNormalisedString(filter)),
+ );
+ }, [defaultTag, filter, tags]);
+
+ const selectedInst = useSelected(
+ 'manage-tags',
+ filteredTags.filter(tag => tag.tag !== '*'),
+ [],
+ );
+
+ const onDeleteSelected = useCallback(async () => {
+ dispatch(deleteAllTags([...selectedInst.items]));
+ selectedInst.dispatch({ type: 'select-none' });
+ }, [dispatch, selectedInst]);
+
+ return (
+ <SelectedProvider instance={selectedInst}>
+ <View>
+ <View
+ style={{
+ flexDirection: 'row',
+ alignItems: 'center',
+ padding: '0 0 15px',
+ flexShrink: 0,
+ }}
+ >
+ <View
+ style={{
+ color: theme.pageTextLight,
+ flexDirection: 'row',
+ alignItems: 'center',
+ width: '50%',
+ }}
+ >
+ <Trans>User defined tags with color and description.</Trans>
+ </View>
+ </View>
+ <Stack
+ spacing={2}
+ direction="row"
+ align="center"
+ style={{ marginTop: 12 }}
+ >
+ <Button variant="bare" onPress={() => setCreate(true)}>
+ <SvgAdd width={10} height={10} style={{ marginRight: 3 }} />
+ <Trans>Add New</Trans>
+ </Button>
+ <View style={{ flex: 1 }} />
+ <Search
+ placeholder={t('Filter tags...')}
+ value={filter}
+ onChange={setFilter}
+ />
+ </Stack>
+ <View style={{ flex: 1, marginTop: 12 }}>
+ <TagsHeader />
+ {create && (
+ <TagCreationRow onClose={() => setCreate(false)} tags={tags} />
+ )}
+ <TagsList
+ tags={filteredTags}
+ selectedItems={selectedInst.items}
+ hoveredTag={hoveredTag}
+ onHover={id => setHoveredTag(id ?? undefined)}
+ />
+ </View>
+ <View
+ style={{
+ paddingBlock: 15,
+ paddingInline: 0,
+ borderTop: theme.pillBorder,
+ flexShrink: 0,
+ }}
+ >
+ <Stack direction="row" align="center" justify="flex-end" spacing={2}>
+ {selectedInst.items.size > 0 && (
+ <Button onPress={onDeleteSelected}>
+ <Trans count={selectedInst.items.size}>
+ Delete {selectedInst.items.size} tags
+ </Trans>
+ </Button>
+ )}
+ </Stack>
+ </View>
+ </View>
+ </SelectedProvider>
+ );
+}
diff --git a/packages/desktop-client/src/components/tags/ManageTagsPage.tsx b/packages/desktop-client/src/components/tags/ManageTagsPage.tsx
new file mode 100644
index 0000000000..486261e270
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/ManageTagsPage.tsx
@@ -0,0 +1,16 @@
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { ManageTags } from './ManageTags';
+
+import { Page } from '@desktop-client/components/Page';
+
+export const ManageTagsPage = () => {
+ const { t } = useTranslation();
+
+ return (
+ <Page header={t('Tags')}>
+ <ManageTags />
+ </Page>
+ );
+};
diff --git a/packages/desktop-client/src/components/tags/TagCreationRow.tsx b/packages/desktop-client/src/components/tags/TagCreationRow.tsx
new file mode 100644
index 0000000000..d78304e975
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/TagCreationRow.tsx
@@ -0,0 +1,199 @@
+import React, {
+ type ChangeEvent,
+ type KeyboardEvent,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+} from 'react';
+import { Trans, useTranslation } from 'react-i18next';
+
+import { Button } from '@actual-app/components/button';
+import { ColorPicker } from '@actual-app/components/color-picker';
+import { Stack } from '@actual-app/components/stack';
+import { theme } from '@actual-app/components/theme';
+import { View } from '@actual-app/components/view';
+
+import { type Tag } from 'loot-core/types/models';
+
+import {
+ InputCell,
+ Row,
+ useTableNavigator,
+} from '@desktop-client/components/table';
+import { useProperFocus } from '@desktop-client/hooks/useProperFocus';
+import { createTag } from '@desktop-client/queries/queriesSlice';
+import { useDispatch } from '@desktop-client/redux';
+import { useTagCSS } from '@desktop-client/style/tags';
+
+type TagCreationRowProps = {
+ tags: Tag[];
+ onClose: () => void;
+};
+
+export const TagCreationRow = ({ onClose, tags }: TagCreationRowProps) => {
+ const { t } = useTranslation();
+ const dispatch = useDispatch();
+ const [tag, setTag] = useState('');
+ const [description, setDescription] = useState('');
+ const [color, setColor] = useState(theme.noteTagDefault);
+ const tagInput = useRef<HTMLInputElement>(null);
+ const getTagCSS = useTagCSS();
+
+ const tagNames = useMemo(() => tags.map(tag => tag.tag), [tags]);
+
+ const tableNavigator = useTableNavigator(
+ [{ id: 'new-tag' }],
+ !tag || tagNames.includes(tag)
+ ? ['tag', 'description', 'color', 'cancel']
+ : ['tag', 'description', 'color', 'cancel', 'add'],
+ );
+
+ const colorButtonRef = useRef(null);
+ useProperFocus(colorButtonRef, tableNavigator.focusedField === 'color');
+ const addButtonRef = useRef(null);
+ useProperFocus(addButtonRef, tableNavigator.focusedField === 'add');
+ const cancelButtonRef = useRef(null);
+ useProperFocus(cancelButtonRef, tableNavigator.focusedField === 'cancel');
+
+ const resetInputs = () => {
+ setColor(theme.noteTagDefault);
+ setTag('');
+ setDescription('');
+ tableNavigator.onEdit('new-tag', 'tag');
+ };
+
+ const onAddTag = () => {
+ if (!tag.trim() || !color.trim() || tagNames.includes(tag)) {
+ return;
+ }
+
+ dispatch(createTag({ tag, color, description }));
+ resetInputs();
+ };
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ useEffect(() => tableNavigator.onEdit('new-tag', 'tag'), []);
+
+ return (
+ <View
+ style={{
+ paddingBottom: 1,
+ backgroundColor: theme.tableBackground,
+ }}
+ data-testid="new-tag"
+ {...tableNavigator.getNavigatorProps({
+ onKeyUp: (e: KeyboardEvent<HTMLDivElement>) => {
+ if (e.key === 'Escape') {
+ onClose();
+ }
+ if (e.key === 'Enter' && tag) {
+ onAddTag();
+ }
+ },
+ })}
+ >
+ <Row
+ height={34}
+ style={{
+ padding: '0px 20px',
+ width: '100%',
+ backgroundColor: theme.tableBackground,
+ gap: 5,
+ }}
+ collapsed={true}
+ >
+ <InputCell
+ width={250}
+ name="tag"
+ textAlign="flex"
+ exposed={tableNavigator.focusedField === 'tag'}
+ onExpose={name => tableNavigator.onEdit('new-tag', name)}
+ value={tag || t('New tag')}
+ valueStyle={
+ tag ? {} : { fontStyle: 'italic', color: theme.tableTextLight }
+ }
+ inputProps={{
+ value: tag || '',
+ onInput: ({ target: { value } }: ChangeEvent<HTMLInputElement>) =>
+ setTag(value.replace(/\s/g, '')),
+ placeholder: t('New tag'),
+ ref: tagInput,
+ }}
+ />
+
+ <InputCell
+ width="flex"
+ name="description"
+ textAlign="flex"
+ exposed={tableNavigator.focusedField === 'description'}
+ onExpose={name => tableNavigator.onEdit('new-tag', name)}
+ value={description || t('Tag description')}
+ valueStyle={
+ description
+ ? {}
+ : { fontStyle: 'italic', color: theme.tableTextLight }
+ }
+ inputProps={{
+ value: description || '',
+ onUpdate: setDescription,
+ placeholder: t('Tag description'),
+ }}
+ />
+ </Row>
+ <Row
+ height="auto"
+ style={{
+ padding: '6px 20px',
+ width: '100%',
+ backgroundColor: theme.tableBackground,
+ gap: 10,
+ alignItems: 'center',
+ borderBottom: '1px solid ' + theme.tableBorderHover,
+ }}
+ collapsed={true}
+ >
+ <Trans>Choose Color:</Trans>
+ <ColorPicker
+ value={color}
+ onChange={color => setColor(color.toString('hex'))}
+ >
+ <Button
+ ref={colorButtonRef}
+ variant="bare"
+ className={getTagCSS('', { color })}
+ >
+ #{tag}
+ </Button>
+ </ColorPicker>
+ <Stack
+ direction="row"
+ align="center"
+ justify="flex-end"
+ style={{ marginLeft: 'auto' }}
+ spacing={2}
+ >
+ <Button
+ variant="normal"
+ style={{ padding: '4px 10px' }}
+ onPress={onClose}
+ data-testid="close-button"
+ ref={cancelButtonRef}
+ >
+ <Trans>Cancel</Trans>
+ </Button>
+ <Button
+ variant="primary"
+ style={{ padding: '4px 10px' }}
+ onPress={onAddTag}
+ data-testid="add-button"
+ isDisabled={!tag || tagNames.includes(tag)}
+ ref={addButtonRef}
+ >
+ <Trans>Add</Trans>
+ </Button>
+ </Stack>
+ </Row>
+ </View>
+ );
+};
diff --git a/packages/desktop-client/src/components/tags/TagEditor.tsx b/packages/desktop-client/src/components/tags/TagEditor.tsx
new file mode 100644
index 0000000000..bfc5a8f171
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/TagEditor.tsx
@@ -0,0 +1,45 @@
+import { type RefObject } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { Button } from '@actual-app/components/button';
+import { ColorPicker } from '@actual-app/components/color-picker';
+
+import { type Tag } from 'loot-core/types/models';
+
+import { createTag, updateTag } from '@desktop-client/queries/queriesSlice';
+import { useDispatch } from '@desktop-client/redux';
+import { useTagCSS } from '@desktop-client/style/tags';
+
+type TagEditorProps = {
+ tag: Tag;
+ ref: RefObject<HTMLButtonElement | null>;
+};
+
+export const TagEditor = ({ tag, ref }: TagEditorProps) => {
+ const { t } = useTranslation();
+ const dispatch = useDispatch();
+ const getTagCSS = useTagCSS();
+
+ const formattedTag = <>#{tag.tag === '*' ? t('Default') : tag.tag}</>;
+
+ return (
+ <ColorPicker
+ value={tag.color}
+ onChange={color => {
+ dispatch(
+ tag.id !== '*'
+ ? updateTag({ ...tag, color: color.toString('hex') })
+ : createTag({
+ tag: tag.tag,
+ color: color.toString('hex'),
+ description: tag.description,
+ }),
+ );
+ }}
+ >
+ <Button variant="bare" className={getTagCSS(tag.tag)} ref={ref}>
+ {formattedTag}
+ </Button>
+ </ColorPicker>
+ );
+};
diff --git a/packages/desktop-client/src/components/tags/TagRow.tsx b/packages/desktop-client/src/components/tags/TagRow.tsx
new file mode 100644
index 0000000000..653d41e8f9
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/TagRow.tsx
@@ -0,0 +1,170 @@
+import React, { memo, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { Button } from '@actual-app/components/button';
+import { SvgRefreshArrow } from '@actual-app/components/icons/v2';
+import { Menu } from '@actual-app/components/menu';
+import { Popover } from '@actual-app/components/popover';
+import { theme } from '@actual-app/components/theme';
+
+import { type Tag } from 'loot-core/types/models';
+
+import { TagEditor } from './TagEditor';
+
+import {
+ SelectCell,
+ Row,
+ Cell,
+ InputCell,
+} from '@desktop-client/components/table';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useProperFocus } from '@desktop-client/hooks/useProperFocus';
+import { useSelectedDispatch } from '@desktop-client/hooks/useSelected';
+import {
+ createTag,
+ deleteTag,
+ updateTag,
+} from '@desktop-client/queries/queriesSlice';
+import { useDispatch } from '@desktop-client/redux';
+
+type TagRowProps = {
+ tag: Tag;
+ hovered?: boolean;
+ selected?: boolean;
+ onHover: (id?: string) => void;
+ focusedField: string | null;
+ onEdit: (id: string, field: string) => void;
+};
+
+export const TagRow = memo(
+ ({ tag, hovered, selected, onHover, focusedField, onEdit }: TagRowProps) => {
+ const { t } = useTranslation();
+ const dispatch = useDispatch();
+ const dispatchSelected = useSelectedDispatch();
+ const borderColor = selected ? theme.tableBorderSelected : 'none';
+
+ const colorButtonRef = useRef(null);
+ useProperFocus(colorButtonRef, focusedField === 'color');
+ const resetButtonRef = useRef(null);
+ useProperFocus(resetButtonRef, focusedField === 'select');
+
+ const triggerRef = useRef(null);
+ const { setMenuOpen, menuOpen, handleContextMenu, position } =
+ useContextMenu();
+
+ const onUpdate = (description: string) => {
+ dispatch(
+ tag.id !== '*'
+ ? updateTag({ ...tag, description })
+ : createTag({
+ tag: tag.tag,
+ color: tag.color,
+ description,
+ }),
+ );
+ };
+
+ return (
+ <Row
+ ref={triggerRef}
+ data-test-id={tag.id}
+ style={{
+ borderColor,
+ backgroundColor: selected
+ ? theme.tableRowBackgroundHighlight
+ : hovered
+ ? theme.tableRowBackgroundHover
+ : theme.tableBackground,
+ }}
+ collapsed={true}
+ onMouseEnter={() => onHover(tag.id)}
+ onMouseLeave={() => onHover()}
+ onContextMenu={handleContextMenu}
+ >
+ <Popover
+ triggerRef={triggerRef}
+ placement="bottom start"
+ isOpen={menuOpen}
+ onOpenChange={() => setMenuOpen(false)}
+ {...position}
+ style={{ width: 200, margin: 1 }}
+ isNonModal
+ >
+ <Menu
+ items={[
+ {
+ name: 'delete',
+ text: tag.tag !== '*' ? t('Delete') : t('Reset'),
+ },
+ ]}
+ onMenuSelect={name => {
+ switch (name) {
+ case 'delete':
+ dispatch(deleteTag(tag));
+ break;
+ default:
+ throw new Error(`Unrecognized menu option: ${name}`);
+ }
+ setMenuOpen(false);
+ }}
+ />
+ </Popover>
+ {tag.tag !== '*' ? (
+ <SelectCell
+ exposed={hovered || selected || focusedField === 'select'}
+ focused={focusedField === 'select'}
+ onSelect={e => {
+ dispatchSelected({
+ type: 'select',
+ id: tag.id,
+ isRangeSelect: e.shiftKey,
+ });
+ }}
+ selected={selected}
+ />
+ ) : (
+ <Cell width={20} plain>
+ <Button
+ variant="bare"
+ type="button"
+ style={{
+ borderWidth: 0,
+ backgroundColor: 'transparent',
+ marginLeft: 'auto',
+ }}
+ onPress={() => dispatch(deleteTag(tag))}
+ ref={resetButtonRef}
+ >
+ <SvgRefreshArrow width={13} height={13} />
+ </Button>
+ </Cell>
+ )}
+
+ <Cell width={250} plain style={{ padding: '5px', display: 'block' }}>
+ <TagEditor tag={tag} ref={colorButtonRef} />
+ </Cell>
+
+ <InputCell
+ width="flex"
+ name="description"
+ textAlign="flex"
+ exposed={focusedField === 'description'}
+ onExpose={name => onEdit(tag.id, name)}
+ value={tag.description || t('No description')}
+ valueStyle={
+ tag.description
+ ? {}
+ : { fontStyle: 'italic', color: theme.tableTextLight }
+ }
+ inputProps={{
+ value: tag.description || '',
+ onUpdate,
+ placeholder: t('No description'),
+ }}
+ />
+ </Row>
+ );
+ },
+);
+
+TagRow.displayName = 'TagRow';
diff --git a/packages/desktop-client/src/components/tags/TagsHeader.tsx b/packages/desktop-client/src/components/tags/TagsHeader.tsx
new file mode 100644
index 0000000000..cecc6da4f3
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/TagsHeader.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+import { useTranslation } from 'react-i18next';
+
+import {
+ SelectCell,
+ Cell,
+ TableHeader,
+} from '@desktop-client/components/table';
+import {
+ useSelectedItems,
+ useSelectedDispatch,
+} from '@desktop-client/hooks/useSelected';
+
+export function TagsHeader() {
+ const { t } = useTranslation();
+ const selectedItems = useSelectedItems();
+ const dispatchSelected = useSelectedDispatch();
+
+ return (
+ <TableHeader>
+ <SelectCell
+ exposed={true}
+ focused={false}
+ selected={selectedItems.size > 0}
+ onSelect={e =>
+ dispatchSelected({ type: 'select-all', isRangeSelect: e.shiftKey })
+ }
+ />
+ <Cell value={t('Tag')} width={250} />
+ <Cell value={t('Description')} width="flex" />
+ </TableHeader>
+ );
+}
diff --git a/packages/desktop-client/src/components/tags/TagsList.tsx b/packages/desktop-client/src/components/tags/TagsList.tsx
new file mode 100644
index 0000000000..e41aaca879
--- /dev/null
+++ b/packages/desktop-client/src/components/tags/TagsList.tsx
@@ -0,0 +1,51 @@
+import React from 'react';
+
+import { type Tag } from 'loot-core/types/models';
+
+import { TagRow } from './TagRow';
+
+import { Table, useTableNavigator } from '@desktop-client/components/table';
+
+type TagsListProps = {
+ tags: Tag[];
+ selectedItems: Set<string>;
+ hoveredTag?: string;
+ onHover: (id?: string) => void;
+};
+
+export function TagsList({
+ tags,
+ selectedItems,
+ hoveredTag,
+ onHover,
+}: TagsListProps) {
+ const tableNavigator = useTableNavigator(tags, [
+ 'select',
+ 'color',
+ 'description',
+ ]);
+
+ return (
+ <Table
+ navigator={tableNavigator}
+ items={tags}
+ backgroundColor="none"
+ renderItem={({ item: tag, focusedField, onEdit }) => {
+ const hovered = hoveredTag === tag.id;
+ const selected = selectedItems.has(tag.id);
+
+ return (
+ <TagRow
+ key={tag.id}
+ tag={tag}
+ hovered={hovered}
+ selected={selected}
+ onHover={onHover}
+ focusedField={focusedField}
+ onEdit={onEdit}
+ />
+ );
+ }}
+ />
+ );
+}
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
index b1034b7546..571e355a61 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
@@ -40,7 +40,6 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { Tooltip } from '@actual-app/components/tooltip';
import { View } from '@actual-app/components/view';
-import { css } from '@emotion/css';
import { format as formatDate, parseISO } from 'date-fns';
import * as monthUtils from 'loot-core/shared/months';
@@ -121,6 +120,7 @@ import {
useSplitsExpanded,
} from '@desktop-client/hooks/useSplitsExpanded';
import { pushModal } from '@desktop-client/modals/modalsSlice';
+import { NotesTagFormatter } from '@desktop-client/notes/NotesTagFormatter';
import { addNotification } from '@desktop-client/notifications/notificationsSlice';
import {
getAccountsById,
@@ -1361,7 +1361,9 @@ const Transaction = memo(function Transaction({
focused={focusedField === 'notes'}
value={notes || ''}
valueStyle={valueStyle}
- formatter={value => notesTagFormatter(value, onNotesTagClick)}
+ formatter={value =>
+ NotesTagFormatter({ notes: value, onNotesTagClick })
+ }
onExpose={name => !isPreview && onEdit(id, name)}
inputProps={{
value: notes || '',
@@ -2922,67 +2924,3 @@ export const TransactionTable = forwardRef(
);
TransactionTable.displayName = 'TransactionTable';
-
-function notesTagFormatter(
- notes: string,
- onNotesTagClick: (tag: string) => void,
-) {
- const words = notes.split(' ');
- return (
- <>
- {words.map((word, i, arr) => {
- const separator = arr.length - 1 === i ? '' : ' ';
- if (word.includes('#') && word.length > 1) {
- let lastEmptyTag = -1;
- // Treat tags in a single word as separate tags.
- // #tag1#tag2 => (#tag1)(#tag2)
- // not-a-tag#tag2#tag3 => not-a-tag(#tag2)(#tag3)
- return word.split('#').map((tag, ti) => {
- if (ti === 0) {
- return tag;
- }
-
- if (!tag) {
- lastEmptyTag = ti;
- return '#';
- }
-
- if (lastEmptyTag === ti - 1) {
- return `${tag} `;
- }
- lastEmptyTag = -1;
-
- const validTag = `#${tag}`;
- return (
- <span key={`${validTag}${ti}`}>
- <Button
- variant="bare"
- key={i}
- className={css({
- display: 'inline-flex',
- padding: '3px 7px',
- borderRadius: 16,
- userSelect: 'none',
- backgroundColor: theme.noteTagBackground,
- color: theme.noteTagText,
- cursor: 'pointer',
- '&[data-hovered]': {
- backgroundColor: theme.noteTagBackgroundHover,
- },
- })}
- onPress={() => {
- onNotesTagClick?.(validTag);
- }}
- >
- {validTag}
- </Button>
- {separator}
- </span>
- );
- });
- }
- return `${word}${separator}`;
- })}
- </>
- );
-}
diff --git a/packages/desktop-client/src/notes/DesktopTaggedNotes.tsx b/packages/desktop-client/src/notes/DesktopTaggedNotes.tsx
new file mode 100644
index 0000000000..4008dff2f7
--- /dev/null
+++ b/packages/desktop-client/src/notes/DesktopTaggedNotes.tsx
@@ -0,0 +1,36 @@
+import React from 'react';
+
+import { Button } from '@actual-app/components/button';
+import { View } from '@actual-app/components/view';
+
+import { useTagCSS } from '@desktop-client/style/tags';
+
+type DesktopTaggedNotesProps = {
+ content: string;
+ onPress?: (content: string) => void;
+ tag: string;
+ separator: string;
+};
+
+export function DesktopTaggedNotes({
+ content,
+ onPress,
+ tag,
+ separator,
+}: DesktopTaggedNotesProps) {
+ const getTagCSS = useTagCSS();
+ return (
+ <View style={{ display: 'inline' }}>
+ <Button
+ variant="bare"
+ className={getTagCSS(tag)}
+ onPress={() => {
+ onPress?.(content);
+ }}
+ >
+ {content}
+ </Button>
+ {separator}
+ </View>
+ );
+}
diff --git a/packages/desktop-client/src/notes/MobileTaggedNotes.tsx b/packages/desktop-client/src/notes/MobileTaggedNotes.tsx
new file mode 100644
index 0000000000..9332bfdf67
--- /dev/null
+++ b/packages/desktop-client/src/notes/MobileTaggedNotes.tsx
@@ -0,0 +1,25 @@
+import React from 'react';
+
+import { Text } from '@actual-app/components/text';
+
+import { useTagCSS } from '@desktop-client/style/tags';
+
+type MobileTaggedNotesProps = {
+ content: string;
+ tag: string;
+ separator: string;
+};
+
+export function MobileTaggedNotes({
+ content,
+ tag,
+ separator,
+}: MobileTaggedNotesProps) {
+ const getTagCSS = useTagCSS();
+ return (
+ <>
+ <Text className={getTagCSS(tag, { compact: true })}>{content}</Text>
+ {separator}
+ </>
+ );
+}
diff --git a/packages/desktop-client/src/notes/NotesTagFormatter.tsx b/packages/desktop-client/src/notes/NotesTagFormatter.tsx
new file mode 100644
index 0000000000..260ba8c0be
--- /dev/null
+++ b/packages/desktop-client/src/notes/NotesTagFormatter.tsx
@@ -0,0 +1,72 @@
+import React from 'react';
+
+import { useResponsive } from '@actual-app/components/hooks/useResponsive';
+
+import { DesktopTaggedNotes } from './DesktopTaggedNotes';
+import { MobileTaggedNotes } from './MobileTaggedNotes';
+
+type NotesTagFormatterProps = {
+ notes: string;
+ onNotesTagClick?: (tag: string) => void;
+};
+
+export function NotesTagFormatter({
+ notes,
+ onNotesTagClick,
+}: NotesTagFormatterProps) {
+ const { isNarrowWidth } = useResponsive();
+
+ const words = notes.split(' ');
+ return (
+ <>
+ {words.map((word, i, arr) => {
+ const separator = arr.length - 1 === i ? '' : ' ';
+ if (word.includes('#') && word.length > 1) {
+ let lastEmptyTag = -1;
+ // Treat tags in a single word as separate tags.
+ // #tag1#tag2 => (#tag1)(#tag2)
+ // not-a-tag#tag2#tag3 => not-a-tag(#tag2)(#tag3)
+ return word.split('#').map((tag, ti) => {
+ if (ti === 0) {
+ return tag;
+ }
+
+ if (!tag) {
+ lastEmptyTag = ti;
+ return '#';
+ }
+
+ if (lastEmptyTag === ti - 1) {
+ return `${tag} `;
+ }
+ lastEmptyTag = -1;
+
+ const validTag = `#${tag}`;
+
+ if (isNarrowWidth) {
+ return (
+ <MobileTaggedNotes
+ key={`${validTag}${ti}`}
+ content={validTag}
+ tag={tag}
+ separator={separator}
+ />
+ );
+ } else {
+ return (
+ <DesktopTaggedNotes
+ key={`${validTag}${ti}`}
+ onPress={onNotesTagClick}
+ content={validTag}
+ tag={tag}
+ separator={separator}
+ />
+ );
+ }
+ });
+ }
+ return `${word}${separator}`;
+ })}
+ </>
+ );
+}
diff --git a/packages/desktop-client/src/queries/queriesSlice.ts b/packages/desktop-client/src/queries/queriesSlice.ts
index d8f46d07a9..119df06dce 100644
--- a/packages/desktop-client/src/queries/queriesSlice.ts
+++ b/packages/desktop-client/src/queries/queriesSlice.ts
@@ -11,6 +11,7 @@ import {
type TransactionEntity,
type AccountEntity,
type PayeeEntity,
+ type Tag,
} from 'loot-core/types/models';
import { resetApp } from '@desktop-client/app/appSlice';
@@ -40,6 +41,8 @@ type QueriesState = {
commonPayees: PayeeEntity[];
payees: PayeeEntity[];
payeesLoaded: boolean;
+ tags: Tag[];
+ tagsLoaded: boolean;
};
const initialState: QueriesState = {
@@ -58,6 +61,8 @@ const initialState: QueriesState = {
commonPayeesLoaded: false,
payees: [],
payeesLoaded: false,
+ tags: [],
+ tagsLoaded: false,
};
type SetNewTransactionsPayload = {
@@ -160,6 +165,30 @@ const queriesSlice = createSlice({
// App
builder.addCase(resetApp, () => initialState);
+
+ // Tags
+
+ builder.addCase(getTags.fulfilled, (state, action) => {
+ state.tags = action.payload;
+ state.tagsLoaded = true;
+ });
+
+ builder.addCase(createTag.fulfilled, (state, action) => {
+ state.tags.push(action.payload);
+ });
+
+ builder.addCase(deleteTag.fulfilled, (state, action) => {
+ state.tags = state.tags.filter(tag => tag.id !== action.payload);
+ });
+
+ builder.addCase(deleteAllTags.fulfilled, (state, action) => {
+ state.tags = state.tags.filter(tag => !action.payload.includes(tag.id));
+ });
+
+ builder.addCase(updateTag.fulfilled, (state, action) => {
+ const tagIdx = state.tags.findIndex(tag => tag.id === action.payload.id);
+ state.tags[tagIdx] = action.payload;
+ });
},
});
@@ -419,6 +448,43 @@ export const getPayees = createAppAsyncThunk(
},
);
+export const getTags = createAppAsyncThunk(`${sliceName}/getTags`, async () => {
+ const tags: Tag[] = await send('tags-get');
+ return tags;
+});
+
+export const createTag = createAppAsyncThunk(
+ `${sliceName}/createTag`,
+ async ({ tag, color, description }: Omit<Tag, 'id'>) => {
+ const id = await send('tags-create', { tag, color, description });
+ return id;
+ },
+);
+
+export const deleteTag = createAppAsyncThunk(
+ `${sliceName}/deleteTag`,
+ async (tag: Tag) => {
+ const id = await send('tags-delete', tag);
+ return id;
+ },
+);
+
+export const deleteAllTags = createAppAsyncThunk(
+ `${sliceName}/deleteAllTags`,
+ async (ids: Array<Tag['id']>) => {
+ const id = await send('tags-delete-all', ids);
+ return id;
+ },
+);
+
+export const updateTag = createAppAsyncThunk(
+ `${sliceName}/updateTag`,
+ async (tag: Tag) => {
+ const id = await send('tags-update', tag);
+ return id;
+ },
+);
+
// Budget actions
type ApplyBudgetActionPayload =
@@ -882,6 +948,7 @@ export const actions = {
moveCategory,
moveCategoryGroup,
initiallyLoadPayees,
+ getTags,
};
export const {
diff --git a/packages/desktop-client/src/style/tags.ts b/packages/desktop-client/src/style/tags.ts
new file mode 100644
index 0000000000..fc1ecb41c1
--- /dev/null
+++ b/packages/desktop-client/src/style/tags.ts
@@ -0,0 +1,81 @@
+import React, { useCallback, useEffect } from 'react';
+
+import { theme as themeStyle } from '@actual-app/components/theme';
+import { css } from '@emotion/css';
+
+import { type Theme } from 'loot-core/types/prefs';
+
+import { useTheme } from './theme';
+
+import { getTags } from '@desktop-client/queries/queriesSlice';
+import { useDispatch, useSelector } from '@desktop-client/redux';
+
+export function useTags() {
+ const dispatch = useDispatch();
+ const tags = useSelector(state => state.queries.tags);
+ const tagsLoaded = useSelector(state => state.queries.tagsLoaded);
+
+ useEffect(() => {
+ if (!tagsLoaded) {
+ dispatch(getTags());
+ }
+ }, [tagsLoaded, dispatch]);
+
+ return tags;
+}
+
+function getTagCSSColors(theme: Theme, color?: string) {
+ if (theme === 'light') {
+ return [
+ color ? `${color} !important` : themeStyle.noteTagText,
+ color
+ ? `color-mix(in srgb, ${color} 15%, white)`
+ : themeStyle.noteTagBackground,
+ color
+ ? `color-mix(in srgb, ${color} 25%, white)`
+ : themeStyle.noteTagBackgroundHover,
+ ];
+ } else {
+ return [
+ themeStyle.noteTagText,
+ color ?? themeStyle.noteTagBackground,
+ color
+ ? `color-mix(in srgb, ${color} 85%, white)`
+ : themeStyle.noteTagBackgroundHover,
+ ];
+ }
+}
+
+export function useTagCSS() {
+ const tags = useTags();
+ const [theme] = useTheme();
+
+ return useCallback(
+ (tag: string, options: { color?: string; compact?: boolean } = {}) => {
+ const [color, backgroundColor, backgroundColorHovered] = getTagCSSColors(
+ theme,
+ // fallback strategy: options color > tag color > default color > theme color (undefined)
+ options.color ??
+ tags.find(t => t.tag === tag)?.color ??
+ tags.find(t => t.tag === '*')?.color,
+ );
+
+ return css({
+ display: 'inline-flex',
+ padding: options.compact ? '0px 7px' : '3px 7px',
+ borderRadius: 16,
+ userSelect: 'none',
+ backgroundColor,
+ color,
+ cursor: 'pointer',
+ '&[data-hovered]': {
+ backgroundColor: backgroundColorHovered,
+ },
+ '&[data-pressed]': {
+ backgroundColor: backgroundColorHovered,
+ },
+ });
+ },
+ [theme, tags],
+ );
+}
diff --git a/packages/desktop-client/src/style/themes/dark.ts b/packages/desktop-client/src/style/themes/dark.ts
index 95e51621fb..fb510e3f19 100644
--- a/packages/desktop-client/src/style/themes/dark.ts
+++ b/packages/desktop-client/src/style/themes/dark.ts
@@ -200,6 +200,7 @@ export const reportsInnerLabel = colorPalette.navy800;
export const noteTagBackground = colorPalette.purple700;
export const noteTagBackgroundHover = colorPalette.purple500;
+export const noteTagDefault = colorPalette.purple700;
export const noteTagText = colorPalette.purple100;
export const budgetOtherMonth = colorPalette.navy900;
diff --git a/packages/desktop-client/src/style/themes/development.ts b/packages/desktop-client/src/style/themes/development.ts
index b96a33bdfa..fc9bed6237 100644
--- a/packages/desktop-client/src/style/themes/development.ts
+++ b/packages/desktop-client/src/style/themes/development.ts
@@ -200,6 +200,7 @@ export const reportsInnerLabel = colorPalette.navy800;
export const noteTagBackground = colorPalette.purple100;
export const noteTagBackgroundHover = colorPalette.purple150;
+export const noteTagDefault = colorPalette.purple700;
export const noteTagText = colorPalette.purple700;
export const budgetCurrentMonth = tableBackground;
diff --git a/packages/desktop-client/src/style/themes/light.ts b/packages/desktop-client/src/style/themes/light.ts
index e3159e3f9a..ef32d19a8e 100644
--- a/packages/desktop-client/src/style/themes/light.ts
+++ b/packages/desktop-client/src/style/themes/light.ts
@@ -202,6 +202,7 @@ export const reportsInnerLabel = colorPalette.navy800;
export const noteTagBackground = colorPalette.purple100;
export const noteTagBackgroundHover = colorPalette.purple150;
+export const noteTagDefault = colorPalette.purple700;
export const noteTagText = colorPalette.purple700;
export const budgetCurrentMonth = tableBackground;
diff --git a/packages/desktop-client/src/style/themes/midnight.ts b/packages/desktop-client/src/style/themes/midnight.ts
index 8b33d1a30f..e7c530b631 100644
--- a/packages/desktop-client/src/style/themes/midnight.ts
+++ b/packages/desktop-client/src/style/themes/midnight.ts
@@ -202,6 +202,7 @@ export const reportsInnerLabel = colorPalette.navy800;
export const noteTagBackground = colorPalette.purple800;
export const noteTagBackgroundHover = colorPalette.purple600;
+export const noteTagDefault = colorPalette.purple700;
export const noteTagText = colorPalette.purple100;
export const budgetOtherMonth = colorPalette.gray700;
diff --git a/packages/loot-core/migrations/1749799110000_add_tags.sql b/packages/loot-core/migrations/1749799110000_add_tags.sql
new file mode 100644
index 0000000000..a9eeaa8c09
--- /dev/null
+++ b/packages/loot-core/migrations/1749799110000_add_tags.sql
@@ -0,0 +1,10 @@
+BEGIN TRANSACTION;
+
+CREATE TABLE tags(
+ id TEXT PRIMARY KEY,
+ tag TEXT UNIQUE,
+ color TEXT,
+ description TEXT
+);
+
+COMMIT
diff --git a/packages/loot-core/src/server/db/index.ts b/packages/loot-core/src/server/db/index.ts
index d5f3fccdda..c0158c7a14 100644
--- a/packages/loot-core/src/server/db/index.ts
+++ b/packages/loot-core/src/server/db/index.ts
@@ -43,6 +43,7 @@ import {
DbClockMessage,
DbPayee,
DbPayeeMapping,
+ DbTag,
DbTransaction,
DbViewTransaction,
DbViewTransactionInternalAlive,
@@ -803,3 +804,25 @@ export async function deleteTransaction(transaction) {
function toSqlQueryParameters(params: unknown[]) {
return params.map(() => '?').join(',');
}
+
+export function getTags() {
+ return all<DbTag>(`
+ SELECT id, tag, color, description
+ FROM tags
+ ORDER BY tag
+ `);
+}
+
+export function insertTag(tag): Promise<DbTag['id']> {
+ return insertWithUUID('tags', tag);
+}
+
+export async function deleteTag(tag) {
+ return transaction(() => {
+ runQuery(`DELETE FROM tags WHERE id = ?`, [tag.id]);
+ });
+}
+
+export function updateTag(tag) {
+ return update('tags', tag);
+}
diff --git a/packages/loot-core/src/server/db/types/index.ts b/packages/loot-core/src/server/db/types/index.ts
index 4358620540..9fc6b2bc8c 100644
--- a/packages/loot-core/src/server/db/types/index.ts
+++ b/packages/loot-core/src/server/db/types/index.ts
@@ -324,3 +324,10 @@ export type DbViewSchedule = {
_conditions: JsonString;
_actions: JsonString;
};
+
+export type DbTag = {
+ id: string;
+ tag: string;
+ color: string;
+ description?: string | null;
+};
diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts
index 245e1640b1..febe114628 100644
--- a/packages/loot-core/src/server/main.ts
+++ b/packages/loot-core/src/server/main.ts
@@ -36,6 +36,7 @@ import { getServer, setServer } from './server-config';
import { app as spreadsheetApp } from './spreadsheet/app';
import { fullSync, setSyncingMode } from './sync';
import { app as syncApp } from './sync/app';
+import { app as tagsApp } from './tags/app';
import { app as toolsApp } from './tools/app';
import { app as transactionsApp } from './transactions/app';
import * as rules from './transactions/transaction-rules';
@@ -147,6 +148,7 @@ app.combine(
syncApp,
budgetFilesApp,
encryptionApp,
+ tagsApp,
);
export function getDefaultDocumentDir() {
diff --git a/packages/loot-core/src/server/tags/app.ts b/packages/loot-core/src/server/tags/app.ts
new file mode 100644
index 0000000000..36d5c3f117
--- /dev/null
+++ b/packages/loot-core/src/server/tags/app.ts
@@ -0,0 +1,58 @@
+import { Tag } from '../../types/models';
+import { createApp } from '../app';
+import * as db from '../db';
+import { mutator } from '../mutators';
+import { batchMessages } from '../sync';
+import { undoable } from '../undo';
+
+export type TagsHandlers = {
+ 'tags-get': typeof getTags;
+ 'tags-create': typeof createTag;
+ 'tags-delete': typeof deleteTag;
+ 'tags-delete-all': typeof deleteAllTags;
+ 'tags-update': typeof updateTag;
+};
+
+export const app = createApp<TagsHandlers>();
+app.method('tags-get', getTags);
+app.method('tags-create', mutator(undoable(createTag)));
+app.method('tags-delete', mutator(undoable(deleteTag)));
+app.method('tags-delete-all', mutator(deleteAllTags));
+app.method('tags-update', mutator(undoable(updateTag)));
+
+async function getTags(): Promise<Tag[]> {
+ return await db.getTags();
+}
+
+async function createTag({
+ tag,
+ color,
+ description = null,
+}: Omit<Tag, 'id'>): Promise<Tag> {
+ const id = await db.insertTag({
+ tag: tag.trim(),
+ color: color.trim(),
+ description,
+ });
+
+ return { id, tag, color, description };
+}
+
+async function deleteTag(tag: Tag): Promise<Tag['id']> {
+ await db.deleteTag(tag);
+ return tag.id;
+}
+
+async function deleteAllTags(ids: Array<Tag['id']>): Promise<Array<Tag['id']>> {
+ await batchMessages(async () => {
+ for (const id of ids) {
+ await db.deleteTag({ id });
+ }
+ });
+ return ids;
+}
+
+async function updateTag(tag: Tag): Promise<Tag> {
+ await db.updateTag(tag);
+ return tag;
+}
diff --git a/packages/loot-core/src/types/handlers.ts b/packages/loot-core/src/types/handlers.ts
index 51d8e9387f..7477191d08 100644
--- a/packages/loot-core/src/types/handlers.ts
+++ b/packages/loot-core/src/types/handlers.ts
@@ -14,6 +14,7 @@ import type { RulesHandlers } from '../server/rules/app';
import type { SchedulesHandlers } from '../server/schedules/app';
import type { SpreadsheetHandlers } from '../server/spreadsheet/app';
import type { SyncHandlers } from '../server/sync/app';
+import type { TagsHandlers } from '../server/tags/app';
import type { ToolsHandlers } from '../server/tools/app';
import type { TransactionHandlers } from '../server/transactions/app';
@@ -40,6 +41,7 @@ export interface Handlers
SyncHandlers,
BudgetFileHandlers,
EncryptionHandlers,
+ TagsHandlers,
AuthHandlers {}
export type HandlerFunctions = Handlers[keyof Handlers];
diff --git a/packages/loot-core/src/types/models/index.ts b/packages/loot-core/src/types/models/index.ts
index 96e4bd3636..b08a58c2b7 100644
--- a/packages/loot-core/src/types/models/index.ts
+++ b/packages/loot-core/src/types/models/index.ts
@@ -18,3 +18,4 @@ export type * from './transaction';
export type * from './transaction-filter';
export type * from './user';
export type * from './user-access';
+export type * from './tags';
diff --git a/packages/loot-core/src/types/models/tags.ts b/packages/loot-core/src/types/models/tags.ts
new file mode 100644
index 0000000000..e4f2da9b63
--- /dev/null
+++ b/packages/loot-core/src/types/models/tags.ts
@@ -0,0 +1,6 @@
+export interface Tag {
+ id: string;
+ tag: string;
+ color: string;
+ description?: string | null;
+}
diff --git a/upcoming-release-notes/5032.md b/upcoming-release-notes/5032.md
new file mode 100644
index 0000000000..904ff0fe25
--- /dev/null
+++ b/upcoming-release-notes/5032.md
@@ -0,0 +1,6 @@
+---
+category: Features
+authors: [pogman-code]
+---
+
+Add user defined tag colors