Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
":BLANK_LINE:",
":PACKAGE:",
":BLANK_LINE:",
"**/shared/**",
":BLANK_LINE:",
"**"
]
}
}
},
"useSortedAttributes": "on"
}
}
},
Expand All @@ -41,7 +44,12 @@
"useExhaustiveDependencies": {
"level": "warn",
"options": {
"hooks": [{ "name": "useNavigate", "stableResult": true }]
"hooks": [
{
"name": "useNavigate",
"stableResult": true
}
]
}
},
"useUniqueElementIds": "warn"
Expand Down
1 change: 1 addition & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { APPLICATION } from '../shared/constants';
import { namespacedEvent } from '../shared/events';
import { logInfo, logWarn } from '../shared/logger';
import { isLinux, isWindows } from '../shared/platform';

import { onFirstRunMaybe } from './first-run';
import { TrayIcons } from './icons';
import MenuBuilder from './menu';
Expand Down
1 change: 1 addition & 0 deletions src/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Menubar } from 'menubar';

import { APPLICATION } from '../shared/constants';
import { isMacOS, isWindows } from '../shared/platform';

import { openLogsDirectory, resetApp, takeScreenshot } from './utils';

export default class MenuBuilder {
Expand Down
1 change: 1 addition & 0 deletions src/main/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Menubar } from 'menubar';

import { APPLICATION } from '../shared/constants';
import { logError, logInfo } from '../shared/logger';

import type MenuBuilder from './menu';

