Skip to content

A local-first personal finance app

automation UI: improve scaling (#8080)

Matt Fiddamanf27c0182295a
diff --git a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/AutomationEditorPane.tsx b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/AutomationEditorPane.tsx
index a0e0def611..8f15c15499 100644
--- a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/AutomationEditorPane.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/AutomationEditorPane.tsx
@@ -159,209 +159,211 @@ export function AutomationEditorPane({
<View
style={{
flex: 1,
- padding: 20,
overflowY: 'auto',
- gap: 14,
+ overflowX: 'hidden',
+ scrollbarGutter: 'stable',
}}
>
- {activeError && (
- <View
- style={{
- padding: '10px 12px',
- borderRadius: 6,
- backgroundColor: theme.errorBackground,
- border: `1px solid ${theme.errorBorder}`,
- color: theme.errorText,
- fontSize: 13,
- flexDirection: 'row',
- gap: 10,
- alignItems: 'flex-start',
- }}
- >
- <SvgAlertTriangle
- width={14}
- height={14}
- style={{ marginTop: 2, color: 'inherit', flexShrink: 0 }}
- />
- <View style={{ minWidth: 0 }}>
- <Text style={{ fontWeight: 600, color: 'inherit' }}>
- <AutomationErrorTitle error={activeError} />
- </Text>
- <Text
- style={{
- fontSize: 12,
- marginTop: 2,
- color: 'inherit',
- display: 'block',
- }}
- >
- <AutomationErrorDetail error={activeError} />
- </Text>
- </View>
- </View>
- )}
-
- {!NON_CONTRIBUTION_TYPES.has(state.displayType) && (
- <>
- <Text
- style={{
- fontSize: 11,
- textTransform: 'uppercase',
- color: theme.pageTextLight,
- fontWeight: 600,
- letterSpacing: '0.05em',
- }}
- >
- <Trans>Automation type</Trans>
- </Text>
- <TypePicker
- active={state.displayType}
- disabledTypes={disabledTypes}
- onPick={type => dispatch({ type: 'set-type', payload: type })}
- />
- </>
- )}
-
- {state.displayType !== 'refill' && (
- <>
- <Text
- style={{
- fontSize: 11,
- textTransform: 'uppercase',
- color: theme.pageTextLight,
- fontWeight: 600,
- letterSpacing: '0.05em',
- }}
- >
- <Trans>Configuration</Trans>
- </Text>
+ <View style={{ padding: 20, gap: 14, flexShrink: 0 }}>
+ {activeError && (
<View
- className={CONFIG_PANEL_CLASS}
style={{
- padding: 16,
- backgroundColor: theme.tableBackground,
+ padding: '10px 12px',
borderRadius: 6,
- border: `1px solid ${theme.tableBorder}`,
+ backgroundColor: theme.errorBackground,
+ border: `1px solid ${theme.errorBorder}`,
+ color: theme.errorText,
+ fontSize: 13,
+ flexDirection: 'row',
+ gap: 10,
+ alignItems: 'flex-start',
}}
>
- {NON_CONTRIBUTION_TYPES.has(state.displayType) && (
+ <SvgAlertTriangle
+ width={14}
+ height={14}
+ style={{ marginTop: 2, color: 'inherit', flexShrink: 0 }}
+ />
+ <View style={{ minWidth: 0 }}>
+ <Text style={{ fontWeight: 600, color: 'inherit' }}>
+ <AutomationErrorTitle error={activeError} />
+ </Text>
<Text
style={{
fontSize: 12,
- color: theme.pageTextLight,
+ marginTop: 2,
+ color: 'inherit',
display: 'block',
- marginBottom: 4,
}}
>
- {getDisplayTemplateMeta(state.displayType).description}
+ <AutomationErrorDetail error={activeError} />
</Text>
- )}
- <ActiveEditor
- key={active.id}
- state={state}
- dispatch={dispatch}
- schedules={schedules}
- categories={categories}
- hasLimitAutomation={hasLimitAutomation}
- onAddLimitAutomation={onAddLimitAutomation}
- />
+ </View>
</View>
- </>
- )}
+ )}
- {state.displayType === 'refill' && (
- <ActiveEditor
- key={active.id}
- state={state}
- dispatch={dispatch}
- schedules={schedules}
- categories={categories}
- hasLimitAutomation={hasLimitAutomation}
- onAddLimitAutomation={onAddLimitAutomation}
- />
- )}
+ {!NON_CONTRIBUTION_TYPES.has(state.displayType) && (
+ <>
+ <Text
+ style={{
+ fontSize: 11,
+ textTransform: 'uppercase',
+ color: theme.pageTextLight,
+ fontWeight: 600,
+ letterSpacing: '0.05em',
+ }}
+ >
+ <Trans>Automation type</Trans>
+ </Text>
+ <TypePicker
+ active={state.displayType}
+ disabledTypes={disabledTypes}
+ onPick={type => dispatch({ type: 'set-type', payload: type })}
+ />
+ </>
+ )}
- <View style={{ flexDirection: 'row', gap: 12, alignItems: 'center' }}>
- {'priority' in state.template &&
- typeof state.template.priority === 'number' && (
+ {state.displayType !== 'refill' && (
+ <>
+ <Text
+ style={{
+ fontSize: 11,
+ textTransform: 'uppercase',
+ color: theme.pageTextLight,
+ fontWeight: 600,
+ letterSpacing: '0.05em',
+ }}
+ >
+ <Trans>Configuration</Trans>
+ </Text>
<View
+ className={CONFIG_PANEL_CLASS}
style={{
- flexDirection: 'row',
- alignItems: 'center',
- gap: 8,
+ padding: 16,
+ backgroundColor: theme.tableBackground,
+ borderRadius: 6,
+ border: `1px solid ${theme.tableBorder}`,
}}
>
- <Text
+ {NON_CONTRIBUTION_TYPES.has(state.displayType) && (
+ <Text
+ style={{
+ fontSize: 12,
+ color: theme.pageTextLight,
+ display: 'block',
+ marginBottom: 4,
+ }}
+ >
+ {getDisplayTemplateMeta(state.displayType).description}
+ </Text>
+ )}
+ <ActiveEditor
+ key={active.id}
+ state={state}
+ dispatch={dispatch}
+ schedules={schedules}
+ categories={categories}
+ hasLimitAutomation={hasLimitAutomation}
+ onAddLimitAutomation={onAddLimitAutomation}
+ />
+ </View>
+ </>
+ )}
+
+ {state.displayType === 'refill' && (
+ <ActiveEditor
+ key={active.id}
+ state={state}
+ dispatch={dispatch}
+ schedules={schedules}
+ categories={categories}
+ hasLimitAutomation={hasLimitAutomation}
+ onAddLimitAutomation={onAddLimitAutomation}
+ />
+ )}
+
+ <View style={{ flexDirection: 'row', gap: 12, alignItems: 'center' }}>
+ {'priority' in state.template &&
+ typeof state.template.priority === 'number' && (
+ <View
style={{
- fontSize: 11,
- fontWeight: 600,
- color: theme.pageTextLight,
- letterSpacing: '0.04em',
- textTransform: 'uppercase',
+ flexDirection: 'row',
+ alignItems: 'center',
+ gap: 8,
}}
>
- <Trans>Priority</Trans>
- </Text>
- <Input
- type="number"
- style={{ width: 64 }}
- value={String(state.template.priority)}
- onChangeValue={value => {
- if (value === '') return;
- const parsed = Math.round(Number(value));
- if (Number.isNaN(parsed)) return;
- setPriority(Math.max(0, parsed));
- }}
- />
- </View>
- )}
- <View style={{ flex: 1 }} />
- <Button
- variant="bare"
- onPress={() => onDelete(activeIdx)}
- style={{ color: theme.errorText }}
- >
- <span
- style={{ display: 'inline-flex', alignItems: 'center', gap: 6 }}
+ <Text
+ style={{
+ fontSize: 11,
+ fontWeight: 600,
+ color: theme.pageTextLight,
+ letterSpacing: '0.04em',
+ textTransform: 'uppercase',
+ }}
+ >
+ <Trans>Priority</Trans>
+ </Text>
+ <Input
+ type="number"
+ style={{ width: 64 }}
+ value={String(state.template.priority)}
+ onChangeValue={value => {
+ if (value === '') return;
+ const parsed = Math.round(Number(value));
+ if (Number.isNaN(parsed)) return;
+ setPriority(Math.max(0, parsed));
+ }}
+ />
+ </View>
+ )}
+ <View style={{ flex: 1 }} />
+ <Button
+ variant="bare"
+ onPress={() => onDelete(activeIdx)}
+ style={{ color: theme.errorText }}
>
- <SvgDelete width={10} height={10} style={{ color: 'inherit' }} />
- <Trans>Delete automation</Trans>
- </span>
- </Button>
- </View>
+ <span
+ style={{ display: 'inline-flex', alignItems: 'center', gap: 6 }}
+ >
+ <SvgDelete width={10} height={10} style={{ color: 'inherit' }} />
+ <Trans>Delete automation</Trans>
+ </span>
+ </Button>
+ </View>
- <Text
- style={{
- fontSize: 11,
- textTransform: 'uppercase',
- color: theme.pageTextLight,
- fontWeight: 600,
- letterSpacing: '0.05em',
- }}
- >
- <Trans>Note</Trans>
- </Text>
- <textarea
- aria-label={t('Automation note')}
- className={css({
- width: '100%',
- minHeight: 60,
- resize: 'vertical',
- fontFamily: 'inherit',
- fontSize: 13,
- lineHeight: 1.4,
- padding: '8px 10px',
- borderRadius: 6,
- border: `1px solid ${theme.formInputBorder}`,
- backgroundColor: theme.tableBackground,
- color: theme.tableText,
- '::placeholder': { color: theme.pageTextLight },
- })}
- value={active.template.description ?? ''}
- onChange={e => setDescription(e.target.value)}
- placeholder={t('Note')}
- rows={3}
- />
+ <Text
+ style={{
+ fontSize: 11,
+ textTransform: 'uppercase',
+ color: theme.pageTextLight,
+ fontWeight: 600,
+ letterSpacing: '0.05em',
+ }}
+ >
+ <Trans>Note</Trans>
+ </Text>
+ <textarea
+ aria-label={t('Automation note')}
+ className={css({
+ width: '100%',
+ minHeight: 60,
+ resize: 'vertical',
+ fontFamily: 'inherit',
+ fontSize: 13,
+ lineHeight: 1.4,
+ padding: '8px 10px',
+ borderRadius: 6,
+ border: `1px solid ${theme.formInputBorder}`,
+ backgroundColor: theme.tableBackground,
+ color: theme.tableText,
+ '::placeholder': { color: theme.pageTextLight },
+ })}
+ value={active.template.description ?? ''}
+ onChange={e => setDescription(e.target.value)}
+ placeholder={t('Note')}
+ rows={3}
+ />
+ </View>
</View>
);
}
diff --git a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/BudgetAutomationsBody.tsx b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/BudgetAutomationsBody.tsx
index aab685a595..5eeceeb453 100644
--- a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/BudgetAutomationsBody.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/BudgetAutomationsBody.tsx
@@ -542,13 +542,15 @@ export function BudgetAutomationsBody({
)}
</View>
- <View style={{ flex: 1, minWidth: 0 }}>
+ <View style={{ flex: 1, minWidth: 0, minHeight: 0 }}>
{cleanupActive ? (
<View
style={{
flex: 1,
padding: 20,
overflowY: 'auto',
+ overflowX: 'hidden',
+ scrollbarGutter: 'stable',
gap: 14,
}}
>
diff --git a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/EmptyState.tsx b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/EmptyState.tsx
index 6d5cdcadd6..43e7c9c140 100644
--- a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/EmptyState.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/EmptyState.tsx
@@ -66,7 +66,7 @@ export function EmptyState({ onAdd }: EmptyStateProps) {
<View
style={{
display: 'grid',
- gridTemplateColumns: '1fr 1fr 1fr',
+ gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))',
gap: 10,
textAlign: 'center',
}}
diff --git a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/TypePicker.tsx b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/TypePicker.tsx
index ec949beac4..a2e60ff97d 100644
--- a/packages/desktop-client/src/components/modals/BudgetAutomationsModal/TypePicker.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetAutomationsModal/TypePicker.tsx
@@ -31,7 +31,7 @@ export function TypePicker({ active, disabledTypes, onPick }: TypePickerProps) {
<View
style={{
display: 'grid',
- gridTemplateColumns: 'repeat(4, 1fr)',
+ gridTemplateColumns: 'repeat(auto-fit, minmax(140px, 1fr))',
gap: 8,
}}
>
diff --git a/upcoming-release-notes/8080.md b/upcoming-release-notes/8080.md
new file mode 100644
index 0000000000..ac8b54100e
--- /dev/null
+++ b/upcoming-release-notes/8080.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [matt-fidd]
+---
+
+Automation UI: Improve scaling on various screen sizes and zoom levels