Skip to content

A local-first personal finance app

:sparkles: polishing report responsitivity (#3636)

Matiss Janis Aboltins15b1b7337914
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png
index 188f0c1bb0..b2f65f4337 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png
index 4729dd69bc..69b03b6e99 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png
index 6cec14ac63..544c6338d8 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Area-Graph-and-checks-the-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png
index e8cced65d3..437f99a546 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png
index 19215414da..b693aa2bf2 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png
index 4ee9cd387a..9186765ebf 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Bar-Graph-and-checks-the-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png
index 545622a824..7a76b88860 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png
index a8d3a26f8f..6873ff8e5b 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png
index 1288aac3d8..bf8234fcb2 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Data-Table-and-checks-the-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png
index 90d928a1af..f037812d58 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png
index 9a92a37064..049f5c6819 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png
index 0f475275e0..8254953796 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Donut-Graph-and-checks-the-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png
index ce84f4b803..c78648abb8 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png
index 9d8dad0faa..6324729e20 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png
index 4a0e2467b0..c170a09f52 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Switches-to-Line-Graph-and-checks-the-visuals-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png
index 0660c1b084..297939c5aa 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png
index 5a4c145254..9eb14a7f69 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png
index 356b48bc77..e4122f5746 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-labels-button-shows-the-labels-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png
index a2dd084e08..8a28300f8b 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png
index 7c78172f79..e98a85d1a6 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png
index ee42afd3c9..55b818c97b 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-legend-button-shows-the-legend-side-bar-3-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png
index 4489960e70..4f2806e71e 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-1-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png
index 709a6c2168..fd73a9dac6 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-2-chromium-linux.png differ
diff --git a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png
index 3789c2cf0a..d8f07bc576 100644
Binary files a/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png and b/packages/desktop-client/e2e/reports.test.js-snapshots/Reports-custom-reports-Validates-that-show-summary-button-shows-the-summary-3-chromium-linux.png differ
diff --git a/packages/desktop-client/src/components/common/SpaceBetween.tsx b/packages/desktop-client/src/components/common/SpaceBetween.tsx
new file mode 100644
index 0000000000..25e330082a
--- /dev/null
+++ b/packages/desktop-client/src/components/common/SpaceBetween.tsx
@@ -0,0 +1,33 @@
+import React, { type ReactNode } from 'react';
+
+import { type CSSProperties } from '../../style';
+
+import { View } from './View';
+
+type SpaceBetweenProps = {
+ direction?: 'horizontal' | 'vertical';
+ gap?: number;
+ style?: CSSProperties;
+ children: ReactNode;
+};
+
+export const SpaceBetween = ({
+ direction = 'horizontal',
+ gap = 15,
+ style,
+ children,
+}: SpaceBetweenProps) => {
+ return (
+ <View
+ style={{
+ flexWrap: 'wrap',
+ flexDirection: direction === 'horizontal' ? 'row' : 'column',
+ alignItems: 'center',
+ gap,
+ ...style,
+ }}
+ >
+ {children}
+ </View>
+ );
+};
diff --git a/packages/desktop-client/src/components/common/Tooltip.tsx b/packages/desktop-client/src/components/common/Tooltip.tsx
index 62a5e4614e..7f3fc896f3 100644
--- a/packages/desktop-client/src/components/common/Tooltip.tsx
+++ b/packages/desktop-client/src/components/common/Tooltip.tsx
@@ -52,7 +52,7 @@ export const Tooltip = ({
return (
<View
- style={{ minHeight: 'auto' }}
+ style={{ minHeight: 'auto', flexShrink: 0 }}
ref={triggerRef}
onMouseEnter={handlePointerEnter}
onMouseLeave={handlePointerLeave}
diff --git a/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx
index a50c3162fc..a9b1abe04f 100644
--- a/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx
+++ b/packages/desktop-client/src/components/filters/CompactFiltersButton.tsx
@@ -5,8 +5,12 @@ import { Button } from '../common/Button2';
export function CompactFiltersButton({ onPress }: { onPress: () => void }) {
return (
- <Button variant="bare" onPress={onPress}>
- <SvgFilter width={15} height={15} />
+ <Button variant="bare" onPress={onPress} style={{ minWidth: 20 }}>
+ <SvgFilter
+ width={15}
+ height={15}
+ style={{ width: 15, height: 15, flexShrink: 0 }}
+ />
</Button>
);
}
diff --git a/packages/desktop-client/src/components/filters/FilterExpression.tsx b/packages/desktop-client/src/components/filters/FilterExpression.tsx
index 11062c175e..4272d0679d 100644
--- a/packages/desktop-client/src/components/filters/FilterExpression.tsx
+++ b/packages/desktop-client/src/components/filters/FilterExpression.tsx
@@ -62,8 +62,21 @@ export function FilterExpression<T extends RuleConditionEntity>({
variant="bare"
isDisabled={customName != null}
onPress={() => setEditing(true)}
+ style={{
+ maxWidth: 'calc(100% - 26px)',
+ whiteSpace: 'nowrap',
+ display: 'block',
+ }}
>
- <div style={{ paddingBlock: 1, paddingLeft: 5, paddingRight: 2 }}>
+ <div
+ style={{
+ paddingBlock: 1,
+ paddingLeft: 5,
+ paddingRight: 2,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ }}
+ >
{customName ? (
<Text style={{ color: theme.pageTextPositive }}>{customName}</Text>
) : (
diff --git a/packages/desktop-client/src/components/filters/FiltersButton.tsx b/packages/desktop-client/src/components/filters/FiltersButton.tsx
index 595a4cb4fa..1568986f0a 100644
--- a/packages/desktop-client/src/components/filters/FiltersButton.tsx
+++ b/packages/desktop-client/src/components/filters/FiltersButton.tsx
@@ -6,7 +6,10 @@ import { Button } from '../common/Button2';
export function FiltersButton({ onPress }: { onPress: () => void }) {
return (
<Button variant="bare" onPress={onPress}>
- <SvgFilter style={{ width: 12, height: 12, marginRight: 5 }} /> Filter
+ <SvgFilter
+ style={{ width: 12, height: 12, marginRight: 5, flexShrink: 0 }}
+ />{' '}
+ Filter
</Button>
);
}
diff --git a/packages/desktop-client/src/components/reports/Header.tsx b/packages/desktop-client/src/components/reports/Header.tsx
index 7c4705976a..c2ee67bb40 100644
--- a/packages/desktop-client/src/components/reports/Header.tsx
+++ b/packages/desktop-client/src/components/reports/Header.tsx
@@ -10,6 +10,7 @@ import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { useResponsive } from '../../ResponsiveProvider';
import { Button } from '../common/Button2';
import { Select } from '../common/Select';
+import { SpaceBetween } from '../common/SpaceBetween';
import { View } from '../common/View';
import { AppliedFilters } from '../filters/AppliedFilters';
import { FilterButton } from '../filters/FiltersMenu';
@@ -66,82 +67,69 @@ export function Header({
<View
style={{
padding: 20,
- paddingTop: 0,
+ paddingTop: 15,
flexShrink: 0,
}}
>
- <View
+ <SpaceBetween
+ direction={isNarrowWidth ? 'vertical' : 'horizontal'}
style={{
- flexDirection: isNarrowWidth ? 'column' : 'row',
alignItems: isNarrowWidth ? 'flex-start' : 'center',
- marginTop: 15,
- gap: 15,
}}
>
- {isDashboardsFeatureEnabled && mode && (
- <Button
- variant={mode === 'static' ? 'normal' : 'primary'}
- onPress={() => {
- const newMode = mode === 'static' ? 'sliding-window' : 'static';
- const [newStart, newEnd] = calculateTimeRange({
- start,
- end,
- mode: newMode,
- });
+ <SpaceBetween gap={isNarrowWidth ? 5 : undefined}>
+ {isDashboardsFeatureEnabled && mode && (
+ <Button
+ variant={mode === 'static' ? 'normal' : 'primary'}
+ onPress={() => {
+ const newMode = mode === 'static' ? 'sliding-window' : 'static';
+ const [newStart, newEnd] = calculateTimeRange({
+ start,
+ end,
+ mode: newMode,
+ });
- onChangeDates(newStart, newEnd, newMode);
- }}
- >
- {mode === 'static' ? 'Static' : 'Live'}
- </Button>
- )}
+ onChangeDates(newStart, newEnd, newMode);
+ }}
+ >
+ {mode === 'static' ? 'Static' : 'Live'}
+ </Button>
+ )}
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- gap: 5,
- }}
- >
- <Select
- onChange={newValue =>
- onChangeDates(
- ...validateStart(
- allMonths[allMonths.length - 1].name,
- newValue,
- end,
- ),
- )
- }
- value={start}
- defaultLabel={monthUtils.format(start, 'MMMM, yyyy')}
- options={allMonths.map(({ name, pretty }) => [name, pretty])}
- />
- <View>to</View>
- <Select
- onChange={newValue =>
- onChangeDates(
- ...validateEnd(
- allMonths[allMonths.length - 1].name,
- start,
- newValue,
- ),
- )
- }
- value={end}
- options={allMonths.map(({ name, pretty }) => [name, pretty])}
- style={{ marginRight: 10 }}
- />
- </View>
+ <SpaceBetween gap={5}>
+ <Select
+ onChange={newValue =>
+ onChangeDates(
+ ...validateStart(
+ allMonths[allMonths.length - 1].name,
+ newValue,
+ end,
+ ),
+ )
+ }
+ value={start}
+ defaultLabel={monthUtils.format(start, 'MMMM, yyyy')}
+ options={allMonths.map(({ name, pretty }) => [name, pretty])}
+ />
+ <View>to</View>
+ <Select
+ onChange={newValue =>
+ onChangeDates(
+ ...validateEnd(
+ allMonths[allMonths.length - 1].name,
+ start,
+ newValue,
+ ),
+ )
+ }
+ value={end}
+ options={allMonths.map(({ name, pretty }) => [name, pretty])}
+ style={{ marginRight: 10 }}
+ />
+ </SpaceBetween>
+ </SpaceBetween>
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- gap: 15,
- flexWrap: 'wrap',
- }}
- >
+ <SpaceBetween>
{show1Month && (
<Button
variant="bare"
@@ -187,7 +175,7 @@ export function Header({
exclude={undefined}
/>
)}
- </View>
+ </SpaceBetween>
{children ? (
<View
@@ -202,7 +190,7 @@ export function Header({
) : (
<View style={{ flex: 1 }} />
)}
- </View>
+ </SpaceBetween>
{filters && filters.length > 0 && (
<View style={{ marginTop: 5 }}>
diff --git a/packages/desktop-client/src/components/reports/ModeButton.tsx b/packages/desktop-client/src/components/reports/ModeButton.tsx
index 8a35546d77..fc50a14a03 100644
--- a/packages/desktop-client/src/components/reports/ModeButton.tsx
+++ b/packages/desktop-client/src/components/reports/ModeButton.tsx
@@ -25,7 +25,6 @@ export function ModeButton({
css({
padding: '5px 10px',
backgroundColor: theme.menuBackground,
- marginRight: 5,
fontSize: 'inherit',
...style,
...(selected && {
diff --git a/packages/desktop-client/src/components/reports/ReportSidebar.tsx b/packages/desktop-client/src/components/reports/ReportSidebar.tsx
index 0c07319a88..011739c5a3 100644
--- a/packages/desktop-client/src/components/reports/ReportSidebar.tsx
+++ b/packages/desktop-client/src/components/reports/ReportSidebar.tsx
@@ -14,6 +14,7 @@ import { Button } from '../common/Button2';
import { Menu } from '../common/Menu';
import { Popover } from '../common/Popover';
import { Select, type SelectOption } from '../common/Select';
+import { SpaceBetween } from '../common/SpaceBetween';
import { Text } from '../common/Text';
import { Tooltip } from '../common/Tooltip';
import { View } from '../common/View';
@@ -177,16 +178,13 @@ export function ReportSidebar({
<strong>Display</strong>
</Text>
</View>
- <View
+ <SpaceBetween
+ gap={5}
style={{
- flexDirection: 'row',
padding: 5,
- alignItems: 'center',
}}
>
- <Text style={{ width: 50, textAlign: 'right', marginRight: 5 }}>
- Mode:
- </Text>
+ <Text style={{ width: 50, textAlign: 'right' }}>Mode:</Text>
<ModeButton
selected={customReportItems.mode === 'total'}
onSelect={() => onChangeMode('total')}
@@ -199,7 +197,7 @@ export function ReportSidebar({
>
Time
</ModeButton>
- </View>
+ </SpaceBetween>
<View
style={{
flexDirection: 'row',
@@ -394,12 +392,11 @@ export function ReportSidebar({
flexShrink: 0,
}}
/>
- <View
+ <SpaceBetween
+ gap={5}
style={{
- flexDirection: 'row',
marginTop: 10,
marginBottom: 5,
- alignItems: 'center',
}}
>
<Text>
@@ -430,7 +427,7 @@ export function ReportSidebar({
>
Static
</ModeButton>
- </View>
+ </SpaceBetween>
{!customReportItems.isDateStatic ? (
<View
style={{
diff --git a/packages/desktop-client/src/components/reports/ReportTopbar.tsx b/packages/desktop-client/src/components/reports/ReportTopbar.tsx
index 042b781a11..b218f2b370 100644
--- a/packages/desktop-client/src/components/reports/ReportTopbar.tsx
+++ b/packages/desktop-client/src/components/reports/ReportTopbar.tsx
@@ -14,6 +14,7 @@ import {
} from '../../icons/v1';
import { SvgChartArea } from '../../icons/v1/ChartArea';
import { theme } from '../../style';
+import { SpaceBetween } from '../common/SpaceBetween';
import { View } from '../common/View';
import { FilterButton } from '../filters/FiltersMenu';
@@ -70,6 +71,7 @@ export function ReportTopbar({
alignItems: 'center',
marginBottom: 10,
flexShrink: 0,
+ overflowY: 'auto',
}}
>
<GraphButton
@@ -177,6 +179,7 @@ export function ReportTopbar({
>
<SvgTag width={15} height={15} />
</GraphButton>
+
<View
style={{
width: 1,
@@ -185,27 +188,35 @@ export function ReportTopbar({
marginRight: 15,
flexShrink: 0,
}}
- />{' '}
- <FilterButton
- compact
- hover
- onApply={(e: RuleConditionEntity) => {
- setSessionReport('conditions', [
- ...(customReportItems.conditions ?? []),
- e,
- ]);
- onApplyFilter(e);
- onReportChange({ type: 'modify' });
- }}
- exclude={[]}
- />
- <View style={{ flex: 1 }} />
- <SaveReport
- customReportItems={customReportItems}
- report={report}
- savedStatus={savedStatus}
- onReportChange={onReportChange}
/>
+
+ <SpaceBetween
+ style={{
+ flexWrap: 'nowrap',
+ justifyContent: 'space-between',
+ flex: 1,
+ }}
+ >
+ <FilterButton
+ compact
+ hover
+ onApply={(e: RuleConditionEntity) => {
+ setSessionReport('conditions', [
+ ...(customReportItems.conditions ?? []),
+ e,
+ ]);
+ onApplyFilter(e);
+ onReportChange({ type: 'modify' });
+ }}
+ exclude={[]}
+ />
+ <SaveReport
+ customReportItems={customReportItems}
+ report={report}
+ savedStatus={savedStatus}
+ onReportChange={onReportChange}
+ />
+ </SpaceBetween>
</View>
);
}
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
index 346983de07..a3a438b090 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
@@ -727,7 +727,6 @@ export function CustomReport() {
marginLeft: 5,
marginRight: 5,
gap: 10,
- alignItems: 'flex-start',
flexShrink: 0,
}}
>
diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsx
index 8ccd573a19..39be69e0e2 100644
--- a/packages/desktop-client/src/components/reports/reports/Spending.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx
@@ -23,6 +23,7 @@ import { Block } from '../../common/Block';
import { Button } from '../../common/Button2';
import { Paragraph } from '../../common/Paragraph';
import { Select } from '../../common/Select';
+import { SpaceBetween } from '../../common/SpaceBetween';
import { Text } from '../../common/Text';
import { Tooltip } from '../../common/Tooltip';
import { View } from '../../common/View';
@@ -235,13 +236,7 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
}}
>
{!isNarrowWidth && (
- <View
- style={{
- flexDirection: 'row',
- alignItems: 'center',
- flexShrink: 0,
- }}
- >
+ <SpaceBetween gap={0}>
{isDashboardsFeatureEnabled && (
<>
<Button
@@ -263,14 +258,7 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
</>
)}
- <View
- style={{
- alignItems: 'center',
- flexDirection: 'row',
- marginRight: 5,
- gap: 5,
- }}
- >
+ <SpaceBetween gap={5}>
<Text>
<Trans>Compare</Trans>
</Text>
@@ -305,7 +293,7 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
style={{ width: 150 }}
popoverStyle={{ width: 150 }}
/>
- </View>
+ </SpaceBetween>
<View
style={{
@@ -313,16 +301,11 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
height: 28,
backgroundColor: theme.pillBorderDark,
marginRight: 15,
- marginLeft: 10,
+ marginLeft: 15,
}}
/>
- <View
- style={{
- flexDirection: 'row',
- marginRight: 5,
- }}
- >
+ <SpaceBetween gap={5}>
<ModeButton
selected={reportMode === 'single-month'}
style={{
@@ -356,7 +339,7 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
>
<Trans>Average</Trans>
</ModeButton>
- </View>
+ </SpaceBetween>
<View
style={{
@@ -409,7 +392,7 @@ function SpendingInternal({ widget }: SpendingInternalProps) {
</Tooltip>
)}
</View>
- </View>
+ </SpaceBetween>
)}
{conditions && conditions.length > 0 && (
diff --git a/upcoming-release-notes/3636.md b/upcoming-release-notes/3636.md
new file mode 100644
index 0000000000..5a708dde79
--- /dev/null
+++ b/upcoming-release-notes/3636.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [MatissJanis]
+---
+
+Reports: responsibility UI polishing.