From 576e0e8460ddaba203efaf166662e06b78f032b7 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 16 Oct 2025 09:34:22 -0700 Subject: [PATCH 1/4] feat(settings): improve tooltips Signed-off-by: Adam Setch --- src/renderer/components/fields/Tooltip.tsx | 10 +- .../settings/AppearanceSettings.tsx | 18 ++- .../settings/NotificationSettings.tsx | 15 ++- .../components/settings/SystemSettings.tsx | 24 ++++ .../components/settings/TraySettings.tsx | 6 + .../__snapshots__/Settings.test.tsx.snap | 120 ++++++++++++++++++ 6 files changed, 189 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/fields/Tooltip.tsx b/src/renderer/components/fields/Tooltip.tsx index 0dc7b0089..9771c4976 100644 --- a/src/renderer/components/fields/Tooltip.tsx +++ b/src/renderer/components/fields/Tooltip.tsx @@ -9,6 +9,8 @@ export interface ITooltip { export const Tooltip: FC = (props: ITooltip) => { const [showTooltip, setShowTooltip] = useState(false); + // Use CSS/Tailwind to center the tooltip and constrain its width to the + // viewport so it doesn't overflow the application window. return (
Show notification count +
+
Show system notifications +
Open at startup +
From f0fb349ee379168b7b1a86421d451744607386ba Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 16 Oct 2025 10:52:17 -0700 Subject: [PATCH 2/4] feat(settings): improve tooltips Signed-off-by: Adam Setch --- src/renderer/components/fields/Tooltip.tsx | 51 +++---- .../__snapshots__/Checkbox.test.tsx.snap | 8 +- .../__snapshots__/Tooltip.test.tsx.snap | 8 +- .../__snapshots__/FilterSection.test.tsx.snap | 72 +++++++--- .../__snapshots__/ReasonFilter.test.tsx.snap | 128 +++++++++++++----- .../__snapshots__/StateFilter.test.tsx.snap | 32 +++-- .../SubjectTypeFilter.test.tsx.snap | 8 +- .../UserTypeFilter.test.tsx.snap | 16 ++- .../__snapshots__/Filters.test.tsx.snap | 100 ++++++++++---- .../__snapshots__/Settings.test.tsx.snap | 114 ++++++++++------ 10 files changed, 381 insertions(+), 156 deletions(-) diff --git a/src/renderer/components/fields/Tooltip.tsx b/src/renderer/components/fields/Tooltip.tsx index 9771c4976..7f7f97c64 100644 --- a/src/renderer/components/fields/Tooltip.tsx +++ b/src/renderer/components/fields/Tooltip.tsx @@ -1,6 +1,7 @@ import { type FC, type ReactNode, useState } from 'react'; import { QuestionIcon } from '@primer/octicons-react'; +import { AnchoredOverlay } from '@primer/react'; export interface ITooltip { name: string; @@ -9,33 +10,35 @@ export interface ITooltip { export const Tooltip: FC = (props: ITooltip) => { const [showTooltip, setShowTooltip] = useState(false); - // Use CSS/Tailwind to center the tooltip and constrain its width to the - // viewport so it doesn't overflow the application window. return ( - )} - + side="outside-bottom" + > +
+ {props.tooltip} +
+ ); }; diff --git a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap index 21cec8378..bef3fb54a 100644 --- a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap @@ -436,10 +436,12 @@ exports[`renderer/components/fields/Checkbox.tsx should render - tooltip 1`] = ` Appearance -`; - -exports[`renderer/components/fields/Tooltip.tsx should display on mouse enter / leave 2`] = ` - -`; - -exports[`renderer/components/fields/Tooltip.tsx should render 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
- -
- , - "container":
- -
, - "debug": [Function], - "findAllByAltText": [Function], - "findAllByDisplayValue": [Function], - "findAllByLabelText": [Function], - "findAllByPlaceholderText": [Function], - "findAllByRole": [Function], - "findAllByTestId": [Function], - "findAllByText": [Function], - "findAllByTitle": [Function], - "findByAltText": [Function], - "findByDisplayValue": [Function], - "findByLabelText": [Function], - "findByPlaceholderText": [Function], - "findByRole": [Function], - "findByTestId": [Function], - "findByText": [Function], - "findByTitle": [Function], - "getAllByAltText": [Function], - "getAllByDisplayValue": [Function], - "getAllByLabelText": [Function], - "getAllByPlaceholderText": [Function], - "getAllByRole": [Function], - "getAllByTestId": [Function], - "getAllByText": [Function], - "getAllByTitle": [Function], - "getByAltText": [Function], - "getByDisplayValue": [Function], - "getByLabelText": [Function], - "getByPlaceholderText": [Function], - "getByRole": [Function], - "getByTestId": [Function], - "getByText": [Function], - "getByTitle": [Function], - "queryAllByAltText": [Function], - "queryAllByDisplayValue": [Function], - "queryAllByLabelText": [Function], - "queryAllByPlaceholderText": [Function], - "queryAllByRole": [Function], - "queryAllByTestId": [Function], - "queryAllByText": [Function], - "queryAllByTitle": [Function], - "queryByAltText": [Function], - "queryByDisplayValue": [Function], - "queryByLabelText": [Function], - "queryByPlaceholderText": [Function], - "queryByRole": [Function], - "queryByTestId": [Function], - "queryByText": [Function], - "queryByTitle": [Function], - "rerender": [Function], - "unmount": [Function], -} -`; diff --git a/src/renderer/components/settings/NotificationSettings.test.tsx b/src/renderer/components/settings/NotificationSettings.test.tsx index c28152685..e7e8a1ba3 100644 --- a/src/renderer/components/settings/NotificationSettings.test.tsx +++ b/src/renderer/components/settings/NotificationSettings.test.tsx @@ -1,6 +1,8 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { BaseStyles, ThemeProvider } from '@primer/react'; + import { mockAuth, mockSettings } from '../../__mocks__/state-mocks'; import { Constants } from '../../constants'; import { AppContext } from '../../context/App'; @@ -323,15 +325,19 @@ describe('renderer/components/settings/NotificationSettings.tsx', () => { await act(async () => { render( - - - , + + + + + + + , ); }); From 64ac44c392478922449579afbab60a84648cfee6 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Thu, 16 Oct 2025 11:37:27 -0700 Subject: [PATCH 4/4] feat(settings): improve tooltips Signed-off-by: Adam Setch --- src/renderer/components/fields/Tooltip.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/renderer/components/fields/Tooltip.tsx b/src/renderer/components/fields/Tooltip.tsx index 7f7f97c64..f791baa5a 100644 --- a/src/renderer/components/fields/Tooltip.tsx +++ b/src/renderer/components/fields/Tooltip.tsx @@ -14,8 +14,6 @@ export const Tooltip: FC = (props: ITooltip) => { return ( setShowTooltip(false)} - onOpen={() => setShowTooltip(true)} open={showTooltip} renderAnchor={(anchorProps) => (