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
17 changes: 13 additions & 4 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
":BLANK_LINE:",
["**/constants", "**/constants/**"],
":BLANK_LINE:",
["**/context/**", "**/hooks/**", "**/routes/**"],
[
"**/context/**",
"**/hooks/**",
"**/routes/**",
"**/stores",
"**/stores/**"
],
":BLANK_LINE:",
[
"**/layout/**",
Expand All @@ -55,9 +61,6 @@
},
"rules": {
"recommended": true,
"a11y": {
"useKeyWithClickEvents": "off"
},
"correctness": {
"noUnusedFunctionParameters": "error",
"useExhaustiveDependencies": {
Expand Down Expand Up @@ -111,6 +114,12 @@
"tailwindDirectives": true
}
},
"html": {
"formatter": {
"enabled": true
},
"experimentalFullSupportEnabled": true
},
"javascript": {
"formatter": {
"quoteStyle": "single",
Expand Down
1 change: 0 additions & 1 deletion src/renderer/__helpers__/test-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { BaseStyles, ThemeProvider } from '@primer/react';
import { mockAuth, mockSettings } from '../__mocks__/state-mocks';

import { AppContext, type AppContextState } from '../context/App';

import { type FiltersStore, useFiltersStore } from '../stores';

export { navigateMock } from './vitest.setup';
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/AllRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { type FC, useMemo } from 'react';

import { Constants } from '../constants';

import { useFiltersStore } from '../stores';

import { EmojiSplash } from './layout/EmojiSplash';

import { useFiltersStore } from '../stores';
import { randomElement } from '../utils/core/random';

interface AllReadProps {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { APPLICATION } from '../../shared/constants';

import { useAppContext } from '../hooks/useAppContext';
import { useShortcutActions } from '../hooks/useShortcutActions';

import { useFiltersStore } from '../stores';

import { LogoIcon } from './icons/LogoIcon';

export const Sidebar: FC = () => {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/filters/FilterSection.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { mockMultipleAccountNotifications } from '../../__mocks__/notifications-
import { mockSettings } from '../../__mocks__/state-mocks';

import { useFiltersStore } from '../../stores';

import { stateFilter } from '../../utils/notifications/filters';
import { FilterSection } from './FilterSection';

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/filters/FilterSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import type { Icon } from '@primer/octicons-react';
import { Stack, Text } from '@primer/react';

import { useAppContext } from '../../hooks/useAppContext';
import { type FiltersState, useFiltersStore } from '../../stores';

import { Checkbox } from '../fields/Checkbox';
import { Title } from '../primitives/Title';

import { type FiltersState, useFiltersStore } from '../../stores';
import type { Filter } from '../../utils/notifications/filters';
import { RequiresDetailedNotificationWarning } from './RequiresDetailedNotificationsWarning';

Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/filters/SearchFilter.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { fireEvent, screen } from '@testing-library/react';
import { renderWithProviders } from '../../__helpers__/test-utils';

import { useFiltersStore } from '../../stores';

import { SearchFilter } from './SearchFilter';

describe('renderer/components/filters/SearchFilter.tsx', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/filters/SearchFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import {
import { Stack, Text } from '@primer/react';

import { useAppContext } from '../../hooks/useAppContext';
import { useFiltersStore } from '../../stores';

import { Title } from '../primitives/Title';

import { IconColor, type SearchToken, Size } from '../../types';

import { useFiltersStore } from '../../stores';
import {
hasExcludeSearchFilters,
hasIncludeSearchFilters,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/icons/LogoIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const LogoIcon: FC<LogoIconProps> = ({
size = Size.SMALL,
...props
}: LogoIconProps) => (
// biome-ignore lint/a11y/useKeyWithClickEvents: Logo is purely decorative
<svg
aria-hidden="true"
aria-label={`${APPLICATION.NAME} Logo`}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/context/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Constants } from '../constants';
import { useInactivityTimer } from '../hooks/timers/useInactivityTimer';
import { useIntervalTimer } from '../hooks/timers/useIntervalTimer';
import { useNotifications } from '../hooks/useNotifications';
import { useFiltersStore } from '../stores';

import type {
Account,
Expand All @@ -34,7 +35,6 @@ import type {
LoginPersonalAccessTokenOptions,
} from '../utils/auth/types';

import { useFiltersStore } from '../stores';
import { fetchAuthenticatedUserDetails } from '../utils/api/client';
import { clearOctokitClientCache } from '../utils/api/octokit';
import {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<title>Gitify</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self';" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="script-src 'self';">
</head>

<body>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/routes/Filters.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event';
import { navigateMock, renderWithProviders } from '../__helpers__/test-utils';

import { type FiltersStore, useFiltersStore } from '../stores';

import { FiltersRoute } from './Filters';

describe('renderer/routes/Filters.tsx', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/routes/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { FC } from 'react';
import { FilterIcon, FilterRemoveIcon } from '@primer/octicons-react';
import { Button, Stack, Tooltip } from '@primer/react';

import { useFiltersStore } from '../stores';

import { ReasonFilter } from '../components/filters/ReasonFilter';
import { SearchFilter } from '../components/filters/SearchFilter';
import { StateFilter } from '../components/filters/StateFilter';
Expand All @@ -13,8 +15,6 @@ import { Page } from '../components/layout/Page';
import { Footer } from '../components/primitives/Footer';
import { Header } from '../components/primitives/Header';

import { useFiltersStore } from '../stores';

export const FiltersRoute: FC = () => {
const clearFilters = useFiltersStore((s) => s.reset);

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/notifications/filters/filter.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { mockPartialGitifyNotification } from '../../../__mocks__/notifications-mocks';
import { mockSettings } from '../../../__mocks__/state-mocks';

import { useFiltersStore } from '../../../stores';

import type { GitifyOwner, Link, SearchToken } from '../../../types';

import { useFiltersStore } from '../../../stores';
import { filterBaseNotifications, filterDetailedNotifications } from './filter';

describe('renderer/utils/notifications/filters/filter.ts', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/notifications/filters/filter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import useFiltersStore from '../../../stores/useFiltersStore';

import type {
GitifyNotification,
GitifyNotificationState,
GitifyNotificationUser,
SettingsState,
} from '../../../types';

import useFiltersStore from '../../../stores/useFiltersStore';
import {
BASE_SEARCH_QUALIFIERS,
DETAILED_ONLY_SEARCH_QUALIFIERS,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/notifications/filters/reason.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useFiltersStore } from '../../../stores';

import type {
AccountNotifications,
GitifyNotification,
Expand All @@ -6,7 +8,6 @@ import type {
} from '../../../types';
import type { Filter } from './types';

import { useFiltersStore } from '../../../stores';
import { REASON_TYPE_DETAILS } from '../reason';

export const reasonFilter: Filter<Reason> = {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/utils/notifications/filters/search.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { GitifyNotification } from '../../../types';

import { useFiltersStore } from '../../../stores';

import type { GitifyNotification } from '../../../types';

export const SEARCH_DELIMITER = ':';

const SEARCH_QUALIFIERS = {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/utils/notifications/filters/state.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useFiltersStore } from '../../../stores';

import type {
AccountNotifications,
FilterStateType,
Expand All @@ -7,8 +9,6 @@ import type {
} from '../../../types';
import type { Filter } from './types';

import { useFiltersStore } from '../../../stores';

const STATE_TYPE_DETAILS: Record<FilterStateType, TypeDetails> = {
draft: {
title: 'Draft',
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/utils/notifications/filters/subjectType.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import useFiltersStore from '../../../stores/useFiltersStore';

import type {
AccountNotifications,
GitifyNotification,
Expand All @@ -6,8 +8,6 @@ import type {
} from '../../../types';
import type { Filter } from './types';

import useFiltersStore from '../../../stores/useFiltersStore';

const SUBJECT_TYPE_DETAILS: Record<SubjectType, TypeDetails> = {
CheckSuite: {
title: 'Check Suite',
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/utils/notifications/filters/userType.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useFiltersStore } from '../../../stores';

import type {
AccountNotifications,
GitifyNotification,
Expand All @@ -6,8 +8,6 @@ import type {
} from '../../../types';
import type { Filter } from './types';

import { useFiltersStore } from '../../../stores';

type FilterableUserType = Extract<UserType, 'User' | 'Bot' | 'Organization'>;

const USER_TYPE_DETAILS: Record<UserType, TypeDetails> = {
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/notifications/handlers/commit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { mockPartialGitifyNotification } from '../../../__mocks__/notifications-
import { mockSettings } from '../../../__mocks__/state-mocks';
import { mockRawUser } from '../../api/__mocks__/response-mocks';

import { useFiltersStore } from '../../../stores';

import type { GitifyNotification, Link } from '../../../types';
import type {
GetCommitCommentResponse,
GetCommitResponse,
} from '../../api/types';

import { useFiltersStore } from '../../../stores';
import * as apiClient from '../../api/client';
import { commitHandler } from './commit';

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/notifications/handlers/release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { mockPartialGitifyNotification } from '../../../__mocks__/notifications-
import { mockSettings } from '../../../__mocks__/state-mocks';
import { mockRawUser } from '../../api/__mocks__/response-mocks';

import { useFiltersStore } from '../../../stores';

import type { GitifyNotification, Link } from '../../../types';
import type { GetReleaseResponse } from '../../api/types';

import { useFiltersStore } from '../../../stores';
import * as apiClient from '../../api/client';
import { releaseHandler } from './release';

Expand Down
Loading