From 37d5907dcae0524150297bd39991e323ee79afb0 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 24 Jan 2025 17:19:02 -0500 Subject: [PATCH 1/4] refactor: notification row layout Signed-off-by: Adam Setch --- .../notifications/NotificationFooter.tsx | 2 +- .../notifications/NotificationRow.tsx | 137 +- .../AccountNotifications.test.tsx.snap | 2204 ++++++++-------- .../NotificationFooter.test.tsx.snap | 16 +- .../NotificationRow.test.tsx.snap | 2268 +++++++++-------- .../RepositoryNotifications.test.tsx.snap | 14 +- .../components/primitives/HoverGroup.tsx | 2 +- .../__snapshots__/HoverGroup.test.tsx.snap | 4 +- 8 files changed, 2421 insertions(+), 2226 deletions(-) diff --git a/src/renderer/components/notifications/NotificationFooter.tsx b/src/renderer/components/notifications/NotificationFooter.tsx index 37655d41e..dba9c20ac 100644 --- a/src/renderer/components/notifications/NotificationFooter.tsx +++ b/src/renderer/components/notifications/NotificationFooter.tsx @@ -29,7 +29,7 @@ export const NotificationFooter: FC = ({ > {notification.subject.user ? ( ) => { // Don't trigger onClick of parent element. event.stopPropagation(); diff --git a/src/renderer/components/notifications/NotificationRow.tsx b/src/renderer/components/notifications/NotificationRow.tsx index da29a6ba4..82c68e8ff 100644 --- a/src/renderer/components/notifications/NotificationRow.tsx +++ b/src/renderer/components/notifications/NotificationRow.tsx @@ -7,7 +7,7 @@ import { } from 'react'; import { BellSlashIcon, CheckIcon, ReadIcon } from '@primer/octicons-react'; -import { IconButton, Tooltip } from '@primer/react'; +import { Box, IconButton, Stack, Text, Tooltip } from '@primer/react'; import { AppContext } from '../../context/App'; import { GroupBy, Opacity, Size } from '../../types'; @@ -87,87 +87,102 @@ export const NotificationRow: FC = ({ const groupByDate = settings.groupBy === GroupBy.DATE; return ( -
-
+ -
- -
handleNotification()} - > - -
handleNotification()} > - {notification.subject.title} - + + - {notificationNumber} - -
- - -
+ + {notification.subject.title} + + + {notificationNumber} + + + + + + + {!animateExit && ( + + {isMarkAsDoneFeatureSupported(notification.account) && ( + { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsDone([notification]); + }} + data-testid="notification-mark-as-done" + /> + )} - {!animateExit && ( - - {isMarkAsDoneFeatureSupported(notification.account) && ( { setAnimateExit(!settings.delayNotificationState); setShowAsRead(settings.delayNotificationState); - markNotificationsAsDone([notification]); + markNotificationsAsRead([notification]); }} - data-testid="notification-mark-as-done" + data-testid="notification-mark-as-read" /> - )} - - { - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsRead([notification]); - }} - data-testid="notification-mark-as-read" - /> - - - - )} -
+ + + + )} + +
); }; diff --git a/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap index 38eaea97a..fc7ebf050 100644 --- a/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap @@ -77,7 +77,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende
-
-
- + +
+
+ gitify-app/notifications-test + + gitify-app/notifications-test + +
+
+
+
+
+
+ + I am a robot and this is a test! + +
+
gitify-app/notifications-test - - gitify-app/notifications-test -
- -
+
+ + Updated + + + May 20, 2017 + +
+
+ +
+ + + 1 + +
+
+ +
+ + + 1 + +
+
+
+
+ + + +
+
+
+
+
+ + +
-
-
- gitify-app -
-
- Updated +
+
+ gitify-app/notifications-test + + gitify-app/notifications-test + +
+
- - May 20, 2017 - +
-
- - - 1 - -
+ Improve the UI
-
- - - 1 - -
-
-
-
-
-
- - - - - - -
-
-
-
- - - -
-
-
- -
-
- gitify-app/notifications-test - - gitify-app/notifications-test - -
-
-
-
-
-
- - Improve the UI - -
-
+
- -
-
- - Authored - -
+
- May 20, 2017 - -
-
-
-
-
- - -
+
+
+
+
- + + + + + +
@@ -1493,7 +1529,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende
-
-
- - -
- -
-
-
- - I am a robot and this is a test! - -
-
-
+
- gitify-app -
+ class="Box-sc-g0xbh4-0 text-xxs opacity-50" + />
- Updated + I am a robot and this is a test! - - May 20, 2017 - +
-
- - - 1 - + gitify-app
-
- +
-
-
+
+ +
- - -
+
+ +
- 1 - -
-
+ + + 1 + +
+ +
-
-
- + + +
-
-
- -
, @@ -2407,7 +2479,7 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende
+
+
+ +
+
+ gitify-app/notifications-test + + gitify-app/notifications-test + +
+
+
+
+
+
+ + I am a robot and this is a test! + +
+
+
+
+ gitify-app +
+
+
+ + Updated + + + May 20, 2017 + +
+
+ +
+ + + 1 + +
+
+ +
+ + + 1 + +
+
+
+
+
+
+ + + + + + +
+
+
+ , + "container":
+
+
+ + +
I am a robot and this is a test!
- , - "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], +} +`; + +exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - group by repositories 1`] = ` +{ + "asFragment": [Function], + "baseElement": +
- - - -
-
- - -
-
-
- - I am a robot and this is a test! + + + -
-
- gitify-app + I am a robot and this is a test! + +
-
-
- - Updated - - - May 20, 2017 - -
-
- +
+
+ gitify-app +
+
- - 1 + Updated + + May 20, 2017 +
-
-
- +
+ + + 1 + +
+ - 1 +
+ + + 1 + +
+
+
+
+ + + + + +
+
+ , + "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], -} -`; - -exports[`renderer/components/notifications/NotificationRow.tsx should render itself & its children - group by repositories 1`] = ` -{ - "asFragment": [Function], - "baseElement": -
-
-
- - - -
-
-
- - I am a robot and this is a test! - - + I am a robot and this is a test! + +
- , - "container":
-
-
- - - -
-
-
- - I am a robot and this is a test! - - -
-
-
-
- gitify-app -
-
-
- - Updated - - - May 20, 2017 - -
-
- -
- - - 1 - -
-
- -
- - - 1 - -
-
-
-
-
-
- - - - - - -
-
, "debug": [Function], "findAllByAltText": [Function], @@ -1490,54 +1562,406 @@ exports[`renderer/components/notifications/NotificationRow.tsx should render its "baseElement":
+
+ + + +
+
+ + I am a robot and this is a test! + +
+
+
+
+ gitify-app +
+
+
+ + Updated + + + May 20, 2017 + +
+
+ +
+ + + 1 + +
+
+ +
+ + + 1 + +
+
+
+
+
+
+ + + + + + +
+
+
+
+ , + "container":
+
+
- + + + +
I am a robot and this is a test!
- , - "container":
-
-
- - - -
-
-
- - I am a robot and this is a test! - -
-
-
-
- gitify-app -
-
-
- - Updated - - - May 20, 2017 - -
-
- -
- - - 1 - -
-
- -
- - - 1 - -
-
-
-
-
-
- - - - - - -
-
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap index 42c36333e..19b4a553a 100644 --- a/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/RepositoryNotifications.test.tsx.snap @@ -80,7 +80,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should re
= ({ children }: IHoverGroup) => { direction="horizontal" align="center" gap="none" - className="opacity-0 transition-opacity group-hover:opacity-80" + className="opacity-0 transition-opacity group-hover:opacity-100 group-hover:bg-gitify-notification-hover absolute right-0 h-full" > {children} diff --git a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap index 896caa0d2..01ce7200d 100644 --- a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/primitives/HoverGroup.tsx should render 1`] = ` "baseElement":
, "container":
Date: Sat, 25 Jan 2025 09:39:36 -0500 Subject: [PATCH 2/4] refactor: notification row layouts Signed-off-by: Adam Setch --- .../components/avatars/AvatarWithFallback.tsx | 8 +- .../AvatarWithFallback.test.tsx.snap | 40 +- src/renderer/components/fields/Checkbox.tsx | 1 + src/renderer/components/fields/RadioGroup.tsx | 3 +- .../components/fields/Tooltip.test.tsx | 4 +- src/renderer/components/fields/Tooltip.tsx | 14 +- .../__snapshots__/Checkbox.test.tsx.snap | 2 + .../__snapshots__/RadioGroup.test.tsx.snap | 40 +- .../__snapshots__/Tooltip.test.tsx.snap | 48 +- .../notifications/AccountNotifications.tsx | 112 +- .../notifications/NotificationHeader.tsx | 29 +- .../notifications/NotificationRow.tsx | 83 +- .../RepositoryNotifications.test.tsx | 8 +- .../notifications/RepositoryNotifications.tsx | 106 +- .../AccountNotifications.test.tsx.snap | 3720 +++++++++-------- .../NotificationFooter.test.tsx.snap | 20 +- .../NotificationHeader.test.tsx.snap | 204 +- .../NotificationRow.test.tsx.snap | 244 +- .../RepositoryNotifications.test.tsx.snap | 1594 +++---- .../primitives/HoverButton.test.tsx | 34 + .../components/primitives/HoverButton.tsx | 33 + .../components/primitives/HoverGroup.test.tsx | 2 +- .../components/primitives/HoverGroup.tsx | 13 +- .../__snapshots__/HoverButton.test.tsx.snap | 201 + .../__snapshots__/HoverGroup.test.tsx.snap | 4 +- .../settings/AppearanceSettings.test.tsx | 8 +- .../settings/AppearanceSettings.tsx | 50 +- .../settings/NotificationSettings.test.tsx | 12 +- .../settings/NotificationSettings.tsx | 31 +- .../settings/SystemSettings.test.tsx | 21 +- .../components/settings/SystemSettings.tsx | 25 +- src/renderer/routes/Accounts.tsx | 45 +- src/renderer/routes/Filters.tsx | 6 +- .../__snapshots__/Accounts.test.tsx.snap | 864 ++-- .../__snapshots__/Filters.test.tsx.snap | 166 +- .../__snapshots__/Settings.test.tsx.snap | 117 +- 36 files changed, 4202 insertions(+), 3710 deletions(-) create mode 100644 src/renderer/components/primitives/HoverButton.test.tsx create mode 100644 src/renderer/components/primitives/HoverButton.tsx create mode 100644 src/renderer/components/primitives/__snapshots__/HoverButton.test.tsx.snap diff --git a/src/renderer/components/avatars/AvatarWithFallback.tsx b/src/renderer/components/avatars/AvatarWithFallback.tsx index 8610c922e..693928074 100644 --- a/src/renderer/components/avatars/AvatarWithFallback.tsx +++ b/src/renderer/components/avatars/AvatarWithFallback.tsx @@ -32,6 +32,7 @@ export const AvatarWithFallback: React.FC = ({ align="center" gap="condensed" data-testid="avatar" + className="truncate" > {!src || isBroken ? ( isNonHuman ? ( @@ -48,7 +49,12 @@ export const AvatarWithFallback: React.FC = ({ onError={() => setIsBroken(true)} /> )} - {name && {name}} + {name && ( + // TODO add truncation logic for long names + + {name} + + )} ); }; diff --git a/src/renderer/components/avatars/__snapshots__/AvatarWithFallback.test.tsx.snap b/src/renderer/components/avatars/__snapshots__/AvatarWithFallback.test.tsx.snap index 16d16b195..ad94442ee 100644 --- a/src/renderer/components/avatars/__snapshots__/AvatarWithFallback.test.tsx.snap +++ b/src/renderer/components/avatars/__snapshots__/AvatarWithFallback.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback "baseElement":
@gitify-app @@ -41,7 +41,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback , "container":
@gitify-app @@ -133,7 +133,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback "baseElement":
@gitify-app @@ -168,7 +168,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback , "container":
@gitify-app @@ -256,7 +256,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback icon when the image fails to load (isBroken = true) - human user 1`] = `
@gitify-app @@ -285,7 +285,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback exports[`renderer/components/avatars/AvatarWithFallback.tsx renders the fallback icon when the image fails to load (isBroken = true) - non human user 1`] = `
@gitify-app @@ -318,7 +318,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx should render avatar "baseElement":
@gitify-app @@ -347,7 +347,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx should render avatar , "container":
@gitify-app @@ -433,7 +433,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx should render avatar "baseElement":
@gitify-app @@ -462,7 +462,7 @@ exports[`renderer/components/avatars/AvatarWithFallback.tsx should render avatar , "container":
@gitify-app diff --git a/src/renderer/components/fields/Checkbox.tsx b/src/renderer/components/fields/Checkbox.tsx index 84b55f0b0..264afeba7 100644 --- a/src/renderer/components/fields/Checkbox.tsx +++ b/src/renderer/components/fields/Checkbox.tsx @@ -22,6 +22,7 @@ export const Checkbox: FC = (props: ICheckbox) => { checked={props.checked} onChange={props.onChange} disabled={props.disabled} + data-testid={`checkbox-${props.name}`} />
diff --git a/src/renderer/components/fields/RadioGroup.tsx b/src/renderer/components/fields/RadioGroup.tsx index 990254158..4c5fbe143 100644 --- a/src/renderer/components/fields/RadioGroup.tsx +++ b/src/renderer/components/fields/RadioGroup.tsx @@ -21,7 +21,7 @@ export const RadioGroup: FC = (props: IRadioGroup) => { aria-labelledby={props.name} > {props.options.map((item) => { - const name = `${props.name}_${item.value.toLowerCase()}`; + const name = `radio-${props.name}-${item.value}`.toLowerCase(); return (
@@ -33,6 +33,7 @@ export const RadioGroup: FC = (props: IRadioGroup) => { value={item.value} onChange={props.onChange} checked={item.value === props.value} + data-testid={name} />
diff --git a/src/renderer/components/fields/Tooltip.test.tsx b/src/renderer/components/fields/Tooltip.test.tsx index bd76b4bb0..ae81a48d4 100644 --- a/src/renderer/components/fields/Tooltip.test.tsx +++ b/src/renderer/components/fields/Tooltip.test.tsx @@ -3,7 +3,7 @@ import { type ITooltip, Tooltip } from './Tooltip'; describe('renderer/components/fields/Tooltip.tsx', () => { const props: ITooltip = { - name: 'tooltip', + name: 'test', tooltip: 'This is some tooltip text', }; @@ -15,7 +15,7 @@ describe('renderer/components/fields/Tooltip.tsx', () => { it('should display on mouse enter / leave', () => { render(); - const tooltipElement = screen.getByLabelText('tooltip'); + const tooltipElement = screen.getByTestId('tooltip-test'); fireEvent.mouseEnter(tooltipElement); expect(tooltipElement).toMatchSnapshot(); diff --git a/src/renderer/components/fields/Tooltip.tsx b/src/renderer/components/fields/Tooltip.tsx index 4a89746d5..377494bbb 100644 --- a/src/renderer/components/fields/Tooltip.tsx +++ b/src/renderer/components/fields/Tooltip.tsx @@ -1,4 +1,5 @@ import { QuestionIcon } from '@primer/octicons-react'; +import { Box } from '@primer/react'; import { type FC, type ReactNode, useState } from 'react'; export interface ITooltip { @@ -10,21 +11,22 @@ export const Tooltip: FC = (props: ITooltip) => { const [showTooltip, setShowTooltip] = useState(false); return ( - setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)} + data-testid={`tooltip-${props.name}`} > {showTooltip && ( -
-
+ + {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 fd71ec0d4..748f774a7 100644 --- a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap @@ -14,6 +14,7 @@ exports[`renderer/components/fields/Checkbox.tsx should render 1`] = ` @@ -41,6 +42,7 @@ exports[`renderer/components/fields/Checkbox.tsx should render 1`] = ` diff --git a/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap b/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap index 5f74db2a9..a9e3e3979 100644 --- a/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap @@ -24,14 +24,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` > @@ -42,14 +43,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` @@ -78,14 +80,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` > @@ -96,14 +99,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` @@ -189,14 +193,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] > @@ -207,14 +212,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] @@ -243,14 +249,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] > @@ -261,14 +268,15 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] diff --git a/src/renderer/components/fields/__snapshots__/Tooltip.test.tsx.snap b/src/renderer/components/fields/__snapshots__/Tooltip.test.tsx.snap index d65bd91d4..e5931df76 100644 --- a/src/renderer/components/fields/__snapshots__/Tooltip.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/Tooltip.test.tsx.snap @@ -1,10 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renderer/components/fields/Tooltip.tsx should display on mouse enter / leave 1`] = ` -
This is some tooltip text
-
+
`; exports[`renderer/components/fields/Tooltip.tsx should display on mouse enter / leave 2`] = ` - - +
`; exports[`renderer/components/fields/Tooltip.tsx should render 1`] = ` @@ -64,10 +66,11 @@ exports[`renderer/components/fields/Tooltip.tsx should render 1`] = ` "asFragment": [Function], "baseElement":
- - +
, "container":
- - +
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/notifications/AccountNotifications.tsx b/src/renderer/components/notifications/AccountNotifications.tsx index db2f0fabc..a749bfaae 100644 --- a/src/renderer/components/notifications/AccountNotifications.tsx +++ b/src/renderer/components/notifications/AccountNotifications.tsx @@ -1,7 +1,7 @@ import { type FC, type MouseEvent, useContext, useMemo, useState } from 'react'; import { GitPullRequestIcon, IssueOpenedIcon } from '@primer/octicons-react'; -import { Button, IconButton } from '@primer/react'; +import { Box, Button, Stack } from '@primer/react'; import { AppContext } from '../../context/App'; import { type Account, type GitifyError, Size } from '../../types'; @@ -16,6 +16,7 @@ import { import { AllRead } from '../AllRead'; import { Oops } from '../Oops'; import { AvatarWithFallback } from '../avatars/AvatarWithFallback'; +import { HoverButton } from '../primitives/HoverButton'; import { HoverGroup } from '../primitives/HoverGroup'; import { NotificationRow } from './NotificationRow'; import { RepositoryNotifications } from './RepositoryNotifications'; @@ -34,6 +35,9 @@ export const AccountNotifications: FC = ( const { settings } = useContext(AppContext); + const [showAccountNotifications, setShowAccountNotifications] = + useState(true); + const groupedNotifications = Object.values( notifications.reduce( (acc: { [key: string]: Notification[] }, notification) => { @@ -51,10 +55,7 @@ export const AccountNotifications: FC = ( [notifications], ); - const [showAccountNotifications, setShowAccountNotifications] = - useState(true); - - const toggleAccountNotifications = () => { + const actionToggleAccountNotifications = () => { setShowAccountNotifications(!showAccountNotifications); }; @@ -69,70 +70,63 @@ export const AccountNotifications: FC = ( return ( <> {showAccountHeader && ( -
- - - - ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - openGitHubIssues(account.hostname); - }} - data-testid="account-issues" - /> - - ) => { // Don't trigger onClick of parent element. event.stopPropagation(); - openGitHubPulls(account.hostname); + openAccountProfile(account); }} - data-testid="account-pull-requests" - /> - - - -
+ data-testid="account-profile" + > + + + + + openGitHubIssues(account.hostname)} + /> + + openGitHubPulls(account.hostname)} + /> + + + + + )} {showAccountNotifications && ( diff --git a/src/renderer/components/notifications/NotificationHeader.tsx b/src/renderer/components/notifications/NotificationHeader.tsx index 7863429a7..2e41e7b22 100644 --- a/src/renderer/components/notifications/NotificationHeader.tsx +++ b/src/renderer/components/notifications/NotificationHeader.tsx @@ -1,6 +1,6 @@ import { type FC, type MouseEvent, useContext } from 'react'; -import { Box, Stack, Tooltip } from '@primer/react'; +import { Box, Stack } from '@primer/react'; import { AppContext } from '../../context/App'; import { GroupBy, Opacity, Size } from '../../types'; @@ -28,9 +28,10 @@ export const NotificationHeader: FC = ({ return ( groupByDate && ( - - + + ) => { // Don't trigger onClick of parent element. @@ -47,17 +48,17 @@ export const NotificationHeader: FC = ({ userType={notification.repository.owner.type} /> - - - {notificationNumber} - - + + {notificationNumber} + + + ) ); }; diff --git a/src/renderer/components/notifications/NotificationRow.tsx b/src/renderer/components/notifications/NotificationRow.tsx index 82c68e8ff..31dd24b1f 100644 --- a/src/renderer/components/notifications/NotificationRow.tsx +++ b/src/renderer/components/notifications/NotificationRow.tsx @@ -1,13 +1,7 @@ -import { - type FC, - type MouseEvent, - useCallback, - useContext, - useState, -} from 'react'; +import { type FC, useCallback, useContext, useState } from 'react'; import { BellSlashIcon, CheckIcon, ReadIcon } from '@primer/octicons-react'; -import { Box, IconButton, Stack, Text, Tooltip } from '@primer/react'; +import { Box, Stack, Text, Tooltip } from '@primer/react'; import { AppContext } from '../../context/App'; import { GroupBy, Opacity, Size } from '../../types'; @@ -20,6 +14,7 @@ import { getNotificationTypeIconColor, } from '../../utils/icons'; import { openNotification } from '../../utils/links'; +import { HoverButton } from '../primitives/HoverButton'; import { HoverGroup } from '../primitives/HoverGroup'; import { NotificationFooter } from './NotificationFooter'; import { NotificationHeader } from './NotificationHeader'; @@ -62,10 +57,19 @@ export const NotificationRow: FC = ({ settings, ]); - const unsubscribeFromThread = (event: MouseEvent) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); + const actionMarkAsDone = () => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsDone([notification]); + }; + + const actionMarkAsRead = () => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsRead([notification]); + }; + const actionUnsubscribeFromThread = () => { unsubscribeNotification(notification); }; @@ -82,7 +86,7 @@ export const NotificationRow: FC = ({ : ''; const notificationTitle = - `${notification.subject.title} ${notificationNumber}`.trim(); + `${notification.subject.title} ${notificationNumber && `[${notificationNumber}]`}`.trim(); const groupByDate = settings.groupBy === GroupBy.DATE; @@ -111,7 +115,7 @@ export const NotificationRow: FC = ({ handleNotification()} > @@ -122,7 +126,7 @@ export const NotificationRow: FC = ({ justify="space-between" gap="condensed" title={notificationTitle} - className="text-sm mb-1 truncate" + className="text-sm mb-0.5 truncate" data-testid="notification-row" > @@ -130,7 +134,7 @@ export const NotificationRow: FC = ({ = ({ {!animateExit && ( - - {isMarkAsDoneFeatureSupported(notification.account) && ( - { - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsDone([notification]); - }} - data-testid="notification-mark-as-done" - /> - )} - - + + + { - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsRead([notification]); - }} - data-testid="notification-mark-as-read" + testid="notification-mark-as-read" + action={actionMarkAsRead} /> - )} diff --git a/src/renderer/components/notifications/RepositoryNotifications.test.tsx b/src/renderer/components/notifications/RepositoryNotifications.test.tsx index 2aadeb17b..72cb19b65 100644 --- a/src/renderer/components/notifications/RepositoryNotifications.test.tsx +++ b/src/renderer/components/notifications/RepositoryNotifications.test.tsx @@ -47,7 +47,7 @@ describe('renderer/components/notifications/RepositoryNotifications.tsx', () => , ); - fireEvent.click(screen.getByText(props.repoName)); + fireEvent.click(screen.getByTestId('open-repository')); expect(openExternalLinkMock).toHaveBeenCalledTimes(1); expect(openExternalLinkMock).toHaveBeenCalledWith( @@ -64,7 +64,7 @@ describe('renderer/components/notifications/RepositoryNotifications.tsx', () => , ); - fireEvent.click(screen.getByLabelText('Mark repository as read')); + fireEvent.click(screen.getByTestId('repository-mark-as-read')); expect(markNotificationsAsRead).toHaveBeenCalledWith( mockGitHubNotifications, @@ -80,7 +80,7 @@ describe('renderer/components/notifications/RepositoryNotifications.tsx', () => , ); - fireEvent.click(screen.getByLabelText('Mark repository as done')); + fireEvent.click(screen.getByTestId('repository-mark-as-done')); expect(markNotificationsAsDone).toHaveBeenCalledWith( mockGitHubNotifications, @@ -103,7 +103,7 @@ describe('renderer/components/notifications/RepositoryNotifications.tsx', () => render(); }); - fireEvent.click(screen.getByLabelText('Hide repository notifications')); + fireEvent.click(screen.getByTestId('repository-toggle')); const tree = render(); expect(tree).toMatchSnapshot(); diff --git a/src/renderer/components/notifications/RepositoryNotifications.tsx b/src/renderer/components/notifications/RepositoryNotifications.tsx index 1714f6a52..ec227e663 100644 --- a/src/renderer/components/notifications/RepositoryNotifications.tsx +++ b/src/renderer/components/notifications/RepositoryNotifications.tsx @@ -1,5 +1,5 @@ import { CheckIcon, ReadIcon } from '@primer/octicons-react'; -import { Button, IconButton } from '@primer/react'; +import { Box, Button, Stack } from '@primer/react'; import { type FC, type MouseEvent, useContext, useState } from 'react'; import { AppContext } from '../../context/App'; @@ -10,6 +10,7 @@ import { isMarkAsDoneFeatureSupported } from '../../utils/features'; import { getChevronDetails } from '../../utils/helpers'; import { openRepository } from '../../utils/links'; import { AvatarWithFallback } from '../avatars/AvatarWithFallback'; +import { HoverButton } from '../primitives/HoverButton'; import { HoverGroup } from '../primitives/HoverGroup'; import { NotificationRow } from './NotificationRow'; @@ -31,7 +32,19 @@ export const RepositoryNotifications: FC = ({ const avatarUrl = repoNotifications[0].repository.owner.avatar_url; - const toggleRepositoryNotifications = () => { + const actionMarkAsDone = () => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsDone(repoNotifications); + }; + + const actionMarkAsRead = () => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsRead(repoNotifications); + }; + + const actionToggleRepositoryNotifications = () => { setShowRepositoryNotifications(!showRepositoryNotifications); }; @@ -43,17 +56,21 @@ export const RepositoryNotifications: FC = ({ return ( <> -
-
-
- {!animateExit && ( - - {isMarkAsDoneFeatureSupported(repoNotifications[0].account) && ( - + ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsDone(repoNotifications); - }} + enabled={isMarkAsDoneFeatureSupported( + repoNotifications[0].account, + )} + testid="repository-mark-as-done" + action={actionMarkAsDone} /> - )} - ) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsRead(repoNotifications); - }} - /> + - - - )} -
+ + + )} + + {showRepositoryNotifications && repoNotifications.map((notification) => ( diff --git a/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap index fc7ebf050..bbce270de 100644 --- a/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap @@ -6,10 +6,280 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
+
+
+
+
+ 🔥 +
+
+ Error title +
+
+
+ Error description +
+
+
+
+ , + "container":
+ +
-
-
- 🔥 -
-
- Error title -
-
-
- Error description -
-
-
-
- , - "container":
- -
-
-
@@ -565,202 +585,212 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
-
gitify-app/notifications-test
-
-
+
+
+ + + +
+
+
- - - - - - -
-
-
-
-
gitify-app/notifications-test
-
-
+
+
- - + +
+
+
+ Repository Notifications +
+
+ , + "container":
+ - , - "container":
-
@@ -2875,202 +2927,212 @@ exports[`renderer/components/notifications/AccountNotifications.tsx should rende "baseElement":
, "container":
+ + + +
+
+
+
+
+
+ Repository Notifications +
-
+ , + "container":
+ - , - "container":
-
Repository Notifications diff --git a/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap index a958bc5de..be82bab33 100644 --- a/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationFooter.test.tsx.snap @@ -20,7 +20,7 @@ exports[`renderer/components/notifications/NotificationFooter.tsx security alert title="gitify-app" >
-
gitify-app/notifications-test
-
-
+
+
, "container":
-
gitify-app/notifications-test
-
-
+
+
, "debug": [Function], @@ -171,26 +167,24 @@ exports[`renderer/components/notifications/NotificationHeader.tsx should render "baseElement":
-
gitify-app/notifications-test
-
-
, "container":
-
gitify-app/notifications-test
-
-
, "debug": [Function], @@ -336,26 +328,24 @@ exports[`renderer/components/notifications/NotificationHeader.tsx should render "baseElement":
-
gitify-app/notifications-test
-
-
+
+
, "container":
-
gitify-app/notifications-test
-
-
+
+
, "debug": [Function], diff --git a/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap index 0fc05bf85..33eb3a69f 100644 --- a/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/renderer/components/notifications/__snapshots__/NotificationRow.test.tsx.snap @@ -45,7 +45,7 @@ exports[`renderer/components/notifications/NotificationRow.tsx should render its
-
gitify-app/notifications-test
-
-
+
+
+
+ + + + + + +
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+
@@ -133,6 +355,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should re data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-mark-as-read" sx="[object Object]" type="button" > @@ -170,6 +393,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should re data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-toggle" sx="[object Object]" type="button" > @@ -201,210 +425,6 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should re
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
- - - - - - -
NotificationRow @@ -473,16 +493,23 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should to "baseElement":
-
-
- + +
+
+ + + + + + +
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+
@@ -810,6 +1068,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should to data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-mark-as-read" sx="[object Object]" type="button" > @@ -847,6 +1106,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should to data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-toggle" sx="[object Object]" type="button" > @@ -871,222 +1131,12 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should to aria-hidden="true" class="Tooltip__StyledTooltip-sc-e45c7z-0 eELanX" data-direction="s" - id=":r1f:" - popover="auto" - > - Hide repository notifications - -
-
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
- - - - - - + Hide repository notifications + +
@@ -1156,16 +1206,23 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should us "baseElement":
+
+ + + + + + +
+
+
+ NotificationRow +
+
+ NotificationRow +
+
+ , + "container":
+
+
+
@@ -1289,6 +1567,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should us data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-mark-as-read" sx="[object Object]" type="button" > @@ -1326,6 +1605,7 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should us data-loading="false" data-no-visuals="true" data-size="small" + data-testid="repository-toggle" sx="[object Object]" type="button" > @@ -1357,216 +1637,6 @@ exports[`renderer/components/notifications/RepositoryNotifications.tsx should us
-
- NotificationRow -
-
- NotificationRow -
-
- , - "container":
-
-
- -
-
- - - - - - -
NotificationRow diff --git a/src/renderer/components/primitives/HoverButton.test.tsx b/src/renderer/components/primitives/HoverButton.test.tsx new file mode 100644 index 000000000..a09534dc5 --- /dev/null +++ b/src/renderer/components/primitives/HoverButton.test.tsx @@ -0,0 +1,34 @@ +import { MarkGithubIcon } from '@primer/octicons-react'; +import { render } from '@testing-library/react'; +import { HoverButton } from './HoverButton'; + +describe('renderer/components/primitives/HoverButton.tsx', () => { + it('should render', () => { + const mockAction = jest.fn(); + + const tree = render( + , + ); + expect(tree).toMatchSnapshot(); + }); + + it('should render - disabled', () => { + const mockAction = jest.fn(); + + const tree = render( + , + ); + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/src/renderer/components/primitives/HoverButton.tsx b/src/renderer/components/primitives/HoverButton.tsx new file mode 100644 index 000000000..4cb8f8ff6 --- /dev/null +++ b/src/renderer/components/primitives/HoverButton.tsx @@ -0,0 +1,33 @@ +import type { FC } from 'react'; + +import type { Icon } from '@primer/octicons-react'; +import { IconButton } from '@primer/react'; + +interface IHoverButton { + label: string; + icon: Icon; + enabled?: boolean; + testid: string; + action: () => void; +} + +export const HoverButton: FC = ({ + enabled = true, + ...props +}: IHoverButton) => { + return ( + enabled && ( + { + event.stopPropagation(); + props.action(); + }} + data-testid={props.testid} + /> + ) + ); +}; diff --git a/src/renderer/components/primitives/HoverGroup.test.tsx b/src/renderer/components/primitives/HoverGroup.test.tsx index 582ac2af9..40eef7485 100644 --- a/src/renderer/components/primitives/HoverGroup.test.tsx +++ b/src/renderer/components/primitives/HoverGroup.test.tsx @@ -3,7 +3,7 @@ import { HoverGroup } from './HoverGroup'; describe('renderer/components/primitives/HoverGroup.tsx', () => { it('should render', () => { - const tree = render(Hover Group); + const tree = render(Hover Group); expect(tree).toMatchSnapshot(); }); }); diff --git a/src/renderer/components/primitives/HoverGroup.tsx b/src/renderer/components/primitives/HoverGroup.tsx index 989aa3495..7d6e18b16 100644 --- a/src/renderer/components/primitives/HoverGroup.tsx +++ b/src/renderer/components/primitives/HoverGroup.tsx @@ -1,18 +1,27 @@ import type { FC, ReactNode } from 'react'; import { Stack } from '@primer/react'; +import { cn } from '../../utils/cn'; interface IHoverGroup { + bgColor: string; children: ReactNode; } -export const HoverGroup: FC = ({ children }: IHoverGroup) => { +export const HoverGroup: FC = ({ + bgColor, + children, +}: IHoverGroup) => { return ( {children} diff --git a/src/renderer/components/primitives/__snapshots__/HoverButton.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/HoverButton.test.tsx.snap new file mode 100644 index 000000000..832ab41a0 --- /dev/null +++ b/src/renderer/components/primitives/__snapshots__/HoverButton.test.tsx.snap @@ -0,0 +1,201 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renderer/components/primitives/HoverButton.tsx should render - disabled 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], +} +`; + +exports[`renderer/components/primitives/HoverButton.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/primitives/__snapshots__/HoverGroup.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap index 01ce7200d..23d473a89 100644 --- a/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/HoverGroup.test.tsx.snap @@ -6,7 +6,7 @@ exports[`renderer/components/primitives/HoverGroup.tsx should render 1`] = ` "baseElement":
, "container":
{ ); }); - fireEvent.click(screen.getByLabelText('Detailed notifications')); + fireEvent.click(screen.getByTestId('checkbox-detailedNotifications')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('detailedNotifications', false); @@ -163,7 +163,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show notification metric pills')); + fireEvent.click(screen.getByTestId('checkbox-showPills')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('showPills', false); @@ -186,7 +186,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show number')); + fireEvent.click(screen.getByTestId('checkbox-showNumber')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('showNumber', false); @@ -211,7 +211,7 @@ describe('renderer/routes/components/settings/AppearanceSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show account header')); + fireEvent.click(screen.getByTestId('checkbox-showAccountHeader')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('showAccountHeader', true); diff --git a/src/renderer/components/settings/AppearanceSettings.tsx b/src/renderer/components/settings/AppearanceSettings.tsx index 39545b6da..6b6e506fa 100644 --- a/src/renderer/components/settings/AppearanceSettings.tsx +++ b/src/renderer/components/settings/AppearanceSettings.tsx @@ -18,6 +18,8 @@ import { ButtonGroup, IconButton, Select, + Stack, + Text, useTheme, } from '@primer/react'; @@ -168,17 +170,17 @@ export const AppearanceSettings: FC = () => { updateSetting('detailedNotifications', evt.target.checked) } tooltip={ -
-
+ + Enrich notifications with author or last commenter profile information, state and GitHub-like colors. -
-
+ + ⚠️ Users with a large number of unread notifications may{' '} experience rate limiting under certain circumstances. Disable this setting if you experience this. -
-
+ + } /> @@ -228,29 +230,35 @@ export const AppearanceSettings: FC = () => { } disabled={!settings.detailedNotifications} tooltip={ -
+
Show GitHub number for:
    -
  • - - Discussion +
  • + + + Discussion +
  • -
  • - - Issue +
  • + + + Issue +
  • -
  • - - Pull Request +
  • + + + Pull Request +
-
- ⚠️ This setting requires Detailed Notifications to - be enabled. -
-
+ + ⚠️ This setting requires{' '} + Detailed Notifications to be enabled. + + } /> diff --git a/src/renderer/components/settings/NotificationSettings.test.tsx b/src/renderer/components/settings/NotificationSettings.test.tsx index cecdebaa3..3a72bfdb2 100644 --- a/src/renderer/components/settings/NotificationSettings.test.tsx +++ b/src/renderer/components/settings/NotificationSettings.test.tsx @@ -29,7 +29,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Date')); + fireEvent.click(screen.getByTestId('radio-groupby-date')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('groupBy', 'DATE'); @@ -52,7 +52,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Fetch all notifications'), { + fireEvent.click(screen.getByTestId('checkbox-fetchAllNotifications'), { target: { checked: true }, }); @@ -77,7 +77,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show only participating'), { + fireEvent.click(screen.getByTestId('checkbox-showOnlyParticipating'), { target: { checked: true }, }); @@ -141,7 +141,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Mark as done on open'), { + fireEvent.click(screen.getByTestId('checkbox-markAsDoneOnOpen'), { target: { checked: true }, }); @@ -166,7 +166,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Mark as done on unsubscribe'), { + fireEvent.click(screen.getByTestId('checkbox-markAsDoneOnUnsubscribe'), { target: { checked: true }, }); @@ -194,7 +194,7 @@ describe('renderer/routes/components/settings/NotificationSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Delay notification state'), { + fireEvent.click(screen.getByTestId('checkbox-delayNotificationState'), { target: { checked: true }, }); diff --git a/src/renderer/components/settings/NotificationSettings.tsx b/src/renderer/components/settings/NotificationSettings.tsx index e481daca0..181aa71e4 100644 --- a/src/renderer/components/settings/NotificationSettings.tsx +++ b/src/renderer/components/settings/NotificationSettings.tsx @@ -1,6 +1,7 @@ import { type FC, type MouseEvent, useContext } from 'react'; import { BellIcon } from '@primer/octicons-react'; +import { Stack, Text } from '@primer/react'; import { APPLICATION } from '../../../shared/constants'; import { AppContext } from '../../context/App'; @@ -36,16 +37,16 @@ export const NotificationSettings: FC = () => { updateSetting('fetchAllNotifications', evt.target.checked) } tooltip={ -
-
- When checked, Gitify will fetch all{' '} - notifications from your inbox. -
-
- When unchecked, Gitify will only fetch the first page of - notifications (max 50 records per GitHub account) -
-
+ + + When checked, Gitify will fetch{' '} + all notifications from your inbox. + + + When unchecked, Gitify will only fetch the + first page of notifications (max 50 records per GitHub account) + + } /> { checked={settings.participating} onChange={(evt) => updateSetting('participating', evt.target.checked)} tooltip={ -
- See + + See{' '} + {' '} for more details. -
+ } /> { ); }); - fireEvent.click(screen.getByLabelText('Background')); + fireEvent.click(screen.getByTestId('radio-openlinks-background')); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith('openLinks', 'BACKGROUND'); @@ -51,7 +51,7 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Enable keyboard shortcut'), { + fireEvent.click(screen.getByTestId('checkbox-keyboardShortcut'), { target: { checked: true }, }); @@ -76,9 +76,12 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show notifications count in tray'), { - target: { checked: true }, - }); + fireEvent.click( + screen.getByTestId('checkbox-showNotificationsCountInTray'), + { + target: { checked: true }, + }, + ); expect(updateSetting).toHaveBeenCalledTimes(1); expect(updateSetting).toHaveBeenCalledWith( @@ -104,7 +107,7 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Show system notifications'), { + fireEvent.click(screen.getByTestId('checkbox-showNotifications'), { target: { checked: true }, }); @@ -129,7 +132,7 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Play sound'), { + fireEvent.click(screen.getByTestId('checkbox-playSound'), { target: { checked: true }, }); @@ -154,7 +157,7 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Use alternate idle icon'), { + fireEvent.click(screen.getByTestId('checkbox-useAlternateIdleIcon'), { target: { checked: true }, }); @@ -179,7 +182,7 @@ describe('renderer/routes/components/settings/SystemSettings.tsx', () => { ); }); - fireEvent.click(screen.getByLabelText('Open at startup'), { + fireEvent.click(screen.getByTestId('checkbox-openAtStartup'), { target: { checked: true }, }); diff --git a/src/renderer/components/settings/SystemSettings.tsx b/src/renderer/components/settings/SystemSettings.tsx index 156307436..2f9b3b059 100644 --- a/src/renderer/components/settings/SystemSettings.tsx +++ b/src/renderer/components/settings/SystemSettings.tsx @@ -1,6 +1,7 @@ import { type FC, useContext } from 'react'; import { DeviceDesktopIcon } from '@primer/octicons-react'; +import { Box, Stack, Text } from '@primer/react'; import { APPLICATION } from '../../../shared/constants'; import { isLinux, isMacOS } from '../../../shared/platform'; @@ -30,20 +31,20 @@ export const SystemSettings: FC = () => { }} /> updateSetting('keyboardShortcut', evt.target.checked) } tooltip={ -
+ When enabled you can use the hotkeys{' '} - + {Constants.DEFAULT_KEYBOARD_SHORTCUT} - {' '} + {' '} to show or hide {APPLICATION.NAME}. -
+ } /> {isMacOS() && ( @@ -78,21 +79,21 @@ export const SystemSettings: FC = () => { updateSetting('useAlternateIdleIcon', evt.target.checked) } tooltip={ -
-
+ + Use a white {APPLICATION.NAME} logo (instead of the default black logo) when all notifications are read. -
-
+ + This is particularly useful for devices which have a dark-themed menubar or taskbar. -
-
+ + } /> {!isLinux() && ( updateSetting('openAtStartup', evt.target.checked)} diff --git a/src/renderer/routes/Accounts.tsx b/src/renderer/routes/Accounts.tsx index cf22e5e31..3138e59cf 100644 --- a/src/renderer/routes/Accounts.tsx +++ b/src/renderer/routes/Accounts.tsx @@ -15,9 +15,11 @@ import { import { ActionList, ActionMenu, + Box, Button, IconButton, Stack, + Text, } from '@primer/react'; import { logError } from '../../shared/logger'; @@ -90,7 +92,7 @@ export const AccountsRoute: FC = () => { const [isRefreshingAccount, setIsRefreshingAccount] = useState(false); return ( -
@@ -100,23 +102,22 @@ export const AccountsRoute: FC = () => { align="center" justify="space-between" > - -
- -
+ + -
+ @@ -141,7 +142,7 @@ export const AccountsRoute: FC = () => { align="center" > - {account.hostname} + {account.hostname} @@ -157,11 +158,11 @@ export const AccountsRoute: FC = () => { align="center" > - {account.method} + {account.method} -
+
@@ -220,7 +221,7 @@ export const AccountsRoute: FC = () => { />
-
+ ); })} diff --git a/src/renderer/routes/Filters.tsx b/src/renderer/routes/Filters.tsx index 9996608f3..10b30af9b 100644 --- a/src/renderer/routes/Filters.tsx +++ b/src/renderer/routes/Filters.tsx @@ -6,7 +6,7 @@ import { FilterRemoveIcon, NoteIcon, } from '@primer/octicons-react'; -import { Button, Tooltip } from '@primer/react'; +import { Button, Text, Tooltip } from '@primer/react'; import { Checkbox } from '../components/fields/Checkbox'; import { Contents } from '../components/layout/Contents'; @@ -72,9 +72,9 @@ export const FiltersRoute: FC = () => {
Reason - + Note: If no reasons are selected, all notifications will be shown. - + {Object.keys(FORMATTED_REASONS).map((reason: Reason) => { return (
-
-
- -
+ +
Mona Lisa Octocat @@ -232,7 +228,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> github.com @@ -269,7 +265,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> Personal Access Token @@ -449,7 +445,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA
-
-
- -
+ +
Mona Lisa Octocat @@ -596,7 +588,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> github.gitify.io @@ -633,7 +625,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> OAuth App @@ -813,7 +805,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA
-
-
- -
+ +
Mona Lisa Octocat @@ -960,7 +948,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> github.com @@ -997,7 +985,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA /> GitHub App @@ -1324,7 +1312,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as class="Box-sc-g0xbh4-0 grow overflow-x-auto px-8 pb-2 mb-12 " >
-
-
- -
+ +
Mona Lisa Octocat @@ -1471,7 +1455,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> github.com @@ -1508,7 +1492,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> Personal Access Token @@ -1688,7 +1672,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as
-
-
- -
+ +
Mona Lisa Octocat @@ -1835,7 +1815,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> github.gitify.io @@ -1872,7 +1852,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> OAuth App @@ -2052,7 +2032,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as
-
-
- -
+ +
Mona Lisa Octocat @@ -2199,7 +2175,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> github.com @@ -2236,7 +2212,7 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as /> GitHub App @@ -2563,7 +2539,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre class="Box-sc-g0xbh4-0 grow overflow-x-auto px-8 pb-2 mb-12 " >
-
-
- -
+ +
Mona Lisa Octocat @@ -2710,7 +2682,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> github.com @@ -2747,7 +2719,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> Personal Access Token @@ -2927,7 +2899,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre
-
-
- -
+ +
Mona Lisa Octocat @@ -3074,7 +3042,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> github.gitify.io @@ -3111,7 +3079,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> OAuth App @@ -3291,7 +3259,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre
-
-
- -
+ +
Mona Lisa Octocat @@ -3438,7 +3402,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> github.com @@ -3475,7 +3439,7 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre /> GitHub App diff --git a/src/renderer/routes/__snapshots__/Filters.test.tsx.snap b/src/renderer/routes/__snapshots__/Filters.test.tsx.snap index c79e05f1d..833646884 100644 --- a/src/renderer/routes/__snapshots__/Filters.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Filters.test.tsx.snap @@ -130,6 +130,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -142,9 +143,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Hide notifications from Bot accounts - - +
@@ -206,11 +208,11 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children
- Note: If no reasons are selected, all notifications will be shown. - +
@@ -219,6 +221,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -231,9 +234,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Approval Requested - - +
@@ -264,6 +268,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -276,9 +281,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Assigned - - +
@@ -309,6 +315,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -321,9 +328,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Authored - - +
@@ -354,6 +362,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -366,9 +375,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Workflow Run Completed - - +
@@ -399,6 +409,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -411,9 +422,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Commented - - +
@@ -444,6 +456,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -456,9 +469,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Invitation Received - - +
@@ -489,6 +503,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -501,9 +516,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Updated - - +
@@ -534,6 +550,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -546,9 +563,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Member Feature Requested - - +
@@ -579,6 +597,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -591,9 +610,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Mentioned - - +
@@ -624,6 +644,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -636,9 +657,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Review Requested - - +
@@ -669,6 +691,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -681,9 +704,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Security Advisory Credit Received - - +
@@ -714,6 +738,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -726,9 +751,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Security Alert Received - - +
@@ -759,6 +785,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -771,9 +798,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > State Changed - - +
@@ -804,6 +832,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -816,9 +845,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Updated - - +
@@ -849,6 +879,7 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > @@ -861,9 +892,10 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children > Team Mentioned - - +
@@ -962,6 +994,7 @@ exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle re > @@ -974,9 +1007,10 @@ exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle re > Mentioned - - +
@@ -1010,6 +1044,7 @@ exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle re > @@ -1022,9 +1057,10 @@ exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle re > Mentioned - - +
@@ -1058,6 +1094,7 @@ exports[`renderer/routes/Filters.tsx Users section should be able to toggle the > @@ -1070,9 +1107,10 @@ exports[`renderer/routes/Filters.tsx Users section should be able to toggle the > Hide notifications from Bot accounts - - +
@@ -1106,6 +1144,7 @@ exports[`renderer/routes/Filters.tsx Users section should not be able to toggle > Hide notifications from Bot accounts - - +
diff --git a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap index 522d6cdaf..e94ffed2a 100644 --- a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap @@ -360,6 +360,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -372,9 +373,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Detailed notifications - - +
@@ -406,6 +408,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -418,9 +421,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Show notification metric pills - - +
@@ -452,6 +456,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -464,9 +469,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Show number - - +
@@ -498,6 +504,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -588,14 +596,15 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -611,6 +620,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -623,9 +633,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Fetch all notifications - - +
@@ -656,6 +667,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -668,9 +680,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Show only participating - - +
@@ -701,6 +714,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -713,9 +727,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Mark as done on open - - +
@@ -746,6 +761,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -758,9 +774,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Mark as done on unsubscribe - - +
@@ -791,6 +808,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -803,9 +821,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Delay notification state - - +
@@ -885,14 +904,15 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -902,14 +922,15 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -925,7 +946,8 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] =
- - +
@@ -971,6 +994,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -995,6 +1019,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -1019,6 +1044,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = @@ -1042,6 +1068,7 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > @@ -1054,9 +1081,10 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = > Use alternate idle icon - - +
@@ -1087,7 +1115,8 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] = >
From 3a0d88ac91c854104178941deb0f9817d8b4b6d5 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 25 Jan 2025 10:45:34 -0500 Subject: [PATCH 3/4] refactor: notification row layouts Signed-off-by: Adam Setch --- src/renderer/App.tsx | 6 +- src/renderer/components/fields/Checkbox.tsx | 58 +- src/renderer/components/fields/RadioGroup.tsx | 59 +- .../__snapshots__/Checkbox.test.tsx.snap | 78 +- .../__snapshots__/RadioGroup.test.tsx.snap | 304 +- src/renderer/components/primitives/Title.tsx | 22 +- .../__snapshots__/Header.test.tsx.snap | 124 +- .../__snapshots__/Title.test.tsx.snap | 124 +- .../settings/AppearanceSettings.tsx | 386 +-- .../settings/NotificationSettings.tsx | 193 +- .../components/settings/SystemSettings.tsx | 155 +- src/renderer/routes/Accounts.tsx | 4 +- src/renderer/routes/Filters.tsx | 57 +- src/renderer/routes/Settings.tsx | 4 +- .../__snapshots__/Accounts.test.tsx.snap | 222 +- .../__snapshots__/Filters.test.tsx.snap | 2845 ++++++++++++----- .../LoginWithOAuthApp.test.tsx.snap | 124 +- ...LoginWithPersonalAccessToken.test.tsx.snap | 124 +- .../__snapshots__/Settings.test.tsx.snap | 1496 ++++----- 19 files changed, 3972 insertions(+), 2413 deletions(-) diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index cc4bdee3a..eda622c32 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -7,7 +7,7 @@ import { useLocation, } from 'react-router-dom'; -import { BaseStyles, ThemeProvider } from '@primer/react'; +import { BaseStyles, Box, ThemeProvider } from '@primer/react'; import { Loading } from './components/Loading'; import { Sidebar } from './components/Sidebar'; @@ -47,7 +47,7 @@ export const App = () => { -
+ @@ -93,7 +93,7 @@ export const App = () => { element={} /> -
+
diff --git a/src/renderer/components/fields/Checkbox.tsx b/src/renderer/components/fields/Checkbox.tsx index 264afeba7..4a0fd8581 100644 --- a/src/renderer/components/fields/Checkbox.tsx +++ b/src/renderer/components/fields/Checkbox.tsx @@ -1,4 +1,7 @@ import type { FC, ReactNode } from 'react'; + +import { Stack } from '@primer/react'; + import { cn } from '../../utils/cn'; import { Tooltip } from './Tooltip'; @@ -13,33 +16,34 @@ export interface ICheckbox { export const Checkbox: FC = (props: ICheckbox) => { return ( -
-
- + + -
- - {props.tooltip && ( - - )} -
-
-
+ + {props.tooltip && ( + + )} + ); }; diff --git a/src/renderer/components/fields/RadioGroup.tsx b/src/renderer/components/fields/RadioGroup.tsx index 4c5fbe143..d395edeb4 100644 --- a/src/renderer/components/fields/RadioGroup.tsx +++ b/src/renderer/components/fields/RadioGroup.tsx @@ -1,4 +1,7 @@ import type { ChangeEvent, FC } from 'react'; + +import { Stack } from '@primer/react'; + import type { RadioGroupItem } from '../../types'; import { FieldLabel } from './FieldLabel'; @@ -12,34 +15,38 @@ export interface IRadioGroup { export const RadioGroup: FC = (props: IRadioGroup) => { return ( -
+ -
- {props.options.map((item) => { - const name = `radio-${props.name}-${item.value}`.toLowerCase(); + {props.options.map((item) => { + const name = `radio-${props.name}-${item.value}`.toLowerCase(); - return ( -
- - -
- ); - })} -
-
+ return ( + + + + + ); + })} + ); }; diff --git a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap index 748f774a7..9f0e78ed3 100644 --- a/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/Checkbox.test.tsx.snap @@ -6,38 +6,13 @@ exports[`renderer/components/fields/Checkbox.tsx should render 1`] = ` "baseElement":
-
- -
- -
-
-
-
- , - "container":
-
-
-
- -
+ Appearance +
+ , + "container":
+
+ + +
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap b/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap index a9e3e3979..519825efd 100644 --- a/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap +++ b/src/renderer/components/fields/__snapshots__/RadioGroup.test.tsx.snap @@ -6,7 +6,13 @@ exports[`renderer/components/fields/RadioGroup.tsx should render 1`] = ` "baseElement":
-
- , - "container":
-
- -
-
+ , + "container":
+
+ +
+ + +
+
+ + +
+
, "debug": [Function], "findAllByAltText": [Function], @@ -175,7 +199,13 @@ exports[`renderer/components/fields/RadioGroup.tsx should render as disabled 1`] "baseElement":
-
- , - "container":
-
- -
-
+ , + "container":
+
+ +
+ + +
+
+ + +
+
, "debug": [Function], "findAllByAltText": [Function], diff --git a/src/renderer/components/primitives/Title.tsx b/src/renderer/components/primitives/Title.tsx index 953ef596f..acaa79686 100644 --- a/src/renderer/components/primitives/Title.tsx +++ b/src/renderer/components/primitives/Title.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import type { Icon } from '@primer/octicons-react'; -import { Heading, Stack } from '@primer/react'; +import { Box, Heading, Stack } from '@primer/react'; interface ITitle { icon: Icon; @@ -12,15 +12,17 @@ interface ITitle { export const Title: FC = ({ size = 2, ...props }) => { return ( - - - {props.children} - + + + + {props.children} + + ); }; diff --git a/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap index f05169e64..7008c4ec5 100644 --- a/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Header.test.tsx.snap @@ -46,37 +46,41 @@ exports[`renderer/components/primitives/Header.tsx should render itself & its ch
- -

- Test Header -

+ +

+ Test Header +

+
@@ -125,37 +129,41 @@ exports[`renderer/components/primitives/Header.tsx should render itself & its ch
- -

- Test Header -

+ +

+ Test Header +

+
diff --git a/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap b/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap index c0c5afa98..deb9cc972 100644 --- a/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap +++ b/src/renderer/components/primitives/__snapshots__/Title.test.tsx.snap @@ -4,37 +4,41 @@ exports[`renderer/routes/components/primitives/Title.tsx should render the title
- -

- Legend -

+ +

+ Legend +

+
@@ -44,37 +48,41 @@ exports[`renderer/routes/components/primitives/Title.tsx should render the title
- -

- Legend -

+ +

+ Legend +

+
diff --git a/src/renderer/components/settings/AppearanceSettings.tsx b/src/renderer/components/settings/AppearanceSettings.tsx index 6b6e506fa..17ec47bbe 100644 --- a/src/renderer/components/settings/AppearanceSettings.tsx +++ b/src/renderer/components/settings/AppearanceSettings.tsx @@ -14,6 +14,7 @@ import { XCircleIcon, } from '@primer/octicons-react'; import { + Box, Button, ButtonGroup, IconButton, @@ -78,199 +79,218 @@ export const AppearanceSettings: FC = () => {
Appearance -
- - - -
- -
- - - - - zoomPercentage > 0 && - webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage - 10)) + + + - + + - - zoomPercentage < 120 && - webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage + 10)) - } - data-testid="settings-zoom-in" - /> + + + zoomPercentage > 0 && + webFrame.setZoomLevel( + zoomPercentageToLevel(zoomPercentage - 10), + ) + } + data-testid="settings-zoom-out" + /> - webFrame.setZoomLevel(0)} - data-testid="settings-zoom-reset" - /> - -
+ - - updateSetting('detailedNotifications', evt.target.checked) - } - tooltip={ - - - Enrich notifications with author or last commenter profile - information, state and GitHub-like colors. - - - ⚠️ Users with a large number of unread notifications may{' '} - experience rate limiting under certain circumstances. Disable this - setting if you experience this. - - - } - /> + + zoomPercentage < 120 && + webFrame.setZoomLevel( + zoomPercentageToLevel(zoomPercentage + 10), + ) + } + data-testid="settings-zoom-in" + /> - updateSetting('showPills', evt.target.checked)} - tooltip={ -
-
Show notification metric pills for:
-
-
    -
  • - - linked issues -
  • -
  • - - pr reviews -
  • -
  • - - comments -
  • -
  • - - labels -
  • -
  • - - milestones -
  • -
-
-
- } - /> + webFrame.setZoomLevel(0)} + data-testid="settings-zoom-reset" + /> + + - - settings.detailedNotifications && - updateSetting('showNumber', evt.target.checked) - } - disabled={!settings.detailedNotifications} - tooltip={ - -
Show GitHub number for:
-
-
    -
  • - - - Discussion - -
  • -
  • - + + updateSetting('detailedNotifications', evt.target.checked) + } + tooltip={ + + + Enrich notifications with author or last commenter profile + information, state and GitHub-like colors. + + + ⚠️ Users with a large number of unread notifications may{' '} + experience rate limiting under certain circumstances. Disable + this setting if you experience this. + + + } + /> + + updateSetting('showPills', evt.target.checked)} + tooltip={ + + Show notification metric pills for: + +
      +
    • - Issue - -
    • -
    • - - - Pull Request - -
    • -
    -
- - ⚠️ This setting requires{' '} - Detailed Notifications to be enabled. - -
- } - /> + linked issues + +
  • + + pr reviews +
  • +
  • + + comments +
  • +
  • + + labels +
  • +
  • + + milestones +
  • + + + + } + /> - - updateSetting('showAccountHeader', evt.target.checked) - } - /> + + settings.detailedNotifications && + updateSetting('showNumber', evt.target.checked) + } + disabled={!settings.detailedNotifications} + tooltip={ + + Show GitHub number for: + +
      +
    • + + + Discussion + +
    • +
    • + + + Issue + +
    • +
    • + + + Pull Request + +
    • +
    +
    + + ⚠️ This setting requires{' '} + Detailed Notifications to be enabled. + +
    + } + /> + + + updateSetting('showAccountHeader', evt.target.checked) + } + /> +
    ); }; diff --git a/src/renderer/components/settings/NotificationSettings.tsx b/src/renderer/components/settings/NotificationSettings.tsx index 181aa71e4..3a67853ab 100644 --- a/src/renderer/components/settings/NotificationSettings.tsx +++ b/src/renderer/components/settings/NotificationSettings.tsx @@ -17,105 +17,108 @@ export const NotificationSettings: FC = () => { return (
    Notifications - { - updateSetting('groupBy', evt.target.value as GroupBy); - }} - /> - - updateSetting('fetchAllNotifications', evt.target.checked) - } - tooltip={ - + + + { + updateSetting('groupBy', evt.target.value as GroupBy); + }} + /> + + updateSetting('fetchAllNotifications', evt.target.checked) + } + tooltip={ + + + When checked, Gitify will fetch{' '} + all notifications from your inbox. + + + When unchecked, Gitify will only fetch the + first page of notifications (max 50 records per GitHub account) + + + } + /> + updateSetting('participating', evt.target.checked)} + tooltip={ + + See{' '} + {' '} + for more details. + + } + /> + + updateSetting('markAsDoneOnOpen', evt.target.checked) + } + tooltip={ + + Mark as done feature is supported in + GitHub Cloud and GitHub Enterprise Server 3.13 or later. + + } + /> + + updateSetting('markAsDoneOnUnsubscribe', evt.target.checked) + } + tooltip={ - When checked, Gitify will fetch{' '} - all notifications from your inbox. + Mark as done feature is supported in + GitHub Cloud and GitHub Enterprise Server 3.13 or later. + } + /> + + updateSetting('delayNotificationState', evt.target.checked) + } + tooltip={ - When unchecked, Gitify will only fetch the - first page of notifications (max 50 records per GitHub account) + Keep the notification within {APPLICATION.NAME} upon interaction + (ie: open notification, mark as read, mark as done) until the next + refresh window (scheduled or user initiated). - - } - /> - updateSetting('participating', evt.target.checked)} - tooltip={ - - See{' '} - {' '} - for more details. - - } - /> - - updateSetting('markAsDoneOnOpen', evt.target.checked) - } - tooltip={ -
    - Mark as done feature is supported in GitHub Cloud - and GitHub Enterprise Server 3.13 or later. -
    - } - /> - - updateSetting('markAsDoneOnUnsubscribe', evt.target.checked) - } - tooltip={ -
    - Mark as done feature is supported in GitHub Cloud - and GitHub Enterprise Server 3.13 or later. -
    - } - /> - - updateSetting('delayNotificationState', evt.target.checked) - } - tooltip={ -
    - Keep the notification within {APPLICATION.NAME} upon interaction - (ie: open notification, mark as read, mark as done) until the next - refresh window (scheduled or user initiated). -
    - } - /> + } + /> +
    ); }; diff --git a/src/renderer/components/settings/SystemSettings.tsx b/src/renderer/components/settings/SystemSettings.tsx index 2f9b3b059..91f3e5f42 100644 --- a/src/renderer/components/settings/SystemSettings.tsx +++ b/src/renderer/components/settings/SystemSettings.tsx @@ -18,87 +18,92 @@ export const SystemSettings: FC = () => { return (
    System - { - updateSetting('openLinks', evt.target.value as OpenPreference); - }} - /> - - updateSetting('keyboardShortcut', evt.target.checked) - } - tooltip={ - - When enabled you can use the hotkeys{' '} - - {Constants.DEFAULT_KEYBOARD_SHORTCUT} - {' '} - to show or hide {APPLICATION.NAME}. - - } - /> - {isMacOS() && ( + + + { + updateSetting('openLinks', evt.target.value as OpenPreference); + }} + /> + + updateSetting('keyboardShortcut', evt.target.checked) + } + tooltip={ + + When enabled you can use the hotkeys{' '} + + {Constants.DEFAULT_KEYBOARD_SHORTCUT} + {' '} + to show or hide {APPLICATION.NAME}. + + } + /> + {isMacOS() && ( + + updateSetting('showNotificationsCountInTray', evt.target.checked) + } + /> + )} - updateSetting('showNotificationsCountInTray', evt.target.checked) + updateSetting('showNotifications', evt.target.checked) } /> - )} - - updateSetting('showNotifications', evt.target.checked) - } - /> - updateSetting('playSound', evt.target.checked)} - /> - - updateSetting('useAlternateIdleIcon', evt.target.checked) - } - tooltip={ - - - Use a white {APPLICATION.NAME} logo (instead of the default black - logo) when all notifications are read. - - - This is particularly useful for devices which have a dark-themed - menubar or taskbar. - - - } - /> - {!isLinux() && ( updateSetting('openAtStartup', evt.target.checked)} + name="playSound" + label="Play sound" + checked={settings.playSound} + onChange={(evt) => updateSetting('playSound', evt.target.checked)} + /> + + updateSetting('useAlternateIdleIcon', evt.target.checked) + } + tooltip={ + + + Use a white {APPLICATION.NAME} logo (instead of the default + black logo) when all notifications are read. + + + This is particularly useful for devices which have a dark-themed + menubar or taskbar. + + + } /> - )} + {!isLinux() && ( + + updateSetting('openAtStartup', evt.target.checked) + } + /> + )} +
    ); }; diff --git a/src/renderer/routes/Accounts.tsx b/src/renderer/routes/Accounts.tsx index 3138e59cf..50d542851 100644 --- a/src/renderer/routes/Accounts.tsx +++ b/src/renderer/routes/Accounts.tsx @@ -119,7 +119,7 @@ export const AccountsRoute: FC = () => { - +
    - -

    - Accounts -

    + +

    + Accounts +

    +
    @@ -164,7 +168,9 @@ exports[`renderer/routes/Accounts.tsx Account interactions should render with PA data-padding="none" data-wrap="nowrap" > -
    +
    -
    +
    -
    +
    - -

    - Accounts -

    + +

    + Accounts +

    +
    @@ -1391,7 +1405,9 @@ exports[`renderer/routes/Accounts.tsx Account interactions should set account as data-padding="none" data-wrap="nowrap" > -
    +
    -
    +
    -
    +
    - -

    - Accounts -

    + +

    + Accounts +

    +
    @@ -2618,7 +2642,9 @@ exports[`renderer/routes/Accounts.tsx General should render itself & its childre data-padding="none" data-wrap="nowrap" > -
    +
    -
    +
    -
    +
    - -

    - Filters -

    + +

    + Filters +

    +
    @@ -89,18 +93,73 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children >
    +
    + +

    + Users +

    +
    +
    +
    +
    + + +
    -

    - Users -

    - -
    +
    + +
    +
    -
    - -
    + +

    - -

    + Reason +
    +
    +
    + + Note: If no reasons are selected, all notifications will be shown. +
    -
    -
    - +
    - -

    - Reason -

    -
    - - - Note: If no reasons are selected, all notifications will be shown. - -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    - + +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    -
    -
    +
    - - + +
    -
    -
    +
    - -
    - -
    + +
    @@ -987,135 +981,1402 @@ exports[`renderer/routes/Filters.tsx General should render itself & its children exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle reason type - none already set 1`] = `
    +
    - -
    - -
    + +
    -
    -`; - -exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle reason type - some filters already set 1`] = ` -
    +
    - - + + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    +
    `; -exports[`renderer/routes/Filters.tsx Users section should be able to toggle the hideBots checkbox when detailedNotifications is enabled 1`] = ` +exports[`renderer/routes/Filters.tsx Reasons section should be able to toggle reason type - some filters already set 1`] = `
    + +
    + +
    +
    +
    + +
    - + + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    + +
    +
    +
    +`; + +exports[`renderer/routes/Filters.tsx Users section should be able to toggle the hideBots checkbox when detailedNotifications is enabled 1`] = ` +
    + +
    +

    + Users +

    -
    -
    -`; - -exports[`renderer/routes/Filters.tsx Users section should not be able to toggle the hideBots checkbox when detailedNotifications is disabled 1`] = ` -
    +
    +
    - + + +
    +
    + +`; + +exports[`renderer/routes/Filters.tsx Users section should not be able to toggle the hideBots checkbox when detailedNotifications is disabled 1`] = ` +
    + +
    +

    + Users +

    +
    +
    + + +
    + +
    -
    + `; diff --git a/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap b/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap index fc2649e45..59d63d833 100644 --- a/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap @@ -50,37 +50,41 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
    - -

    - Login with OAuth App -

    + +

    + Login with OAuth App +

    +
    @@ -521,37 +525,41 @@ exports[`renderer/routes/LoginWithOAuthApp.tsx renders correctly 1`] = `
    - -

    - Login with OAuth App -

    + +

    + Login with OAuth App +

    +
    diff --git a/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap b/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap index b241a5142..cd87a5094 100644 --- a/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap @@ -50,37 +50,41 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`]
    - -

    - Login with Personal Access Token -

    + +

    + Login with Personal Access Token +

    +
    @@ -498,37 +502,41 @@ exports[`renderer/routes/LoginWithPersonalAccessToken.tsx renders correctly 1`]
    - -

    - Login with Personal Access Token -

    + +

    + Login with Personal Access Token +

    +
    diff --git a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap index e94ffed2a..843d8055d 100644 --- a/src/renderer/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/renderer/routes/__snapshots__/Settings.test.tsx.snap @@ -46,55 +46,8 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] =
    - -

    - Settings -

    -
    -
    -
    -
    -
    -
    -
    -

    - Appearance + Settings

    -
    -
    - - - - -
    -
    - + +
    +
    +
    +
    +
    +
    - - -
    +
    + +
    +
    +
    -
    -
    - +
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - -
    - -
    +
    +
    -
    -
    +
    - + +
    -
    - -
    -
    - +
    + +
    +
    +
    + + +
    + +
    +
    +
    + + +
    +
    + +
    + +
    +
    + +

    + Notifications +

    +
    +
    -
    +
    -
    -
    +
    - - + +
    -
    -
    +
    - - + +
    -
    -
    +
    - - + +
    -
    -
    +
    - - + +
    -
    -
    +
    - - + +
    @@ -851,55 +889,75 @@ exports[`renderer/routes/Settings.tsx should render itself & its children 1`] =
    - -

    - System -

    + +

    + System +

    +
    -
    +
    -
    -
    +
    - - + +
    -
    -
    -
    - -
    + Show notifications count in tray +
    -
    -
    -
    - -
    + Show system notifications +
    -
    -
    -
    - -
    + Play sound +
    -
    -
    +
    - - + +
    -
    -
    -
    - -
    + Open at startup +
    From 0c4fab8b1f106e50b720d122e3e79ef666886114 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 25 Jan 2025 10:49:54 -0500 Subject: [PATCH 4/4] add todos for future us Signed-off-by: Adam Setch --- src/renderer/components/avatars/AvatarWithFallback.tsx | 2 ++ src/renderer/utils/theme.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/renderer/components/avatars/AvatarWithFallback.tsx b/src/renderer/components/avatars/AvatarWithFallback.tsx index 693928074..a2f6149a3 100644 --- a/src/renderer/components/avatars/AvatarWithFallback.tsx +++ b/src/renderer/components/avatars/AvatarWithFallback.tsx @@ -26,6 +26,8 @@ export const AvatarWithFallback: React.FC = ({ const [isBroken, setIsBroken] = useState(false); const isNonHuman = isNonHumanUser(userType); + + // TODO explore using AnchoredOverlay component (https://primer.style/components/anchored-overlay/react/alpha) to render Avatar Card on hover return (