From fb47d7346663f2f917176a4e302328d7e933847e Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 17 Sep 2024 17:28:19 -0400 Subject: [PATCH 1/2] refactor: revert sidebar button size Signed-off-by: Adam Setch --- src/components/Sidebar.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index c200bc0b..0d58ddc9 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -184,7 +184,11 @@ export const Sidebar: FC = () => { title="Refresh notifications" isTooltipDisabled={false} icon={(iconProps) => ( - + )} appearance="subtle" shape="circle" @@ -198,7 +202,7 @@ export const Sidebar: FC = () => { icon={(iconProps) => ( )} From cff888938c55f0f0891c7cb557523f8bff0bf96c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 17 Sep 2024 22:30:00 -0400 Subject: [PATCH 2/2] feat: improve tooltip positions Signed-off-by: Adam Setch --- src/components/AccountNotifications.tsx | 94 +- src/components/NotificationRow.tsx | 36 +- src/components/ProductNotifications.tsx | 68 +- src/components/Sidebar.tsx | 164 +- .../AccountNotifications.test.tsx.snap | 1776 +++++++++-------- .../NotificationRow.test.tsx.snap | 272 +-- .../ProductNotifications.test.tsx.snap | 244 +-- .../__snapshots__/Sidebar.test.tsx.snap | 636 +++--- src/components/settings/SettingsFooter.tsx | 39 +- .../__snapshots__/Settings.test.tsx.snap | 164 +- 10 files changed, 1844 insertions(+), 1649 deletions(-) diff --git a/src/components/AccountNotifications.tsx b/src/components/AccountNotifications.tsx index 133335a1..c12e0029 100644 --- a/src/components/AccountNotifications.tsx +++ b/src/components/AccountNotifications.tsx @@ -86,7 +86,7 @@ export const AccountNotifications: FC = ( > - + = ( - ( - - )} - shape="circle" - spacing="compact" - appearance="subtle" - onClick={(event: MouseEvent) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - openMyPullRequests(); - }} - /> - - ( - - )} - shape="circle" - spacing="compact" - appearance="subtle" - onClick={(event: MouseEvent) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - markNotificationsAsRead(account, accountNotificationIDs); - }} - /> - - + + ( + + )} + shape="circle" + spacing="compact" + appearance="subtle" + onClick={(event: MouseEvent) => { + // Don't trigger onClick of parent element. + event.stopPropagation(); + openMyPullRequests(); + }} + /> + + + + ( + + )} + shape="circle" + spacing="compact" + appearance="subtle" + onClick={(event: MouseEvent) => { + // Don't trigger onClick of parent element. + event.stopPropagation(); + markNotificationsAsRead(account, accountNotificationIDs); + }} + /> + + + + + diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index f4a9ee45..913ec797 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -62,14 +62,14 @@ export const NotificationRow: FC = ({ >
- + - + @@ -123,21 +123,23 @@ export const NotificationRow: FC = ({ {!animateExit && !isRead && notification.unread && ( - ( - - )} - shape="circle" - spacing="compact" - appearance="subtle" - onClick={() => { - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationRead(notification); - }} - /> + + ( + + )} + shape="circle" + spacing="compact" + appearance="subtle" + onClick={() => { + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationRead(notification); + }} + /> + )}
diff --git a/src/components/ProductNotifications.tsx b/src/components/ProductNotifications.tsx index e0e92bfb..966040bd 100644 --- a/src/components/ProductNotifications.tsx +++ b/src/components/ProductNotifications.tsx @@ -7,6 +7,7 @@ import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right'; import HipchatMediaAttachmentCountIcon from '@atlaskit/icon/glyph/hipchat/media-attachment-count'; import { Box, Flex, Inline, Stack } from '@atlaskit/primitives'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; import type { AtlasifyNotification } from '../types'; import { markNotificationsAsRead } from '../utils/api/client'; @@ -75,35 +76,46 @@ export const ProductNotifications: FC = ({ - ( - - )} - shape="circle" - spacing="compact" - appearance="subtle" - onClick={(event: MouseEvent) => { - // Don't trigger onClick of parent element. - event.stopPropagation(); - setAnimateExit(!settings.delayNotificationState); - setShowAsRead(settings.delayNotificationState); - markNotificationsAsRead( - productNotifications[0].account, - productNotificationIDs, - ); - }} - /> + + ( + + )} + shape="circle" + spacing="compact" + appearance="subtle" + onClick={(event: MouseEvent) => { + // Don't trigger onClick of parent element. + event.stopPropagation(); + setAnimateExit(!settings.delayNotificationState); + setShowAsRead(settings.delayNotificationState); + markNotificationsAsRead( + productNotifications[0].account, + productNotificationIDs, + ); + }} + /> + - + + + diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 0d58ddc9..b3e98842 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -71,21 +71,25 @@ export const Sidebar: FC = () => {
- ( - - )} - shape="circle" - onClick={() => navigate('/', { replace: true })} - /> + + ( + + )} + shape="circle" + onClick={() => navigate('/', { replace: true })} + /> +
- +
diff --git a/src/components/__snapshots__/AccountNotifications.test.tsx.snap b/src/components/__snapshots__/AccountNotifications.test.tsx.snap index ac107ec2..7faf8ba5 100644 --- a/src/components/__snapshots__/AccountNotifications.test.tsx.snap +++ b/src/components/__snapshots__/AccountNotifications.test.tsx.snap @@ -25,7 +25,7 @@ exports[`components/AccountNotifications.tsx should render itself - account erro type="button" >
@@ -43,7 +43,7 @@ exports[`components/AccountNotifications.tsx should render itself - account erro @@ -76,113 +76,122 @@ exports[`components/AccountNotifications.tsx should render itself - account erro
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - No notifications for account + + + + + + No notifications for account + - - + +
@@ -236,7 +245,7 @@ exports[`components/AccountNotifications.tsx should render itself - account erro type="button" >
@@ -254,7 +263,7 @@ exports[`components/AccountNotifications.tsx should render itself - account erro @@ -287,113 +296,122 @@ exports[`components/AccountNotifications.tsx should render itself - account erro
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - No notifications for account + + + + + + No notifications for account + - - + +
@@ -504,7 +522,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi type="button" >
@@ -522,7 +540,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -555,113 +573,122 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - Hide account notifications + + + + + + Hide account notifications + - - + +
@@ -679,7 +706,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi role="presentation" >
@@ -697,7 +724,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -751,7 +778,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -769,7 +796,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -810,42 +837,46 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- + +
@@ -880,7 +911,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -934,7 +965,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -952,7 +983,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -993,42 +1024,46 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- + +
@@ -1055,7 +1090,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi type="button" >
@@ -1073,7 +1108,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -1106,113 +1141,122 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - Hide account notifications + + + + + + Hide account notifications + - - + +
@@ -1230,7 +1274,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi role="presentation" >
@@ -1248,7 +1292,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -1302,7 +1346,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -1320,7 +1364,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -1361,42 +1405,46 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- + +
@@ -1431,7 +1479,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -1485,7 +1533,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -1503,7 +1551,7 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi @@ -1544,42 +1592,46 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- + +
@@ -1714,113 +1766,122 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - Hide account notifications + + + + + + Hide account notifications + - - + +
@@ -1902,113 +1963,122 @@ exports[`components/AccountNotifications.tsx should render itself - group notifi
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - Hide account notifications + + + + + + Hide account notifications + - - + +
@@ -2096,7 +2166,7 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat type="button" >
@@ -2114,7 +2184,7 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat @@ -2147,113 +2217,122 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - No notifications for account + + + + + + No notifications for account + - - + +
@@ -2302,7 +2381,7 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat type="button" >
@@ -2320,7 +2399,7 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat @@ -2353,113 +2432,122 @@ exports[`components/AccountNotifications.tsx should render itself - no notificat
- -
+
- - - Mark all account notifications as read + + + + + + Mark all account notifications as read + - - -
+
- - - No notifications for account + + + + + + No notifications for account + - - + +
diff --git a/src/components/__snapshots__/NotificationRow.test.tsx.snap b/src/components/__snapshots__/NotificationRow.test.tsx.snap index 20fe3248..050036db 100644 --- a/src/components/__snapshots__/NotificationRow.test.tsx.snap +++ b/src/components/__snapshots__/NotificationRow.test.tsx.snap @@ -150,42 +150,46 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
@@ -336,42 +340,46 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
, @@ -448,7 +456,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr role="presentation" >
@@ -466,7 +474,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr @@ -520,7 +528,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -538,7 +546,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr @@ -579,42 +587,46 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
@@ -634,7 +646,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr role="presentation" >
@@ -652,7 +664,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr @@ -706,7 +718,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr class="flex flex-1 items-center gap-1 text-xs opacity-80" >
@@ -724,7 +736,7 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr @@ -765,42 +777,46 @@ exports[`components/NotificationRow.tsx should render itself & its children - gr
- + +
, diff --git a/src/components/__snapshots__/ProductNotifications.test.tsx.snap b/src/components/__snapshots__/ProductNotifications.test.tsx.snap index abe22edf..36c87b88 100644 --- a/src/components/__snapshots__/ProductNotifications.test.tsx.snap +++ b/src/components/__snapshots__/ProductNotifications.test.tsx.snap @@ -69,76 +69,82 @@ exports[`components/ProductNotifications.tsx should render itself & its children
- -
+
- - - Hide product notifications + + + + + + Hide product notifications + - - + +
@@ -216,76 +222,82 @@ exports[`components/ProductNotifications.tsx should render itself & its children
- -
+
- - - Hide product notifications + + + + + + Hide product notifications + - - + +
diff --git a/src/components/__snapshots__/Sidebar.test.tsx.snap b/src/components/__snapshots__/Sidebar.test.tsx.snap index 4d517073..5e80cbaf 100644 --- a/src/components/__snapshots__/Sidebar.test.tsx.snap +++ b/src/components/__snapshots__/Sidebar.test.tsx.snap @@ -14,54 +14,58 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)
- + +
- + +
@@ -173,54 +180,58 @@ exports[`components/Sidebar.tsx should render itself & its children (logged in)
- + +
- + +
, @@ -389,54 +403,58 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out)
- + +
- + +
@@ -548,54 +569,58 @@ exports[`components/Sidebar.tsx should render itself & its children (logged out)
- + +
- + +
, diff --git a/src/components/settings/SettingsFooter.tsx b/src/components/settings/SettingsFooter.tsx index f8302052..803ab8de 100644 --- a/src/components/settings/SettingsFooter.tsx +++ b/src/components/settings/SettingsFooter.tsx @@ -30,7 +30,7 @@ export const SettingsFooter: FC = () => { - + + - navigate('/accounts')} - /> - quitApp()} - /> + + navigate('/accounts')} + /> + + + quitApp()} + /> + diff --git a/src/routes/__snapshots__/Settings.test.tsx.snap b/src/routes/__snapshots__/Settings.test.tsx.snap index 07b5ed41..acb5d378 100644 --- a/src/routes/__snapshots__/Settings.test.tsx.snap +++ b/src/routes/__snapshots__/Settings.test.tsx.snap @@ -904,98 +904,106 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = `
- -
+
- - - Quit Atlasify + + + + + + + + + Quit Atlasify + - - + +