From 4ba1f98ab658d9d8b22192c2b173384eec866bb9 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 11 Jul 2024 08:25:24 -0400 Subject: [PATCH 1/2] refactor: slim down zoom controls --- src/components/buttons/Button.tsx | 1 + src/components/settings/AppearanceSettings.tsx | 12 ++++++------ src/routes/__snapshots__/Settings.test.tsx.snap | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx index c51696b10..0b7e0054a 100644 --- a/src/components/buttons/Button.tsx +++ b/src/components/buttons/Button.tsx @@ -19,6 +19,7 @@ const buttonVariants = cva( }, size: { default: 'min-w-20 h-10 px-4 py-1', + inline: 'h-5 rounded-md px-2 py-1', xs: 'h-7 rounded-md px-2 py-1', sm: 'h-9 rounded-md px-2 py-1', lg: 'h-11 rounded-md px-8', diff --git a/src/components/settings/AppearanceSettings.tsx b/src/components/settings/AppearanceSettings.tsx index f0de6d028..fbbef3aa9 100644 --- a/src/components/settings/AppearanceSettings.tsx +++ b/src/components/settings/AppearanceSettings.tsx @@ -63,10 +63,10 @@ export const AppearanceSettings: FC = () => { }} className="mb-0" /> -
+
@@ -77,11 +77,11 @@ export const AppearanceSettings: FC = () => { webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage - 10)) } className="rounded-r-none" - size="xs" + size="inline" > - - + {zoomPercentage.toFixed(0)}% @@ -100,7 +100,7 @@ export const AppearanceSettings: FC = () => { onClick={() => webFrame.setZoomLevel(0)} variant="destructive" className="rounded-l-none" - size="xs" + size="inline" > X diff --git a/src/routes/__snapshots__/Settings.test.tsx.snap b/src/routes/__snapshots__/Settings.test.tsx.snap index c04f6dbc1..79f3d7229 100644 --- a/src/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/routes/__snapshots__/Settings.test.tsx.snap @@ -155,35 +155,35 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
100 % From 02585dba3419492472cb5b5769194fd1f0a4eef5 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 11 Jul 2024 08:48:33 -0400 Subject: [PATCH 2/2] refactor: space settings controls consistently --- src/components/fields/Checkbox.tsx | 22 +- src/components/fields/RadioGroup.tsx | 6 +- .../__snapshots__/Checkbox.test.tsx.snap | 40 +- .../__snapshots__/RadioGroup.test.tsx.snap | 32 +- .../settings/AppearanceSettings.tsx | 5 +- .../__snapshots__/Filters.test.tsx.snap | 522 ++++++++---------- .../__snapshots__/Settings.test.tsx.snap | 250 ++++----- 7 files changed, 377 insertions(+), 500 deletions(-) diff --git a/src/components/fields/Checkbox.tsx b/src/components/fields/Checkbox.tsx index c39873be2..ff4d6162e 100644 --- a/src/components/fields/Checkbox.tsx +++ b/src/components/fields/Checkbox.tsx @@ -13,18 +13,16 @@ export interface ICheckbox { export const Checkbox: FC = (props: ICheckbox) => { return ( -
-
-
- -
+
+
+