/**
Expand Down
16 changes: 8 additions & 8 deletions src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function RequireAuth({ children }) {
return isLoggedIn ? (
children
) : (
<Navigate to="/login" replace state={{ from: location }} />
<Navigate replace state={{ from: location }} to="/login" />
);
}

Expand All @@ -41,45 +41,45 @@ export const App = () => {
<AppLayout>
<Routes>
<Route
path="/"
element={
<RequireAuth>
<NotificationsRoute />
</RequireAuth>
}
path="/"
/>
<Route
path="/filters"
element={
<RequireAuth>
<FiltersRoute />
</RequireAuth>
}
path="/filters"
/>
<Route
path="/settings"
element={
<RequireAuth>
<SettingsRoute />
</RequireAuth>
}
path="/settings"
/>
<Route
path="/accounts"
element={
<RequireAuth>
<AccountsRoute />
</RequireAuth>
}
path="/accounts"
/>
<Route path="/login" element={<LoginRoute />} />
<Route element={<LoginRoute />} path="/login" />
<Route
path="/login-personal-access-token"
element={<LoginWithPersonalAccessTokenRoute />}
path="/login-personal-access-token"
/>
<Route
path="/login-oauth-app"
element={<LoginWithOAuthAppRoute />}
path="/login-oauth-app"
/>
</Routes>
</AppLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/AllRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export const AllRead: FC<IAllRead> = ({ fullHeight = true }: IAllRead) => {
const heading = `No new ${hasFilters ? 'filtered ' : ''} notifications`;

return (
<EmojiSplash emoji={emoji} heading={heading} fullHeight={fullHeight} />
<EmojiSplash emoji={emoji} fullHeight={fullHeight} heading={heading} />
);
};
2 changes: 1 addition & 1 deletion src/renderer/components/Oops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const Oops: FC<IOops> = ({ error, fullHeight = true }: IOops) => {
return (
<EmojiSplash
emoji={emoji}
fullHeight={fullHeight}
heading={err.title}
subHeadings={err.descriptions}
fullHeight={fullHeight}
/>
);
};
103 changes: 52 additions & 51 deletions src/renderer/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { IconButton, Stack } from '@primer/react';

import { APPLICATION } from '../../shared/constants';

import { AppContext } from '../context/App';
import { quitApp } from '../utils/comms';
import { Constants } from '../utils/constants';
Expand Down Expand Up @@ -72,129 +73,129 @@ export const Sidebar: FC = () => {

return (
<Stack
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar text-white"
direction="vertical"
justify="space-between"
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar text-white"
>
<Stack
direction="vertical"
align="center"
direction="vertical"
gap="condensed"
padding="normal"
>
<IconButton
icon={LogoIcon}
aria-label={APPLICATION.NAME}
data-testid="sidebar-home"
description="Home"
unsafeDisableTooltip={false}
icon={LogoIcon}
onClick={() => navigate('/', { replace: true })}
size="small"
variant="invisible"
tooltipDirection="e"
onClick={() => navigate('/', { replace: true })}
data-testid="sidebar-home"
unsafeDisableTooltip={false}
variant="invisible"
/>

<IconButton
icon={BellIcon}
aria-label="Notifications"
data-testid="sidebar-notifications"
description={`${notificationsCount} unread notifications`}
unsafeDisableTooltip={false}
size="small"
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
tooltipDirection="e"
icon={BellIcon}
onClick={() => openGitHubNotifications(primaryAccountHostname)}
data-testid="sidebar-notifications"
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
/>

{isLoggedIn && (
<IconButton
icon={FilterIcon}
aria-label="Filters"
data-testid="sidebar-filter-notifications"
description="Filter notifications"
unsafeDisableTooltip={false}
size="small"
variant={hasAnyFiltersSet(settings) ? 'primary' : 'invisible'}
tooltipDirection="e"
icon={FilterIcon}
onClick={() => toggleFilters()}
data-testid="sidebar-filter-notifications"
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant={hasAnyFiltersSet(settings) ? 'primary' : 'invisible'}
/>
)}

<IconButton
icon={IssueOpenedIcon}
aria-label="My issues"
unsafeDisableTooltip={false}
size="small"
variant="invisible"
tooltipDirection="e"
onClick={() => openGitHubIssues(primaryAccountHostname)}
data-testid="sidebar-my-issues"
icon={IssueOpenedIcon}
onClick={() => openGitHubIssues(primaryAccountHostname)}
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant="invisible"
/>

<IconButton
icon={GitPullRequestIcon}
aria-label="My pull requests"
unsafeDisableTooltip={false}
size="small"
variant="invisible"
tooltipDirection="e"
onClick={() => openGitHubPulls(primaryAccountHostname)}
data-testid="sidebar-my-pull-requests"
icon={GitPullRequestIcon}
onClick={() => openGitHubPulls(primaryAccountHostname)}
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant="invisible"
/>
</Stack>

<Stack
direction="vertical"
align="center"
direction="vertical"
gap="condensed"
padding="normal"
>
{isLoggedIn && (
<>
<IconButton
icon={SyncIcon}
aria-label="Refresh"
data-testid="sidebar-refresh"
description="Refresh notifications"
unsafeDisableTooltip={false}
size="small"
variant="invisible"
tooltipDirection="e"
loading={status === 'loading'}
disabled={status === 'loading'}
icon={SyncIcon}
loading={status === 'loading'}
onClick={() => refreshNotifications()}
data-testid="sidebar-refresh"
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant="invisible"
/>

<IconButton
icon={GearIcon}
aria-label="Settings"
unsafeDisableTooltip={false}
size="small"
variant="invisible"
tooltipDirection="e"
onClick={() => toggleSettings()}
data-testid="sidebar-settings"
icon={GearIcon}
onClick={() => toggleSettings()}
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant="invisible"
/>
</>
)}

{!isLoggedIn && (
<IconButton
icon={XCircleIcon}
aria-label={`Quit ${APPLICATION.NAME}`}
unsafeDisableTooltip={false}
size="small"
variant="invisible"
tooltipDirection="e"
onClick={() => quitApp()}
data-testid="sidebar-quit"
icon={XCircleIcon}
onClick={() => quitApp()}
size="small"
sx={sidebarButtonStyle}
tooltipDirection="e"
unsafeDisableTooltip={false}
variant="invisible"
/>
)}
</Stack>
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/avatars/AvatarWithFallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ export const AvatarWithFallback: React.FC<IAvatarWithFallback> = ({
// TODO explore using AnchoredOverlay component (https://primer.style/components/anchored-overlay/react/alpha) to render Avatar Card on hover
return (
<Stack
direction="horizontal"
align="center"
gap="condensed"
data-testid="avatar"
direction="horizontal"
gap="condensed"
>
{!src || isBroken ? (
<DefaultUserIcon size={size} />
) : (
<Avatar
src={src}
alt={alt}
onError={() => setIsBroken(true)}
size={size}
square={isNonHuman}
onError={() => setIsBroken(true)}
src={src}
/>
)}
{name && (
<Truncate title={name} inline maxWidth={280}>
<Truncate inline maxWidth={280} title={name}>
{name}
</Truncate>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/fields/Checkbox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ describe('renderer/components/fields/Checkbox.tsx', () => {
});

it('should render - positive counter unselected', () => {
const tree = render(<Checkbox {...props} counter={5} checked={false} />);
const tree = render(<Checkbox {...props} checked={false} counter={5} />);
expect(tree).toMatchSnapshot();
});

it('should render - positive counter selected', () => {
const tree = render(<Checkbox {...props} counter={5} checked={true} />);
const tree = render(<Checkbox {...props} checked={true} counter={5} />);
expect(tree).toMatchSnapshot();
});

Expand Down
Loading
Loading