Skip to content

A local-first personal finance app

Use @desktop-client/hooks alias for cleaner imports (#4789)

Joel Jeremy Marquezcc204ba70eac
diff --git a/packages/desktop-client/src/auth/ProtectedRoute.tsx b/packages/desktop-client/src/auth/ProtectedRoute.tsx
index 202980b9b2..f2d208fad0 100644
--- a/packages/desktop-client/src/auth/ProtectedRoute.tsx
+++ b/packages/desktop-client/src/auth/ProtectedRoute.tsx
@@ -4,12 +4,13 @@ import { View } from '@actual-app/components/view';
import { type RemoteFile, type SyncedLocalFile } from 'loot-core/types/file';
-import { useMetadataPref } from '../hooks/useMetadataPref';
import { useSelector } from '../redux';
import { useAuth } from './AuthProvider';
import { type Permissions } from './types';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
type ProtectedRouteProps = {
permission: Permissions;
element: ReactElement;
diff --git a/packages/desktop-client/src/components/App.tsx b/packages/desktop-client/src/components/App.tsx
index 5d25b4c368..995dd46b4e 100644
--- a/packages/desktop-client/src/components/App.tsx
+++ b/packages/desktop-client/src/components/App.tsx
@@ -24,7 +24,6 @@ import { signOut } from 'loot-core/client/users/usersSlice';
import { init as initConnection, send } from 'loot-core/platform/client/fetch';
import { handleGlobalEvents } from '../global-events';
-import { useMetadataPref } from '../hooks/useMetadataPref';
import { setI18NextLanguage } from '../i18n';
import { installPolyfills } from '../polyfills';
import { useDispatch, useSelector, useStore } from '../redux';
@@ -41,6 +40,8 @@ import { Modals } from './Modals';
import { SidebarProvider } from './sidebar/SidebarProvider';
import { UpdateNotification } from './UpdateNotification';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
function AppInner() {
const [budgetId] = useMetadataPref('id');
const [cloudFileId] = useMetadataPref('cloudFileId');
diff --git a/packages/desktop-client/src/components/FinancesApp.tsx b/packages/desktop-client/src/components/FinancesApp.tsx
index 214235a9c0..cf86982b6d 100644
--- a/packages/desktop-client/src/components/FinancesApp.tsx
+++ b/packages/desktop-client/src/components/FinancesApp.tsx
@@ -19,10 +19,6 @@ import * as undo from 'loot-core/platform/client/undo';
import { ProtectedRoute } from '../auth/ProtectedRoute';
import { Permissions } from '../auth/types';
-import { useAccounts } from '../hooks/useAccounts';
-import { useLocalPref } from '../hooks/useLocalPref';
-import { useMetaThemeColor } from '../hooks/useMetaThemeColor';
-import { useNavigate } from '../hooks/useNavigate';
import { useSelector, useDispatch } from '../redux';
import { getIsOutdated, getLatestVersion } from '../util/versions';
@@ -46,6 +42,11 @@ import { Settings } from './settings';
import { FloatableSidebar } from './sidebar';
import { Titlebar } from './Titlebar';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useMetaThemeColor } from '@desktop-client/hooks/useMetaThemeColor';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
function NarrowNotSupported({
redirectTo = '/budget',
children,
diff --git a/packages/desktop-client/src/components/GlobalKeys.ts b/packages/desktop-client/src/components/GlobalKeys.ts
index 3fcead6ab6..615c6085b4 100644
--- a/packages/desktop-client/src/components/GlobalKeys.ts
+++ b/packages/desktop-client/src/components/GlobalKeys.ts
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
import * as Platform from 'loot-core/client/platform';
-import { useNavigate } from '../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
export function GlobalKeys() {
const navigate = useNavigate();
diff --git a/packages/desktop-client/src/components/HelpMenu.tsx b/packages/desktop-client/src/components/HelpMenu.tsx
index 30eb058ee3..2317c057d5 100644
--- a/packages/desktop-client/src/components/HelpMenu.tsx
+++ b/packages/desktop-client/src/components/HelpMenu.tsx
@@ -12,9 +12,10 @@ import { useToggle } from 'usehooks-ts';
import { pushModal } from 'loot-core/client/modals/modalsSlice';
-import { useFeatureFlag } from '../hooks/useFeatureFlag';
import { useDispatch } from '../redux';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+
const getPageDocs = (page: string) => {
switch (page) {
case '/budget':
diff --git a/packages/desktop-client/src/components/LoggedInUser.tsx b/packages/desktop-client/src/components/LoggedInUser.tsx
index bf06929736..a26b7faac7 100644
--- a/packages/desktop-client/src/components/LoggedInUser.tsx
+++ b/packages/desktop-client/src/components/LoggedInUser.tsx
@@ -18,13 +18,14 @@ import { type TransObjectLiteral } from 'loot-core/types/util';
import { useAuth } from '../auth/AuthProvider';
import { Permissions } from '../auth/types';
-import { useMetadataPref } from '../hooks/useMetadataPref';
-import { useNavigate } from '../hooks/useNavigate';
import { useSelector, useDispatch } from '../redux';
import { PrivacyFilter } from './PrivacyFilter';
import { useMultiuserEnabled, useServerURL } from './ServerContext';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
type LoggedInUserProps = {
hideIfNoServer?: boolean;
style?: CSSProperties;
diff --git a/packages/desktop-client/src/components/ManageRules.tsx b/packages/desktop-client/src/components/ManageRules.tsx
index 0beecd5868..0941b8d3a3 100644
--- a/packages/desktop-client/src/components/ManageRules.tsx
+++ b/packages/desktop-client/src/components/ManageRules.tsx
@@ -26,10 +26,6 @@ import { mapField, friendlyOp } from 'loot-core/shared/rules';
import { describeSchedule } from 'loot-core/shared/schedules';
import { type RuleEntity, type NewRuleEntity } from 'loot-core/types/models';
-import { useAccounts } from '../hooks/useAccounts';
-import { useCategories } from '../hooks/useCategories';
-import { usePayees } from '../hooks/usePayees';
-import { useSelected, SelectedProvider } from '../hooks/useSelected';
import { useDispatch } from '../redux';
import { InfiniteScrollWrapper } from './common/InfiniteScrollWrapper';
@@ -38,6 +34,14 @@ import { Search } from './common/Search';
import { RulesHeader } from './rules/RulesHeader';
import { RulesList } from './rules/RulesList';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import {
+ useSelected,
+ SelectedProvider,
+} from '@desktop-client/hooks/useSelected';
+
function mapValue(
field,
value,
diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx
index 1cd4487d16..941743b718 100644
--- a/packages/desktop-client/src/components/Modals.tsx
+++ b/packages/desktop-client/src/components/Modals.tsx
@@ -6,8 +6,6 @@ import { closeModal } from 'loot-core/client/modals/modalsSlice';
import { send } from 'loot-core/platform/client/fetch';
import * as monthUtils from 'loot-core/shared/months';
-import { useMetadataPref } from '../hooks/useMetadataPref';
-import { useModalState } from '../hooks/useModalState';
import { useDispatch } from '../redux';
import { EditSyncAccount } from './banksync/EditSyncAccount';
@@ -79,6 +77,9 @@ import { ScheduleLink } from './schedules/ScheduleLink';
import { UpcomingLength } from './schedules/UpcomingLength';
import { NamespaceContext } from './spreadsheet/NamespaceContext';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+import { useModalState } from '@desktop-client/hooks/useModalState';
+
export function Modals() {
const location = useLocation();
const dispatch = useDispatch();
diff --git a/packages/desktop-client/src/components/NotesButton.tsx b/packages/desktop-client/src/components/NotesButton.tsx
index 5c2b4e8293..e1e409fb4d 100644
--- a/packages/desktop-client/src/components/NotesButton.tsx
+++ b/packages/desktop-client/src/components/NotesButton.tsx
@@ -16,10 +16,10 @@ import { View } from '@actual-app/components/view';
import { send } from 'loot-core/platform/client/fetch';
-import { useNotes } from '../hooks/useNotes';
-
import { Notes } from './Notes';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
type NotesButtonProps = {
id: string;
width?: number;
diff --git a/packages/desktop-client/src/components/PrivacyFilter.tsx b/packages/desktop-client/src/components/PrivacyFilter.tsx
index 4b26172756..1053ce0ce8 100644
--- a/packages/desktop-client/src/components/PrivacyFilter.tsx
+++ b/packages/desktop-client/src/components/PrivacyFilter.tsx
@@ -9,7 +9,7 @@ import { useResponsive } from '@actual-app/components/hooks/useResponsive';
import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
-import { usePrivacyMode } from '../hooks/usePrivacyMode';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
type ConditionalPrivacyFilterProps = {
children: ReactNode;
diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx
index ed3b11794a..bdf5db6b80 100644
--- a/packages/desktop-client/src/components/Titlebar.tsx
+++ b/packages/desktop-client/src/components/Titlebar.tsx
@@ -28,10 +28,6 @@ import {
isElectron,
} from 'loot-core/shared/environment';
-import { useGlobalPref } from '../hooks/useGlobalPref';
-import { useMetadataPref } from '../hooks/useMetadataPref';
-import { useNavigate } from '../hooks/useNavigate';
-import { useSyncedPref } from '../hooks/useSyncedPref';
import { useDispatch } from '../redux';
import { AccountSyncCheck } from './accounts/AccountSyncCheck';
@@ -45,6 +41,11 @@ import { useSidebar } from './sidebar/SidebarProvider';
import { useSheetValue } from './spreadsheet/useSheetValue';
import { ThemeSelector } from './ThemeSelector';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
function UncategorizedButton() {
const count: number | null = useSheetValue(queries.uncategorizedCount());
if (count === null || count <= 0) {
diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx
index 5df7951444..9df7d3766e 100644
--- a/packages/desktop-client/src/components/accounts/Account.tsx
+++ b/packages/desktop-client/src/components/accounts/Account.tsx
@@ -67,23 +67,6 @@ import {
} from 'loot-core/types/models';
import { unlinkAccount } from '../../accounts/accountsSlice';
-import { useAccountPreviewTransactions } from '../../hooks/useAccountPreviewTransactions';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useCategories } from '../../hooks/useCategories';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useFailedAccounts } from '../../hooks/useFailedAccounts';
-import { useLocalPref } from '../../hooks/useLocalPref';
-import { usePayees } from '../../hooks/usePayees';
-import {
- SelectedProviderWithItems,
- type Actions,
-} from '../../hooks/useSelected';
-import {
- SplitsExpandedProvider,
- useSplitsExpanded,
-} from '../../hooks/useSplitsExpanded';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
-import { useTransactionBatchActions } from '../../hooks/useTransactionBatchActions';
import { useSelector, useDispatch } from '../../redux';
import { type SavedFilter } from '../filters/SavedFilterMenuButton';
import { TransactionList } from '../transactions/TransactionList';
@@ -92,6 +75,24 @@ import { validateAccountName } from '../util/accountValidation';
import { AccountEmptyMessage } from './AccountEmptyMessage';
import { AccountHeader } from './Header';
+import { useAccountPreviewTransactions } from '@desktop-client/hooks/useAccountPreviewTransactions';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useFailedAccounts } from '@desktop-client/hooks/useFailedAccounts';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import {
+ SelectedProviderWithItems,
+ type Actions,
+} from '@desktop-client/hooks/useSelected';
+import {
+ SplitsExpandedProvider,
+ useSplitsExpanded,
+} from '@desktop-client/hooks/useSplitsExpanded';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+import { useTransactionBatchActions } from '@desktop-client/hooks/useTransactionBatchActions';
+
type ConditionEntity = Partial<RuleConditionEntity> | TransactionFilterEntity;
function isTransactionFilterEntity(
diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx b/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx
index 2eb33d9c32..80ea254662 100644
--- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx
+++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.tsx
@@ -12,11 +12,12 @@ import { type AccountEntity } from 'loot-core/types/models';
import { unlinkAccount } from '../../accounts/accountsSlice';
import { authorizeBank } from '../../gocardless';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useFailedAccounts } from '../../hooks/useFailedAccounts';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useFailedAccounts } from '@desktop-client/hooks/useFailedAccounts';
+
function useErrorMessage() {
const { t } = useTranslation();
function getErrorMessage(type: string, code: string) {
diff --git a/packages/desktop-client/src/components/accounts/Balance.tsx b/packages/desktop-client/src/components/accounts/Balance.tsx
index 4ff4ac86f3..ef78e18d09 100644
--- a/packages/desktop-client/src/components/accounts/Balance.tsx
+++ b/packages/desktop-client/src/components/accounts/Balance.tsx
@@ -14,13 +14,14 @@ import { getScheduledAmount } from 'loot-core/shared/schedules';
import { isPreviewId } from 'loot-core/shared/transactions';
import { type AccountEntity } from 'loot-core/types/models';
-import { useSelectedItems } from '../../hooks/useSelected';
import { PrivacyFilter } from '../PrivacyFilter';
import { type Binding } from '../spreadsheet';
import { CellValue, CellValueText } from '../spreadsheet/CellValue';
import { useFormat } from '../spreadsheet/useFormat';
import { useSheetValue } from '../spreadsheet/useSheetValue';
+import { useSelectedItems } from '@desktop-client/hooks/useSelected';
+
type DetailedBalanceProps = {
name: string;
balance: number;
diff --git a/packages/desktop-client/src/components/accounts/Header.tsx b/packages/desktop-client/src/components/accounts/Header.tsx
index 3a17e4d9b3..d7bdbdf546 100644
--- a/packages/desktop-client/src/components/accounts/Header.tsx
+++ b/packages/desktop-client/src/components/accounts/Header.tsx
@@ -40,10 +40,6 @@ import {
type TransactionFilterEntity,
} from 'loot-core/types/models';
-import { useLocale } from '../../hooks/useLocale';
-import { useLocalPref } from '../../hooks/useLocalPref';
-import { useSplitsExpanded } from '../../hooks/useSplitsExpanded';
-import { useSyncServerStatus } from '../../hooks/useSyncServerStatus';
import { AnimatedRefresh } from '../AnimatedRefresh';
import { Search } from '../common/Search';
import { FilterButton } from '../filters/FiltersMenu';
@@ -56,6 +52,11 @@ import { type TableRef } from './Account';
import { Balances } from './Balance';
import { ReconcilingMessage, ReconcileMenu } from './Reconcile';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useSplitsExpanded } from '@desktop-client/hooks/useSplitsExpanded';
+import { useSyncServerStatus } from '@desktop-client/hooks/useSyncServerStatus';
+
type AccountHeaderProps = {
tableRef: TableRef;
isNameEditable: boolean;
diff --git a/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx b/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
index 3edf88d61a..4e295da4c3 100644
--- a/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
+++ b/packages/desktop-client/src/components/admin/UserAccess/UserAccess.tsx
@@ -27,7 +27,6 @@ import {
type UserAccessEntity,
} from 'loot-core/types/models';
-import { useMetadataPref } from '../../../hooks/useMetadataPref';
import { useDispatch } from '../../../redux';
import { InfiniteScrollWrapper } from '../../common/InfiniteScrollWrapper';
import { Link } from '../../common/Link';
@@ -36,6 +35,8 @@ import { Search } from '../../common/Search';
import { UserAccessHeader } from './UserAccessHeader';
import { UserAccessRow } from './UserAccessRow';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
type ManageUserAccessContentProps = {
isModal: boolean;
setLoading?: Dispatch<SetStateAction<boolean>>;
diff --git a/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx b/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
index 961666ba7f..c1828984b5 100644
--- a/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
+++ b/packages/desktop-client/src/components/admin/UserAccess/UserAccessRow.tsx
@@ -11,11 +11,12 @@ import { send } from 'loot-core/platform/client/fetch';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import { type UserAvailable } from 'loot-core/types/models';
-import { useMetadataPref } from '../../../hooks/useMetadataPref';
import { useDispatch } from '../../../redux';
import { Checkbox } from '../../forms';
import { Row, Cell } from '../../table';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
type UserAccessProps = {
access: UserAvailable;
hovered?: boolean;
diff --git a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
index 6d0e3a8f8d..52f8896256 100644
--- a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
+++ b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectory.tsx
@@ -23,7 +23,6 @@ import { send } from 'loot-core/platform/client/fetch';
import * as undo from 'loot-core/platform/client/undo';
import { type NewUserEntity, type UserEntity } from 'loot-core/types/models';
-import { SelectedProvider, useSelected } from '../../../hooks/useSelected';
import { useDispatch } from '../../../redux';
import { InfiniteScrollWrapper } from '../../common/InfiniteScrollWrapper';
import { Link } from '../../common/Link';
@@ -32,6 +31,11 @@ import { Search } from '../../common/Search';
import { UserDirectoryHeader } from './UserDirectoryHeader';
import { UserDirectoryRow } from './UserDirectoryRow';
+import {
+ SelectedProvider,
+ useSelected,
+} from '@desktop-client/hooks/useSelected';
+
type ManageUserDirectoryContentProps = {
isModal: boolean;
setLoading?: Dispatch<SetStateAction<boolean>>;
diff --git a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryHeader.tsx b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryHeader.tsx
index 6cc105f6f7..fef255fa6c 100644
--- a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryHeader.tsx
+++ b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryHeader.tsx
@@ -1,11 +1,12 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
+import { SelectCell, Cell, TableHeader } from '../../table';
+
import {
useSelectedItems,
useSelectedDispatch,
-} from '../../../hooks/useSelected';
-import { SelectCell, Cell, TableHeader } from '../../table';
+} from '@desktop-client/hooks/useSelected';
export function UserDirectoryHeader() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryPage.tsx b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryPage.tsx
index 58cf88afa0..2a061fd19c 100644
--- a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryPage.tsx
+++ b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryPage.tsx
@@ -4,11 +4,12 @@ import { Trans, useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { View } from '@actual-app/components/view';
-import { useNavigate } from '../../../hooks/useNavigate';
import { Page } from '../../Page';
import { UserDirectory } from './UserDirectory';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function UserDirectoryPage({
bottomContent,
}: {
diff --git a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryRow.tsx b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryRow.tsx
index 2e148daa77..4ec774a33f 100644
--- a/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryRow.tsx
+++ b/packages/desktop-client/src/components/admin/UserDirectory/UserDirectoryRow.tsx
@@ -9,10 +9,11 @@ import { View } from '@actual-app/components/view';
import { PossibleRoles } from 'loot-core/shared/user';
import { type UserEntity } from 'loot-core/types/models';
-import { useSelectedDispatch } from '../../../hooks/useSelected';
import { Checkbox } from '../../forms';
import { SelectCell, Row, Cell } from '../../table';
+import { useSelectedDispatch } from '@desktop-client/hooks/useSelected';
+
type UserDirectoryProps = {
user: UserEntity;
hovered?: boolean;
diff --git a/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx
index ed54a4121e..9178ec309b 100644
--- a/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/AccountAutocomplete.tsx
@@ -17,11 +17,11 @@ import { css, cx } from '@emotion/css';
import { type AccountEntity } from 'loot-core/types/models';
-import { useAccounts } from '../../hooks/useAccounts';
-
import { Autocomplete } from './Autocomplete';
import { ItemHeader } from './ItemHeader';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+
type AccountAutocompleteItem = AccountEntity;
type AccountListProps = {
diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
index b4e186e8d9..d4d2fe1d96 100644
--- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
@@ -24,7 +24,7 @@ import Downshift, { type StateChangeTypes } from 'downshift';
import { getNormalisedString } from 'loot-core/shared/normalisation';
-import { useProperFocus } from '../../hooks/useProperFocus';
+import { useProperFocus } from '@desktop-client/hooks/useProperFocus';
type CommonAutocompleteProps<T extends Item> = {
focused?: boolean;
diff --git a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
index d92fea460b..7d854961f3 100644
--- a/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/CategoryAutocomplete.tsx
@@ -29,8 +29,6 @@ import {
type CategoryGroupEntity,
} from 'loot-core/types/models';
-import { useCategories } from '../../hooks/useCategories';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useEnvelopeSheetValue } from '../budget/envelope/EnvelopeBudgetComponents';
import { makeAmountFullStyle } from '../budget/util';
import { useSheetValue } from '../spreadsheet/useSheetValue';
@@ -38,6 +36,9 @@ import { useSheetValue } from '../spreadsheet/useSheetValue';
import { Autocomplete, defaultFilterSuggestion } from './Autocomplete';
import { ItemHeader } from './ItemHeader';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type CategoryAutocompleteItem = Omit<CategoryEntity, 'group'> & {
group?: CategoryGroupEntity;
};
diff --git a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx
index 0aed8ad636..5d6975e4d1 100644
--- a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx
+++ b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.test.tsx
@@ -6,7 +6,6 @@ import { generateAccount } from 'loot-core/mocks';
import type { AccountEntity, PayeeEntity } from 'loot-core/types/models';
import { AuthProvider } from '../../auth/AuthProvider';
-import { useCommonPayees } from '../../hooks/usePayees';
import { TestProvider } from '../../redux/mock';
import {
@@ -15,6 +14,8 @@ import {
type PayeeAutocompleteProps,
} from './PayeeAutocomplete';
+import { useCommonPayees } from '@desktop-client/hooks/usePayees';
+
const PAYEE_SELECTOR = '[data-testid][role=option]';
const PAYEE_SECTION_SELECTOR = '[data-testid$="-item-group"]';
diff --git a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
index 96e2d70158..4bd430325b 100644
--- a/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
+++ b/packages/desktop-client/src/components/autocomplete/PayeeAutocomplete.tsx
@@ -29,8 +29,6 @@ import {
import { getNormalisedString } from 'loot-core/shared/normalisation';
import { type AccountEntity, type PayeeEntity } from 'loot-core/types/models';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useCommonPayees, usePayees } from '../../hooks/usePayees';
import { useDispatch } from '../../redux';
import {
@@ -40,6 +38,9 @@ import {
} from './Autocomplete';
import { ItemHeader } from './ItemHeader';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCommonPayees, usePayees } from '@desktop-client/hooks/usePayees';
+
export type PayeeAutocompleteItem = PayeeEntity;
const MAX_AUTO_SUGGESTIONS = 5;
diff --git a/packages/desktop-client/src/components/banksync/AccountsList.tsx b/packages/desktop-client/src/components/banksync/AccountsList.tsx
index 533dab3770..8d755ed120 100644
--- a/packages/desktop-client/src/components/banksync/AccountsList.tsx
+++ b/packages/desktop-client/src/components/banksync/AccountsList.tsx
@@ -4,10 +4,10 @@ import { View } from '@actual-app/components/view';
import { type AccountEntity } from 'loot-core/types/models';
-import { useLocale } from '../../hooks/useLocale';
-
import { AccountRow } from './AccountRow';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type AccountsListProps = {
accounts: AccountEntity[];
hoveredAccount?: string | null;
diff --git a/packages/desktop-client/src/components/banksync/EditSyncAccount.tsx b/packages/desktop-client/src/components/banksync/EditSyncAccount.tsx
index f9fe938c3d..601eec9465 100644
--- a/packages/desktop-client/src/components/banksync/EditSyncAccount.tsx
+++ b/packages/desktop-client/src/components/banksync/EditSyncAccount.tsx
@@ -24,13 +24,14 @@ import {
} from 'loot-core/types/models';
import { unlinkAccount } from '../../accounts/accountsSlice';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useDispatch } from '../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { CheckboxOption } from '../modals/ImportTransactionsModal/CheckboxOption';
import { FieldMapping } from './FieldMapping';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export type TransactionDirection = 'payment' | 'deposit';
type MappableActualFields = 'date' | 'payee' | 'notes';
diff --git a/packages/desktop-client/src/components/banksync/index.tsx b/packages/desktop-client/src/components/banksync/index.tsx
index 4f139f8b25..7c09d623c4 100644
--- a/packages/desktop-client/src/components/banksync/index.tsx
+++ b/packages/desktop-client/src/components/banksync/index.tsx
@@ -11,8 +11,6 @@ import {
type AccountEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
import { useDispatch } from '../../redux';
import { MOBILE_NAV_HEIGHT } from '../mobile/MobileNavTabs';
import { Page } from '../Page';
@@ -20,6 +18,9 @@ import { Page } from '../Page';
import { AccountsHeader } from './AccountsHeader';
import { AccountsList } from './AccountsList';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
type SyncProviders = BankSyncProviders | 'unlinked';
const useSyncSourceReadable = () => {
diff --git a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
index 8a374c093d..dcb1cfdac2 100644
--- a/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
+++ b/packages/desktop-client/src/components/budget/BalanceWithCarryover.tsx
@@ -17,7 +17,6 @@ import { css } from '@emotion/css';
import { type TransObjectLiteral } from 'loot-core/types/util';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { type Binding } from '../spreadsheet';
import { CellValue, CellValueText } from '../spreadsheet/CellValue';
import { useFormat } from '../spreadsheet/useFormat';
@@ -25,6 +24,8 @@ import { useSheetValue } from '../spreadsheet/useSheetValue';
import { makeBalanceAmountStyle } from './util';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+
type CarryoverIndicatorProps = {
style?: CSSProperties;
};
diff --git a/packages/desktop-client/src/components/budget/BudgetCategories.jsx b/packages/desktop-client/src/components/budget/BudgetCategories.jsx
index 2cb487f9ae..b6267451cd 100644
--- a/packages/desktop-client/src/components/budget/BudgetCategories.jsx
+++ b/packages/desktop-client/src/components/budget/BudgetCategories.jsx
@@ -4,7 +4,6 @@ import { styles } from '@actual-app/components/styles';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useLocalPref } from '../../hooks/useLocalPref';
import { DropHighlightPosContext } from '../sort';
import { Row } from '../table';
@@ -17,6 +16,8 @@ import { SidebarCategory } from './SidebarCategory';
import { SidebarGroup } from './SidebarGroup';
import { separateGroups } from './util';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+
export const BudgetCategories = memo(
({
categoryGroups,
diff --git a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx
index fcb4f19401..055f10cea7 100644
--- a/packages/desktop-client/src/components/budget/BudgetSummaries.tsx
+++ b/packages/desktop-client/src/components/budget/BudgetSummaries.tsx
@@ -12,12 +12,12 @@ import { css } from '@emotion/css';
import { addMonths, subMonths } from 'loot-core/shared/months';
-import { useResizeObserver } from '../../hooks/useResizeObserver';
-
import { type BudgetSummary as EnvelopeBudgetSummary } from './envelope/budgetsummary/BudgetSummary';
import { MonthsContext } from './MonthsContext';
import { type BudgetSummary as TrackingBudgetSummary } from './tracking/budgetsummary/BudgetSummary';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
type BudgetSummariesProps = {
SummaryComponent: typeof TrackingBudgetSummary | typeof EnvelopeBudgetSummary;
};
diff --git a/packages/desktop-client/src/components/budget/BudgetTable.tsx b/packages/desktop-client/src/components/budget/BudgetTable.tsx
index 1ecd45fc80..de9ef0b721 100644
--- a/packages/desktop-client/src/components/budget/BudgetTable.tsx
+++ b/packages/desktop-client/src/components/budget/BudgetTable.tsx
@@ -13,9 +13,6 @@ import {
type CategoryGroupEntity,
} from 'loot-core/types/models';
-import { useCategories } from '../../hooks/useCategories';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-import { useLocalPref } from '../../hooks/useLocalPref';
import { type DropPosition } from '../sort';
import { BudgetCategories } from './BudgetCategories';
@@ -29,6 +26,10 @@ import {
separateGroups,
} from './util';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+
type BudgetTableProps = {
type: string;
prewarmStartMonth: string;
diff --git a/packages/desktop-client/src/components/budget/ExpenseCategory.tsx b/packages/desktop-client/src/components/budget/ExpenseCategory.tsx
index bd48f67362..48ea10d402 100644
--- a/packages/desktop-client/src/components/budget/ExpenseCategory.tsx
+++ b/packages/desktop-client/src/components/budget/ExpenseCategory.tsx
@@ -9,7 +9,6 @@ import {
type CategoryEntity,
} from 'loot-core/types/models';
-import { useDragRef } from '../../hooks/useDragRef';
import {
useDraggable,
useDroppable,
@@ -23,6 +22,8 @@ import { Row } from '../table';
import { RenderMonths } from './RenderMonths';
import { SidebarCategory } from './SidebarCategory';
+import { useDragRef } from '@desktop-client/hooks/useDragRef';
+
type ExpenseCategoryProps = {
cat: CategoryEntity;
categoryGroup?: CategoryGroupEntity;
diff --git a/packages/desktop-client/src/components/budget/ExpenseGroup.tsx b/packages/desktop-client/src/components/budget/ExpenseGroup.tsx
index 66fea4e55f..6af6cbd0b6 100644
--- a/packages/desktop-client/src/components/budget/ExpenseGroup.tsx
+++ b/packages/desktop-client/src/components/budget/ExpenseGroup.tsx
@@ -4,7 +4,6 @@ import React, { type ComponentProps } from 'react';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useDragRef } from '../../hooks/useDragRef';
import {
useDraggable,
useDroppable,
@@ -18,6 +17,8 @@ import { Row, ROW_HEIGHT } from '../table';
import { RenderMonths } from './RenderMonths';
import { SidebarGroup } from './SidebarGroup';
+import { useDragRef } from '@desktop-client/hooks/useDragRef';
+
type ExpenseGroupProps = {
group: ComponentProps<typeof SidebarGroup>['group'];
collapsed: boolean;
diff --git a/packages/desktop-client/src/components/budget/IncomeCategory.tsx b/packages/desktop-client/src/components/budget/IncomeCategory.tsx
index eeeb6caf88..c529d88992 100644
--- a/packages/desktop-client/src/components/budget/IncomeCategory.tsx
+++ b/packages/desktop-client/src/components/budget/IncomeCategory.tsx
@@ -3,7 +3,6 @@ import React, { type ComponentProps } from 'react';
import { type CategoryEntity } from 'loot-core/types/models';
-import { useDragRef } from '../../hooks/useDragRef';
import {
useDraggable,
useDroppable,
@@ -16,6 +15,8 @@ import { Row } from '../table';
import { RenderMonths } from './RenderMonths';
import { SidebarCategory } from './SidebarCategory';
+import { useDragRef } from '@desktop-client/hooks/useDragRef';
+
type IncomeCategoryProps = {
cat: CategoryEntity;
isLast?: boolean;
diff --git a/packages/desktop-client/src/components/budget/MonthPicker.tsx b/packages/desktop-client/src/components/budget/MonthPicker.tsx
index 41c33482eb..1f85ce1415 100644
--- a/packages/desktop-client/src/components/budget/MonthPicker.tsx
+++ b/packages/desktop-client/src/components/budget/MonthPicker.tsx
@@ -13,12 +13,13 @@ import { View } from '@actual-app/components/view';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../hooks/useLocale';
-import { useResizeObserver } from '../../hooks/useResizeObserver';
import { Link } from '../common/Link';
import { type MonthBounds } from './MonthsContext';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
type MonthPickerProps = {
startMonth: string;
numDisplayed: number;
diff --git a/packages/desktop-client/src/components/budget/SidebarCategory.tsx b/packages/desktop-client/src/components/budget/SidebarCategory.tsx
index 37ec911d52..332f28c93e 100644
--- a/packages/desktop-client/src/components/budget/SidebarCategory.tsx
+++ b/packages/desktop-client/src/components/budget/SidebarCategory.tsx
@@ -14,14 +14,15 @@ import {
type CategoryEntity,
} from 'loot-core/types/models';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
import { NotesButton } from '../NotesButton';
import { InputCell } from '../table';
import { CategoryAutomationButton } from './goals/CategoryAutomationButton';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
type SidebarCategoryProps = {
innerRef: Ref<HTMLDivElement>;
category: CategoryEntity;
diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.tsx b/packages/desktop-client/src/components/budget/SidebarGroup.tsx
index f9a973514c..1007c48f7f 100644
--- a/packages/desktop-client/src/components/budget/SidebarGroup.tsx
+++ b/packages/desktop-client/src/components/budget/SidebarGroup.tsx
@@ -16,12 +16,13 @@ import {
type CategoryGroupEntity,
} from 'loot-core/types/models';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
import { NotesButton } from '../NotesButton';
import { InputCell } from '../table';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
type SidebarGroupProps = {
group: CategoryGroupEntity;
editing?: boolean;
diff --git a/packages/desktop-client/src/components/budget/envelope/BudgetMenu.tsx b/packages/desktop-client/src/components/budget/envelope/BudgetMenu.tsx
index 35c865b911..8981f42251 100644
--- a/packages/desktop-client/src/components/budget/envelope/BudgetMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/BudgetMenu.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Menu } from '@actual-app/components/menu';
-import { useFeatureFlag } from '../../../hooks/useFeatureFlag';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
type BudgetMenuProps = Omit<
ComponentPropsWithoutRef<typeof Menu>,
diff --git a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
index bd2fe69b30..cecf9de3bb 100644
--- a/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/CoverMenu.tsx
@@ -7,10 +7,11 @@ import { View } from '@actual-app/components/view';
import { type CategoryEntity } from 'loot-core/types/models';
-import { useCategories } from '../../../hooks/useCategories';
import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete';
import { addToBeBudgetedGroup, removeCategoriesFromGroups } from '../util';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
type CoverMenuProps = {
showToBeBudgeted?: boolean;
categoryId?: CategoryEntity['id'];
diff --git a/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx b/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
index 149bfd7c46..87c627ce5a 100644
--- a/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/EnvelopeBudgetComponents.tsx
@@ -24,8 +24,6 @@ import {
type CategoryEntity,
} from 'loot-core/types/models';
-import { useContextMenu } from '../../../hooks/useContextMenu';
-import { useUndo } from '../../../hooks/useUndo';
import { type Binding, type SheetFields } from '../../spreadsheet';
import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { useSheetName } from '../../spreadsheet/useSheetName';
@@ -37,6 +35,9 @@ import { makeAmountGrey } from '../util';
import { BalanceMovementMenu } from './BalanceMovementMenu';
import { BudgetMenu } from './BudgetMenu';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
export function useEnvelopeSheetName<
FieldName extends SheetFields<'envelope-budget'>,
>(binding: Binding<'envelope-budget', FieldName>) {
diff --git a/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx b/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
index cbfc306dd5..9652e50330 100644
--- a/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/TransferMenu.tsx
@@ -10,10 +10,11 @@ import { evalArithmetic } from 'loot-core/shared/arithmetic';
import { integerToCurrency, amountToInteger } from 'loot-core/shared/util';
import { type CategoryEntity } from 'loot-core/types/models';
-import { useCategories } from '../../../hooks/useCategories';
import { CategoryAutocomplete } from '../../autocomplete/CategoryAutocomplete';
import { addToBeBudgetedGroup, removeCategoriesFromGroups } from '../util';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
type TransferMenuProps = {
categoryId?: CategoryEntity['id'];
initialAmount?: number;
diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
index 30016e9ce0..fc9d586b32 100644
--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Menu } from '@actual-app/components/menu';
-import { useFeatureFlag } from '../../../../hooks/useFeatureFlag';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
type BudgetMonthMenuProps = Omit<
ComponentPropsWithoutRef<typeof Menu>,
diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetSummary.tsx
index f0237a6a5d..8f46fcd43f 100644
--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetSummary.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetSummary.tsx
@@ -15,8 +15,6 @@ import { css } from '@emotion/css';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../../../hooks/useLocale';
-import { useUndo } from '../../../../hooks/useUndo';
import { NotesButton } from '../../../NotesButton';
import { NamespaceContext } from '../../../spreadsheet/NamespaceContext';
import { useEnvelopeBudget } from '../EnvelopeBudgetContext';
@@ -25,6 +23,9 @@ import { BudgetMonthMenu } from './BudgetMonthMenu';
import { ToBudget } from './ToBudget';
import { TotalsList } from './TotalsList';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type BudgetSummaryProps = {
month: string;
};
diff --git a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudget.tsx b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudget.tsx
index c3b788392d..15ebb4eb86 100644
--- a/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudget.tsx
+++ b/packages/desktop-client/src/components/budget/envelope/budgetsummary/ToBudget.tsx
@@ -10,7 +10,6 @@ import { View } from '@actual-app/components/view';
import { envelopeBudget } from 'loot-core/client/queries';
-import { useContextMenu } from '../../../../hooks/useContextMenu';
import { CoverMenu } from '../CoverMenu';
import { useEnvelopeSheetValue } from '../EnvelopeBudgetComponents';
import { HoldMenu } from '../HoldMenu';
@@ -19,6 +18,8 @@ import { TransferMenu } from '../TransferMenu';
import { ToBudgetAmount } from './ToBudgetAmount';
import { ToBudgetMenu } from './ToBudgetMenu';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+
type ToBudgetProps = {
month: string;
onBudgetAction: (month: string, action: string, arg?: unknown) => void;
diff --git a/packages/desktop-client/src/components/budget/goals/CategoryAutomationButton.tsx b/packages/desktop-client/src/components/budget/goals/CategoryAutomationButton.tsx
index b1a9be9d04..85b69cf683 100644
--- a/packages/desktop-client/src/components/budget/goals/CategoryAutomationButton.tsx
+++ b/packages/desktop-client/src/components/budget/goals/CategoryAutomationButton.tsx
@@ -7,9 +7,10 @@ import { theme } from '@actual-app/components/theme';
import { pushModal } from 'loot-core/client/modals/modalsSlice';
import { type Template } from 'loot-core/server/budget/types/templates';
-import { useFeatureFlag } from '../../../hooks/useFeatureFlag';
import { useDispatch } from '../../../redux';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+
type CategoryAutomationButtonProps = {
width?: number;
height?: number;
diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx
index 1ca982de38..30a0778691 100644
--- a/packages/desktop-client/src/components/budget/index.tsx
+++ b/packages/desktop-client/src/components/budget/index.tsx
@@ -23,11 +23,6 @@ import { useSpreadsheet } from 'loot-core/client/SpreadsheetProvider';
import { send } from 'loot-core/platform/client/fetch';
import * as monthUtils from 'loot-core/shared/months';
-import { useCategories } from '../../hooks/useCategories';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-import { useLocalPref } from '../../hooks/useLocalPref';
-import { useNavigate } from '../../hooks/useNavigate';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useDispatch } from '../../redux';
import { NamespaceContext } from '../spreadsheet/NamespaceContext';
@@ -38,6 +33,12 @@ import * as trackingBudget from './tracking/TrackingBudgetComponents';
import { TrackingBudgetProvider } from './tracking/TrackingBudgetContext';
import { prewarmAllMonths, prewarmMonth } from './util';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type TrackingReportComponents = {
SummaryComponent: typeof trackingBudget.BudgetSummary;
ExpenseCategoryComponent: typeof trackingBudget.ExpenseCategoryMonth;
diff --git a/packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx b/packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx
index 7144f40991..889c72ae26 100644
--- a/packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx
+++ b/packages/desktop-client/src/components/budget/tracking/BudgetMenu.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Menu } from '@actual-app/components/menu';
-import { useFeatureFlag } from '../../../hooks/useFeatureFlag';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
type BudgetMenuProps = Omit<
ComponentPropsWithoutRef<typeof Menu>,
diff --git a/packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx b/packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx
index 7330aad593..9b29e9dec9 100644
--- a/packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx
+++ b/packages/desktop-client/src/components/budget/tracking/TrackingBudgetComponents.tsx
@@ -26,7 +26,6 @@ import {
type CategoryGroupEntity,
} from 'loot-core/types/models';
-import { useUndo } from '../../../hooks/useUndo';
import { type Binding, type SheetFields } from '../../spreadsheet';
import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { useSheetValue } from '../../spreadsheet/useSheetValue';
@@ -37,6 +36,8 @@ import { makeAmountGrey } from '../util';
import { BalanceMenu } from './BalanceMenu';
import { BudgetMenu } from './BudgetMenu';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
export const useTrackingSheetValue = <
FieldName extends SheetFields<'tracking-budget'>,
>(
diff --git a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetMonthMenu.tsx b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetMonthMenu.tsx
index d1f941b21c..e780c31241 100644
--- a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetMonthMenu.tsx
+++ b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetMonthMenu.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { Menu } from '@actual-app/components/menu';
-import { useFeatureFlag } from '../../../../hooks/useFeatureFlag';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
type BudgetMonthMenuProps = Omit<
ComponentPropsWithoutRef<typeof Menu>,
diff --git a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetSummary.tsx
index 774d7af2ae..6a11fe10bb 100644
--- a/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetSummary.tsx
+++ b/packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetSummary.tsx
@@ -17,8 +17,6 @@ import { css } from '@emotion/css';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../../../hooks/useLocale';
-import { useUndo } from '../../../../hooks/useUndo';
import { NotesButton } from '../../../NotesButton';
import { NamespaceContext } from '../../../spreadsheet/NamespaceContext';
import { useTrackingBudget } from '../TrackingBudgetContext';
@@ -28,6 +26,9 @@ import { ExpenseTotal } from './ExpenseTotal';
import { IncomeTotal } from './IncomeTotal';
import { Saved } from './Saved';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type BudgetSummaryProps = {
month: string;
};
diff --git a/packages/desktop-client/src/components/common/Link.tsx b/packages/desktop-client/src/components/common/Link.tsx
index 67d2dd6fa6..da157e5f04 100644
--- a/packages/desktop-client/src/components/common/Link.tsx
+++ b/packages/desktop-client/src/components/common/Link.tsx
@@ -11,7 +11,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { css } from '@emotion/css';
-import { useNavigate } from '../../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
type TextLinkProps = {
style?: CSSProperties;
diff --git a/packages/desktop-client/src/components/common/Modal.tsx b/packages/desktop-client/src/components/common/Modal.tsx
index c45e560f91..aaec2e0f5b 100644
--- a/packages/desktop-client/src/components/common/Modal.tsx
+++ b/packages/desktop-client/src/components/common/Modal.tsx
@@ -31,7 +31,7 @@ import { View } from '@actual-app/components/view';
import { css } from '@emotion/css';
import { AutoTextSize } from 'auto-text-size';
-import { useModalState } from '../../hooks/useModalState';
+import { useModalState } from '@desktop-client/hooks/useModalState';
type ModalProps = ComponentPropsWithRef<typeof ReactAriaModal> & {
name: string;
diff --git a/packages/desktop-client/src/components/filters/FiltersMenu.jsx b/packages/desktop-client/src/components/filters/FiltersMenu.jsx
index cc81096ab1..b591053f8b 100644
--- a/packages/desktop-client/src/components/filters/FiltersMenu.jsx
+++ b/packages/desktop-client/src/components/filters/FiltersMenu.jsx
@@ -33,7 +33,6 @@ import {
} from 'loot-core/shared/rules';
import { titleFirst } from 'loot-core/shared/util';
-import { useDateFormat } from '../../hooks/useDateFormat';
import { GenericInput } from '../util/GenericInput';
import { CompactFiltersButton } from './CompactFiltersButton';
@@ -43,6 +42,8 @@ import { subfieldFromFilter } from './subfieldFromFilter';
import { subfieldToOptions } from './subfieldToOptions';
import { updateFilterReducer } from './updateFilterReducer';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+
let isDatepickerClick = false;
const filterFields = [
diff --git a/packages/desktop-client/src/components/manager/BudgetFileSelection.tsx b/packages/desktop-client/src/components/manager/BudgetFileSelection.tsx
index c93efbf86f..d6daace769 100644
--- a/packages/desktop-client/src/components/manager/BudgetFileSelection.tsx
+++ b/packages/desktop-client/src/components/manager/BudgetFileSelection.tsx
@@ -58,11 +58,12 @@ import {
type SyncedLocalFile,
} from 'loot-core/types/file';
-import { useInitialMount } from '../../hooks/useInitialMount';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useSelector, useDispatch } from '../../redux';
import { useMultiuserEnabled } from '../ServerContext';
+import { useInitialMount } from '@desktop-client/hooks/useInitialMount';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
function getFileDescription(file: File, t: (key: string) => string) {
if (file.state === 'unknown') {
return t(
diff --git a/packages/desktop-client/src/components/manager/ConfigServer.tsx b/packages/desktop-client/src/components/manager/ConfigServer.tsx
index 4235880f8e..24445ef232 100644
--- a/packages/desktop-client/src/components/manager/ConfigServer.tsx
+++ b/packages/desktop-client/src/components/manager/ConfigServer.tsx
@@ -15,14 +15,15 @@ import {
isElectron,
} from 'loot-core/shared/environment';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-import { useNavigate } from '../../hooks/useNavigate';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
import { useServerURL, useSetServerURL } from '../ServerContext';
import { Title } from './subscribe/common';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function ConfigServer() {
const { t } = useTranslation();
const dispatch = useDispatch();
diff --git a/packages/desktop-client/src/components/manager/ManagementApp.tsx b/packages/desktop-client/src/components/manager/ManagementApp.tsx
index 62363b805e..b73eb910c6 100644
--- a/packages/desktop-client/src/components/manager/ManagementApp.tsx
+++ b/packages/desktop-client/src/components/manager/ManagementApp.tsx
@@ -12,7 +12,6 @@ import { loggedIn } from 'loot-core/client/users/usersSlice';
import { ProtectedRoute } from '../../auth/ProtectedRoute';
import { Permissions } from '../../auth/types';
-import { useMetaThemeColor } from '../../hooks/useMetaThemeColor';
import { useSelector, useDispatch } from '../../redux';
import {
BackToFileListButton,
@@ -33,6 +32,8 @@ import { Login } from './subscribe/Login';
import { OpenIdCallback } from './subscribe/OpenIdCallback';
import { WelcomeScreen } from './WelcomeScreen';
+import { useMetaThemeColor } from '@desktop-client/hooks/useMetaThemeColor';
+
function Version() {
const version = useServerVersion();
diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
index 5e69dd0d2d..c1c4815ed8 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.tsx
@@ -11,7 +11,6 @@ import { View } from '@actual-app/components/view';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/platform/client/fetch';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { Link } from '../../common/Link';
import { useRefreshLoginMethods } from '../../ServerContext';
@@ -19,6 +18,8 @@ import { useRefreshLoginMethods } from '../../ServerContext';
import { useBootstrapped, Title } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function Bootstrap() {
const { t } = useTranslation();
const dispatch = useDispatch();
diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
index 5bb852cf2a..1f73499595 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.tsx
@@ -9,11 +9,11 @@ import { View } from '@actual-app/components/view';
import { send } from 'loot-core/platform/client/fetch';
-import { useNavigate } from '../../../hooks/useNavigate';
-
import { Title } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function ChangePassword() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/manager/subscribe/Error.tsx b/packages/desktop-client/src/components/manager/subscribe/Error.tsx
index ff50a5aaa8..2674f9e741 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Error.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Error.tsx
@@ -8,7 +8,7 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useNavigate } from '../../../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
function getErrorMessage(reason) {
switch (reason) {
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.tsx b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
index 37ec0eefef..9f0e03a5d2 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.tsx
@@ -20,7 +20,6 @@ import { send } from 'loot-core/platform/client/fetch';
import { isElectron } from 'loot-core/shared/environment';
import { type OpenIdConfig } from 'loot-core/types/models';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { warningBackground } from '../../../style/themes/dark';
import { Link } from '../../common/Link';
@@ -29,6 +28,8 @@ import { useAvailableLoginMethods, useLoginMethod } from '../../ServerContext';
import { useBootstrapped, Title } from './common';
import { OpenIdForm } from './OpenIdForm';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
function PasswordLogin({ setError, dispatch }) {
const [password, setPassword] = useState('');
const [loading, setLoading] = useState(false);
diff --git a/packages/desktop-client/src/components/manager/subscribe/common.tsx b/packages/desktop-client/src/components/manager/subscribe/common.tsx
index 35b7d54adc..6320b0298e 100644
--- a/packages/desktop-client/src/components/manager/subscribe/common.tsx
+++ b/packages/desktop-client/src/components/manager/subscribe/common.tsx
@@ -7,13 +7,14 @@ import { theme } from '@actual-app/components/theme';
import { send } from 'loot-core/platform/client/fetch';
import { type Handlers } from 'loot-core/types/handlers';
-import { useNavigate } from '../../../hooks/useNavigate';
import {
useSetLoginMethods,
useSetMultiuserEnabled,
useSetServerURL,
} from '../../ServerContext';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
// There are two URLs that dance with each other: `/login` and
// `/bootstrap`. Both of these URLs check the state of the the server
// and make sure the user is looking at the right page. For example,
diff --git a/packages/desktop-client/src/components/mobile/MobileBackButton.tsx b/packages/desktop-client/src/components/mobile/MobileBackButton.tsx
index cb9ce32206..8d72f86ee0 100644
--- a/packages/desktop-client/src/components/mobile/MobileBackButton.tsx
+++ b/packages/desktop-client/src/components/mobile/MobileBackButton.tsx
@@ -6,7 +6,7 @@ import { SvgCheveronLeft } from '@actual-app/components/icons/v1';
import { styles } from '@actual-app/components/styles';
import { Text } from '@actual-app/components/text';
-import { useNavigate } from '../../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
type MobileBackButtonProps = ComponentPropsWithoutRef<typeof Button>;
diff --git a/packages/desktop-client/src/components/mobile/accounts/Account.tsx b/packages/desktop-client/src/components/mobile/accounts/Account.tsx
index 0cf40217c9..75e747dbd6 100644
--- a/packages/desktop-client/src/components/mobile/accounts/Account.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/Account.tsx
@@ -1,11 +1,11 @@
import React from 'react';
import { useParams } from 'react-router-dom';
-import { useAccount } from '../../../hooks/useAccount';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
-
import { AccountTransactions } from './AccountTransactions';
+import { useAccount } from '@desktop-client/hooks/useAccount';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function Account() {
const [_numberFormat] = useSyncedPref('numberFormat');
const numberFormat = _numberFormat || 'comma-dot';
diff --git a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
index c4e5d5cdf3..ac9b414a0a 100644
--- a/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/AccountTransactions.tsx
@@ -41,16 +41,17 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { useAccountPreviewTransactions } from '../../../hooks/useAccountPreviewTransactions';
-import { useDateFormat } from '../../../hooks/useDateFormat';
-import { useFailedAccounts } from '../../../hooks/useFailedAccounts';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useSelector, useDispatch } from '../../../redux';
import { MobilePageHeader, Page } from '../../Page';
import { MobileBackButton } from '../MobileBackButton';
import { AddTransactionButton } from '../transactions/AddTransactionButton';
import { TransactionListWithBalances } from '../transactions/TransactionListWithBalances';
+import { useAccountPreviewTransactions } from '@desktop-client/hooks/useAccountPreviewTransactions';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useFailedAccounts } from '@desktop-client/hooks/useFailedAccounts';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function AccountTransactions({
account,
accountId,
diff --git a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
index fbc6d5f7db..1b5674e19d 100644
--- a/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
+++ b/packages/desktop-client/src/components/mobile/accounts/Accounts.tsx
@@ -33,11 +33,6 @@ import * as queries from 'loot-core/client/queries';
import { type AccountEntity } from 'loot-core/types/models';
import { moveAccount } from '../../../accounts/accountsSlice';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useFailedAccounts } from '../../../hooks/useFailedAccounts';
-import { useLocalPref } from '../../../hooks/useLocalPref';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch, useSelector } from '../../../redux';
import { makeAmountFullStyle } from '../../budget/util';
import { MobilePageHeader, Page } from '../../Page';
@@ -46,6 +41,12 @@ import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
import { MOBILE_NAV_HEIGHT } from '../MobileNavTabs';
import { PullToRefresh } from '../PullToRefresh';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useFailedAccounts } from '@desktop-client/hooks/useFailedAccounts';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type AccountHeaderProps<SheetFieldName extends SheetFields<'account'>> = {
id: string;
name: string;
diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx b/packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
index 7c9e20c7af..09760349d7 100644
--- a/packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/BudgetCell.tsx
@@ -11,9 +11,6 @@ import { pushModal } from 'loot-core/client/modals/modalsSlice';
import { integerToCurrency } from 'loot-core/shared/util';
import { type CategoryEntity } from 'loot-core/types/models';
-import { useNotes } from '../../../hooks/useNotes';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
-import { useUndo } from '../../../hooks/useUndo';
import { useDispatch } from '../../../redux';
import { makeAmountGrey } from '../../budget/util';
import { PrivacyFilter } from '../../PrivacyFilter';
@@ -23,6 +20,10 @@ import { useFormat } from '../../spreadsheet/useFormat';
import { getColumnWidth, PILL_STYLE } from './BudgetTable';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type BudgetCellProps<
SheetFieldName extends SheetFields<'envelope-budget' | 'tracking-budget'>,
> = ComponentPropsWithoutRef<
diff --git a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
index c8124add43..83fa0e169f 100644
--- a/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
+++ b/packages/desktop-client/src/components/mobile/budget/BudgetTable.jsx
@@ -32,13 +32,6 @@ import {
import * as monthUtils from 'loot-core/shared/months';
import { groupById } from 'loot-core/shared/util';
-import { useCategories } from '../../../hooks/useCategories';
-import { useLocale } from '../../../hooks/useLocale';
-import { useLocalPref } from '../../../hooks/useLocalPref';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useOverspentCategories } from '../../../hooks/useOverspentCategories';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
-import { useUndo } from '../../../hooks/useUndo';
import { useDispatch } from '../../../redux';
import { MobilePageHeader, Page } from '../../Page';
import { PrivacyFilter } from '../../PrivacyFilter';
@@ -51,6 +44,14 @@ import { PullToRefresh } from '../PullToRefresh';
import { ExpenseGroupList } from './ExpenseGroupList';
import { IncomeGroup } from './IncomeGroup';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useOverspentCategories } from '@desktop-client/hooks/useOverspentCategories';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
export const ROW_HEIGHT = 50;
export const PILL_STYLE = {
diff --git a/packages/desktop-client/src/components/mobile/budget/Category.tsx b/packages/desktop-client/src/components/mobile/budget/Category.tsx
index 18d2d4ba8e..633b0efb63 100644
--- a/packages/desktop-client/src/components/mobile/budget/Category.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/Category.tsx
@@ -3,11 +3,11 @@ import { useParams, useSearchParams } from 'react-router-dom';
import * as monthUtils from 'loot-core/shared/months';
-import { useCategories } from '../../../hooks/useCategories';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
-
import { CategoryTransactions } from './CategoryTransactions';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function Category() {
const [_numberFormat] = useSyncedPref('numberFormat');
const numberFormat = _numberFormat || 'comma-dot';
diff --git a/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx b/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx
index d706a48d1b..4e25efb841 100644
--- a/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/CategoryTransactions.tsx
@@ -18,15 +18,16 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { useDateFormat } from '../../../hooks/useDateFormat';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { MobilePageHeader, Page } from '../../Page';
import { MobileBackButton } from '../MobileBackButton';
import { AddTransactionButton } from '../transactions/AddTransactionButton';
import { TransactionListWithBalances } from '../transactions/TransactionListWithBalances';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
type CategoryTransactionsProps = {
category: CategoryEntity;
month: string;
diff --git a/packages/desktop-client/src/components/mobile/budget/IncomeGroup.tsx b/packages/desktop-client/src/components/mobile/budget/IncomeGroup.tsx
index 26a6fb3a0c..3576d57668 100644
--- a/packages/desktop-client/src/components/mobile/budget/IncomeGroup.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/IncomeGroup.tsx
@@ -17,7 +17,6 @@ import { envelopeBudget, trackingBudget } from 'loot-core/client/queries';
import * as monthUtils from 'loot-core/shared/months';
import { type CategoryGroupEntity } from 'loot-core/types/models';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { PrivacyFilter } from '../../PrivacyFilter';
import { CellValue } from '../../spreadsheet/CellValue';
import { useFormat } from '../../spreadsheet/useFormat';
@@ -25,6 +24,8 @@ import { useFormat } from '../../spreadsheet/useFormat';
import { getColumnWidth, ROW_HEIGHT } from './BudgetTable';
import { IncomeCategoryList } from './IncomeCategoryList';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type IncomeGroupProps = {
categoryGroup: CategoryGroupEntity;
month: string;
diff --git a/packages/desktop-client/src/components/mobile/budget/index.tsx b/packages/desktop-client/src/components/mobile/budget/index.tsx
index fa600ebe9a..2bd3a3648c 100644
--- a/packages/desktop-client/src/components/mobile/budget/index.tsx
+++ b/packages/desktop-client/src/components/mobile/budget/index.tsx
@@ -20,10 +20,6 @@ import { useSpreadsheet } from 'loot-core/client/SpreadsheetProvider';
import { send } from 'loot-core/platform/client/fetch';
import * as monthUtils from 'loot-core/shared/months';
-import { useCategories } from '../../../hooks/useCategories';
-import { useLocale } from '../../../hooks/useLocale';
-import { useLocalPref } from '../../../hooks/useLocalPref';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { prewarmMonth } from '../../budget/util';
import { NamespaceContext } from '../../spreadsheet/NamespaceContext';
@@ -31,6 +27,11 @@ import { SyncRefresh } from '../../SyncRefresh';
import { BudgetTable } from './BudgetTable';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
function isBudgetType(input?: string): input is 'rollover' | 'report' {
return ['rollover', 'report'].includes(input);
}
diff --git a/packages/desktop-client/src/components/mobile/transactions/AddTransactionButton.tsx b/packages/desktop-client/src/components/mobile/transactions/AddTransactionButton.tsx
index aa36e03681..7dbe638fd0 100644
--- a/packages/desktop-client/src/components/mobile/transactions/AddTransactionButton.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/AddTransactionButton.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { SvgAdd } from '@actual-app/components/icons/v1';
-import { useNavigate } from '../../../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
type AddTransactionButtonProps = {
to?: string;
diff --git a/packages/desktop-client/src/components/mobile/transactions/FocusableAmountInput.tsx b/packages/desktop-client/src/components/mobile/transactions/FocusableAmountInput.tsx
index 5c850606bb..59344f0c38 100644
--- a/packages/desktop-client/src/components/mobile/transactions/FocusableAmountInput.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/FocusableAmountInput.tsx
@@ -21,10 +21,11 @@ import {
currencyToAmount,
} from 'loot-core/shared/util';
-import { useMergedRefs } from '../../../hooks/useMergedRefs';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { makeAmountFullStyle } from '../../budget/util';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type AmountInputProps = {
value: number;
focused?: boolean;
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx
index f9da1821c5..c9462dc5e5 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionEdit.jsx
@@ -56,16 +56,6 @@ import {
groupById,
} from 'loot-core/shared/util';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useDateFormat } from '../../../hooks/useDateFormat';
-import { useInitialMount } from '../../../hooks/useInitialMount';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePayees } from '../../../hooks/usePayees';
-import {
- SingleActiveEditFormProvider,
- useSingleActiveEditForm,
-} from '../../../hooks/useSingleActiveEditForm';
import { useSelector, useDispatch } from '../../../redux';
import { MobilePageHeader, Page } from '../../Page';
import { AmountInput } from '../../util/AmountInput';
@@ -75,6 +65,17 @@ import { getPrettyPayee } from '../utils';
import { FocusableAmountInput } from './FocusableAmountInput';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useInitialMount } from '@desktop-client/hooks/useInitialMount';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import {
+ SingleActiveEditFormProvider,
+ useSingleActiveEditForm,
+} from '@desktop-client/hooks/useSingleActiveEditForm';
+
function getFieldName(transactionId, field) {
return `${field}-${transactionId}`;
}
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx
index 1622fada96..cba1196114 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionList.tsx
@@ -39,23 +39,24 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePayees } from '../../../hooks/usePayees';
-import {
- useSelectedDispatch,
- useSelectedItems,
-} from '../../../hooks/useSelected';
-import { useTransactionBatchActions } from '../../../hooks/useTransactionBatchActions';
-import { useUndo } from '../../../hooks/useUndo';
import { useDispatch } from '../../../redux';
import { useScrollListener } from '../../ScrollProvider';
import { FloatingActionBar } from '../FloatingActionBar';
import { TransactionListItem } from './TransactionListItem';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import {
+ useSelectedDispatch,
+ useSelectedItems,
+} from '@desktop-client/hooks/useSelected';
+import { useTransactionBatchActions } from '@desktop-client/hooks/useTransactionBatchActions';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
const NOTIFICATION_BOTTOM_INSET = 75;
type LoadingProps = {
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
index 66112ed390..c3490219b3 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListItem.tsx
@@ -37,15 +37,16 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { useAccount } from '../../../hooks/useAccount';
-import { useCategories } from '../../../hooks/useCategories';
-import { useDisplayPayee } from '../../../hooks/useDisplayPayee';
-import { usePayee } from '../../../hooks/usePayee';
import { useSelector } from '../../../redux';
import { makeAmountFullStyle } from '../../budget/util';
import { lookupName, Status } from './TransactionEdit';
+import { useAccount } from '@desktop-client/hooks/useAccount';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDisplayPayee } from '@desktop-client/hooks/useDisplayPayee';
+import { usePayee } from '@desktop-client/hooks/usePayee';
+
const ROW_HEIGHT = 60;
const getTextStyle = ({
diff --git a/packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx b/packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx
index 3390119aec..cd67eead2e 100644
--- a/packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx
+++ b/packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx
@@ -11,7 +11,6 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { SelectedProvider, useSelected } from '../../../hooks/useSelected';
import { Search } from '../../common/Search';
import type { Binding, SheetNames, SheetFields } from '../../spreadsheet';
import { CellValue, CellValueText } from '../../spreadsheet/CellValue';
@@ -20,6 +19,11 @@ import { PullToRefresh } from '../PullToRefresh';
import { TransactionList } from './TransactionList';
+import {
+ SelectedProvider,
+ useSelected,
+} from '@desktop-client/hooks/useSelected';
+
type TransactionSearchInputProps = {
placeholder: string;
onSearch: TransactionListWithBalancesProps['onSearch'];
diff --git a/packages/desktop-client/src/components/modals/AccountMenuModal.tsx b/packages/desktop-client/src/components/modals/AccountMenuModal.tsx
index 4702079b09..fb79e198dc 100644
--- a/packages/desktop-client/src/components/modals/AccountMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/AccountMenuModal.tsx
@@ -23,9 +23,6 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import { type AccountEntity } from 'loot-core/types/models';
-import { useAccount } from '../../hooks/useAccount';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useNotes } from '../../hooks/useNotes';
import {
Modal,
ModalCloseButton,
@@ -35,6 +32,10 @@ import {
import { Notes } from '../Notes';
import { validateAccountName } from '../util/accountValidation';
+import { useAccount } from '@desktop-client/hooks/useAccount';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
type AccountMenuModalProps = Extract<
ModalType,
{ name: 'account-menu' }
diff --git a/packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx b/packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx
index de57c2d224..70ac0958ed 100644
--- a/packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetFileSelectionModal.tsx
@@ -4,11 +4,12 @@ import { useTranslation } from 'react-i18next';
import { Text } from '@actual-app/components/text';
import { View } from '@actual-app/components/view';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useSelector } from '../../redux';
import { Modal, ModalHeader, ModalCloseButton } from '../common/Modal';
import { BudgetFileSelection } from '../manager/BudgetFileSelection';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
export function BudgetFileSelectionModal() {
const { t } = useTranslation();
const [id] = useMetadataPref('id');
diff --git a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
index 22b36fb992..a9978c1e20 100644
--- a/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/BudgetPageMenuModal.tsx
@@ -10,9 +10,10 @@ import { theme } from '@actual-app/components/theme';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useLocalPref } from '../../hooks/useLocalPref';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+
type BudgetPageMenuModalProps = Extract<
ModalType,
{ name: 'budget-page-menu' }
diff --git a/packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx b/packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx
index 8d574ec08b..6bffc17db0 100644
--- a/packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/CategoryGroupMenuModal.tsx
@@ -26,8 +26,6 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useCategories } from '../../hooks/useCategories';
-import { useNotes } from '../../hooks/useNotes';
import {
Modal,
ModalCloseButton,
@@ -36,6 +34,9 @@ import {
} from '../common/Modal';
import { Notes } from '../Notes';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
type CategoryGroupMenuModalProps = Extract<
ModalType,
{ name: 'category-group-menu' }
diff --git a/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx b/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx
index 494a0aeaaf..a3f9824dcf 100644
--- a/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/CategoryMenuModal.tsx
@@ -20,9 +20,6 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useCategory } from '../../hooks/useCategory';
-import { useCategoryGroup } from '../../hooks/useCategoryGroup';
-import { useNotes } from '../../hooks/useNotes';
import {
Modal,
ModalCloseButton,
@@ -31,6 +28,10 @@ import {
} from '../common/Modal';
import { Notes } from '../Notes';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+import { useCategoryGroup } from '@desktop-client/hooks/useCategoryGroup';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
type CategoryMenuModalProps = Extract<
ModalType,
{ name: 'category-menu' }
diff --git a/packages/desktop-client/src/components/modals/CloseAccountModal.tsx b/packages/desktop-client/src/components/modals/CloseAccountModal.tsx
index eb98d62448..9a6dae9db6 100644
--- a/packages/desktop-client/src/components/modals/CloseAccountModal.tsx
+++ b/packages/desktop-client/src/components/modals/CloseAccountModal.tsx
@@ -21,14 +21,15 @@ import { integerToCurrency } from 'loot-core/shared/util';
import { type AccountEntity } from 'loot-core/types/models';
import { type TransObjectLiteral } from 'loot-core/types/util';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useCategories } from '../../hooks/useCategories';
import { useDispatch } from '../../redux';
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
import { Link } from '../common/Link';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
function needsCategory(
account: AccountEntity,
currentTransfer: string,
diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx b/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx
index 618a28e6ad..8abc48f239 100644
--- a/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx
+++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDeleteModal.tsx
@@ -10,10 +10,11 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useCategories } from '../../hooks/useCategories';
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
type ConfirmCategoryDeleteModalProps = Extract<
ModalType,
{ name: 'confirm-category-delete' }
diff --git a/packages/desktop-client/src/components/modals/CoverModal.tsx b/packages/desktop-client/src/components/modals/CoverModal.tsx
index 6353a1945b..7a00562237 100644
--- a/packages/desktop-client/src/components/modals/CoverModal.tsx
+++ b/packages/desktop-client/src/components/modals/CoverModal.tsx
@@ -10,7 +10,6 @@ import {
pushModal,
} from 'loot-core/client/modals/modalsSlice';
-import { useCategories } from '../../hooks/useCategories';
import { useDispatch } from '../../redux';
import {
addToBeBudgetedGroup,
@@ -19,6 +18,8 @@ import {
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { FieldLabel, TapField } from '../mobile/MobileForms';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
type CoverModalProps = Extract<ModalType, { name: 'cover' }>['options'];
export function CoverModal({
diff --git a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
index 3ddb6e456e..4a795982e4 100644
--- a/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
+++ b/packages/desktop-client/src/components/modals/CreateAccountModal.tsx
@@ -22,17 +22,18 @@ import { send } from 'loot-core/platform/client/fetch';
import { useAuth } from '../../auth/AuthProvider';
import { Permissions } from '../../auth/types';
import { authorizeBank } from '../../gocardless';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
-import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus';
-import { usePluggyAiStatus } from '../../hooks/usePluggyAiStatus';
-import { useSimpleFinStatus } from '../../hooks/useSimpleFinStatus';
-import { useSyncServerStatus } from '../../hooks/useSyncServerStatus';
import { useDispatch } from '../../redux';
import { Warning } from '../alerts';
import { Link } from '../common/Link';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { useMultiuserEnabled } from '../ServerContext';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+import { useGoCardlessStatus } from '@desktop-client/hooks/useGoCardlessStatus';
+import { usePluggyAiStatus } from '@desktop-client/hooks/usePluggyAiStatus';
+import { useSimpleFinStatus } from '@desktop-client/hooks/useSimpleFinStatus';
+import { useSyncServerStatus } from '@desktop-client/hooks/useSyncServerStatus';
+
type CreateAccountModalProps = Extract<
ModalType,
{ name: 'add-account' }
diff --git a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
index e7dc14d3be..015a3aeaeb 100644
--- a/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
+++ b/packages/desktop-client/src/components/modals/CreateLocalAccountModal.tsx
@@ -16,8 +16,6 @@ import { closeModal } from 'loot-core/client/modals/modalsSlice';
import { createAccount } from 'loot-core/client/queries/queriesSlice';
import { toRelaxedNumber } from 'loot-core/shared/util';
-import * as useAccounts from '../../hooks/useAccounts';
-import { useNavigate } from '../../hooks/useNavigate';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
import {
@@ -30,6 +28,9 @@ import {
import { Checkbox } from '../forms';
import { validateAccountName } from '../util/accountValidation';
+import * as useAccounts from '@desktop-client/hooks/useAccounts';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function CreateLocalAccountModal() {
const { t } = useTranslation();
const navigate = useNavigate();
diff --git a/packages/desktop-client/src/components/modals/EditFieldModal.tsx b/packages/desktop-client/src/components/modals/EditFieldModal.tsx
index a1164dac98..4e04f1b11f 100644
--- a/packages/desktop-client/src/components/modals/EditFieldModal.tsx
+++ b/packages/desktop-client/src/components/modals/EditFieldModal.tsx
@@ -17,11 +17,12 @@ import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import { currentDay, dayFromDate } from 'loot-core/shared/months';
import { amountToInteger } from 'loot-core/shared/util';
-import { useDateFormat } from '../../hooks/useDateFormat';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { SectionLabel } from '../forms';
import { DateSelect } from '../select/DateSelect';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+
const itemStyle: CSSProperties = {
fontSize: 17,
fontWeight: 400,
diff --git a/packages/desktop-client/src/components/modals/EditRuleModal.jsx b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
index c812356dff..05ab010455 100644
--- a/packages/desktop-client/src/components/modals/EditRuleModal.jsx
+++ b/packages/desktop-client/src/components/modals/EditRuleModal.jsx
@@ -48,9 +48,6 @@ import {
amountToInteger,
} from 'loot-core/shared/util';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
-import { useSelected, SelectedProvider } from '../../hooks/useSelected';
import { useDispatch } from '../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { StatusBadge } from '../schedules/StatusBadge';
@@ -59,6 +56,13 @@ import { BetweenAmountInput } from '../util/AmountInput';
import { DisplayId } from '../util/DisplayId';
import { GenericInput } from '../util/GenericInput';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+import {
+ useSelected,
+ SelectedProvider,
+} from '@desktop-client/hooks/useSelected';
+
function updateValue(array, value, update) {
return array.map(v => (v === value ? update() : v));
}
diff --git a/packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx
index e96eb14fc2..b6e31e0809 100644
--- a/packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/EnvelopeBalanceMenuModal.tsx
@@ -9,7 +9,6 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import { envelopeBudget } from 'loot-core/client/queries';
-import { useCategory } from '../../hooks/useCategory';
import {
BalanceWithCarryover,
CarryoverIndicator,
@@ -23,6 +22,8 @@ import {
} from '../common/Modal';
import { CellValueText } from '../spreadsheet/CellValue';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+
type EnvelopeBalanceMenuModalProps = Omit<
Extract<ModalType, { name: 'envelope-balance-menu' }>['options'],
'month'
diff --git a/packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx
index 3f9c650fdd..aac49464bb 100644
--- a/packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/EnvelopeBudgetMenuModal.tsx
@@ -11,7 +11,6 @@ import * as Platform from 'loot-core/client/platform';
import { envelopeBudget } from 'loot-core/client/queries';
import { amountToInteger, integerToAmount } from 'loot-core/shared/util';
-import { useCategory } from '../../hooks/useCategory';
import { BudgetMenu } from '../budget/envelope/BudgetMenu';
import { useEnvelopeSheetValue } from '../budget/envelope/EnvelopeBudgetComponents';
import {
@@ -22,6 +21,8 @@ import {
} from '../common/Modal';
import { FocusableAmountInput } from '../mobile/transactions/FocusableAmountInput';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+
type EnvelopeBudgetMenuModalProps = Omit<
Extract<ModalType, { name: 'envelope-budget-menu' }>['options'],
'month'
diff --git a/packages/desktop-client/src/components/modals/EnvelopeBudgetMonthMenuModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBudgetMonthMenuModal.tsx
index 6d924b0028..676f1f74c6 100644
--- a/packages/desktop-client/src/components/modals/EnvelopeBudgetMonthMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/EnvelopeBudgetMonthMenuModal.tsx
@@ -16,13 +16,14 @@ import { css } from '@emotion/css';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../hooks/useLocale';
-import { useNotes } from '../../hooks/useNotes';
-import { useUndo } from '../../hooks/useUndo';
import { BudgetMonthMenu } from '../budget/envelope/budgetsummary/BudgetMonthMenu';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { Notes } from '../Notes';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type EnvelopeBudgetMonthMenuModalProps = Extract<
ModalType,
{ name: 'envelope-budget-month-menu' }
diff --git a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
index 8399e99db8..95d0615be3 100644
--- a/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
+++ b/packages/desktop-client/src/components/modals/EnvelopeBudgetSummaryModal.tsx
@@ -12,9 +12,6 @@ import { envelopeBudget } from 'loot-core/client/queries';
import { format, sheetForMonth, prevMonth } from 'loot-core/shared/months';
import { groupById, integerToCurrency } from 'loot-core/shared/util';
-import { useCategories } from '../../hooks/useCategories';
-import { useLocale } from '../../hooks/useLocale';
-import { useUndo } from '../../hooks/useUndo';
import { useDispatch } from '../../redux';
import { ToBudgetAmount } from '../budget/envelope/budgetsummary/ToBudgetAmount';
import { TotalsList } from '../budget/envelope/budgetsummary/TotalsList';
@@ -22,6 +19,10 @@ import { useEnvelopeSheetValue } from '../budget/envelope/EnvelopeBudgetComponen
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { NamespaceContext } from '../spreadsheet/NamespaceContext';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type EnvelopeBudgetSummaryModalProps = Extract<
ModalType,
{ name: 'envelope-budget-summary' }
diff --git a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
index 3acc485942..e6bdfbd0dc 100644
--- a/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
+++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsgModal.tsx
@@ -18,7 +18,6 @@ import {
type GoCardlessToken,
} from 'loot-core/types/models';
-import { useGoCardlessStatus } from '../../hooks/useGoCardlessStatus';
import { useDispatch } from '../../redux';
import { Error, Warning } from '../alerts';
import { Autocomplete } from '../autocomplete/Autocomplete';
@@ -27,6 +26,8 @@ import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { FormField, FormLabel } from '../forms';
import { COUNTRY_OPTIONS } from '../util/countries';
+import { useGoCardlessStatus } from '@desktop-client/hooks/useGoCardlessStatus';
+
function useAvailableBanks(country: string) {
const [banks, setBanks] = useState<GoCardlessInstitution[]>([]);
const [isLoading, setIsLoading] = useState(false);
diff --git a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx
index 00b264c13f..bd306be5c3 100644
--- a/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx
+++ b/packages/desktop-client/src/components/modals/ImportTransactionsModal/ImportTransactionsModal.jsx
@@ -18,9 +18,6 @@ import {
import { send } from 'loot-core/platform/client/fetch';
import { amountToInteger } from 'loot-core/shared/util';
-import { useCategories } from '../../../hooks/useCategories';
-import { useDateFormat } from '../../../hooks/useDateFormat';
-import { useSyncedPrefs } from '../../../hooks/useSyncedPrefs';
import { useDispatch } from '../../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { SectionLabel } from '../../forms';
@@ -40,6 +37,10 @@ import {
stripCsvImportTransaction,
} from './utils';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useSyncedPrefs } from '@desktop-client/hooks/useSyncedPrefs';
+
function getFileType(filepath) {
const m = filepath.match(/\.([^.]*)$/);
if (!m) return 'ofx';
diff --git a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
index 887fe73903..ba07387810 100644
--- a/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
+++ b/packages/desktop-client/src/components/modals/LoadBackupModal.tsx
@@ -12,11 +12,12 @@ import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import { send, listen } from 'loot-core/platform/client/fetch';
import { type Backup } from 'loot-core/server/budgetfiles/backups';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useDispatch } from '../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { Row, Cell } from '../table';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
type BackupTableProps = {
backups: Backup[];
onSelect: (backupId: string) => void;
diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
index d5e5aebb63..86f520d588 100644
--- a/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
+++ b/packages/desktop-client/src/components/modals/MergeUnusedPayeesModal.tsx
@@ -14,11 +14,12 @@ import {
import { send } from 'loot-core/platform/client/fetch';
import { type PayeeEntity } from 'loot-core/types/models';
-import { usePayees } from '../../hooks/usePayees';
import { useSelector, useDispatch } from '../../redux';
import { Information } from '../alerts';
import { Modal, ModalButtons } from '../common/Modal';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
const highlightStyle = { color: theme.pageTextPositive };
type MergeUnusedPayeesModalProps = Extract<
diff --git a/packages/desktop-client/src/components/modals/NotesModal.tsx b/packages/desktop-client/src/components/modals/NotesModal.tsx
index b3d315dcfd..26bc464a4b 100644
--- a/packages/desktop-client/src/components/modals/NotesModal.tsx
+++ b/packages/desktop-client/src/components/modals/NotesModal.tsx
@@ -8,10 +8,11 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useNotes } from '../../hooks/useNotes';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { Notes } from '../Notes';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
type NotesModalProps = Extract<ModalType, { name: 'notes' }>['options'];
export function NotesModal({ id, name, onSave }: NotesModalProps) {
diff --git a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx
index 455c53f031..9d83d2e54e 100644
--- a/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx
+++ b/packages/desktop-client/src/components/modals/PayeeAutocompleteModal.tsx
@@ -6,9 +6,6 @@ import { theme } from '@actual-app/components/theme';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useNavigate } from '../../hooks/useNavigate';
-import { usePayees } from '../../hooks/usePayees';
import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete';
import {
ModalCloseButton,
@@ -17,6 +14,10 @@ import {
ModalHeader,
} from '../common/Modal';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
type PayeeAutocompleteModalProps = Extract<
ModalType,
{ name: 'payee-autocomplete' }
diff --git a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
index 9e46a7e030..edf864ce54 100644
--- a/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/ScheduledTransactionMenuModal.tsx
@@ -20,7 +20,6 @@ import {
extractScheduleConds,
} from 'loot-core/shared/schedules';
-import { useLocale } from '../../hooks/useLocale';
import {
Modal,
ModalCloseButton,
@@ -28,6 +27,8 @@ import {
ModalTitle,
} from '../common/Modal';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type ScheduledTransactionMenuModalProps = Extract<
ModalType,
{ name: 'scheduled-transaction-menu' }
diff --git a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
index 45b0e2343b..1e90643750 100644
--- a/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
+++ b/packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.jsx
@@ -15,13 +15,14 @@ import {
linkAccountSimpleFin,
unlinkAccount,
} from '../../accounts/accountsSlice';
-import { useAccounts } from '../../hooks/useAccounts';
import { useDispatch } from '../../redux';
import { Autocomplete } from '../autocomplete/Autocomplete';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { PrivacyFilter } from '../PrivacyFilter';
import { TableHeader, Table, Row, Field } from '../table';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+
function useAddBudgetAccountOptions() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx b/packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx
index 200bd5202d..4cd6ddf47a 100644
--- a/packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/TrackingBalanceMenuModal.tsx
@@ -9,7 +9,6 @@ import { View } from '@actual-app/components/view';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import { trackingBudget } from 'loot-core/client/queries';
-import { useCategory } from '../../hooks/useCategory';
import {
BalanceWithCarryover,
CarryoverIndicator,
@@ -23,6 +22,8 @@ import {
} from '../common/Modal';
import { CellValueText } from '../spreadsheet/CellValue';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+
type TrackingBalanceMenuModalProps = Omit<
Extract<ModalType, { name: 'tracking-balance-menu' }>['options'],
'month'
diff --git a/packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx b/packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx
index 5d3a99621d..cefbd677d5 100644
--- a/packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/TrackingBudgetMenuModal.tsx
@@ -11,7 +11,6 @@ import * as Platform from 'loot-core/client/platform';
import { trackingBudget } from 'loot-core/client/queries';
import { amountToInteger, integerToAmount } from 'loot-core/shared/util';
-import { useCategory } from '../../hooks/useCategory';
import { BudgetMenu } from '../budget/tracking/BudgetMenu';
import { useTrackingSheetValue } from '../budget/tracking/TrackingBudgetComponents';
import {
@@ -22,6 +21,8 @@ import {
} from '../common/Modal';
import { FocusableAmountInput } from '../mobile/transactions/FocusableAmountInput';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+
type TrackingBudgetMenuModalProps = Omit<
Extract<ModalType, { name: 'tracking-budget-menu' }>['options'],
'month'
diff --git a/packages/desktop-client/src/components/modals/TrackingBudgetMonthMenuModal.tsx b/packages/desktop-client/src/components/modals/TrackingBudgetMonthMenuModal.tsx
index d40004f50f..01cf28c00c 100644
--- a/packages/desktop-client/src/components/modals/TrackingBudgetMonthMenuModal.tsx
+++ b/packages/desktop-client/src/components/modals/TrackingBudgetMonthMenuModal.tsx
@@ -16,13 +16,14 @@ import { css } from '@emotion/css';
import { type Modal as ModalType } from 'loot-core/client/modals/modalsSlice';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../hooks/useLocale';
-import { useNotes } from '../../hooks/useNotes';
-import { useUndo } from '../../hooks/useUndo';
import { BudgetMonthMenu } from '../budget/tracking/budgetsummary/BudgetMonthMenu';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { Notes } from '../Notes';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
type TrackingBudgetMonthMenuModalProps = Extract<
ModalType,
{ name: 'tracking-budget-month-menu' }
diff --git a/packages/desktop-client/src/components/modals/TransferModal.tsx b/packages/desktop-client/src/components/modals/TransferModal.tsx
index a0ed2c883f..b56ea35bfe 100644
--- a/packages/desktop-client/src/components/modals/TransferModal.tsx
+++ b/packages/desktop-client/src/components/modals/TransferModal.tsx
@@ -11,7 +11,6 @@ import {
pushModal,
} from 'loot-core/client/modals/modalsSlice';
-import { useCategories } from '../../hooks/useCategories';
import { useDispatch } from '../../redux';
import {
addToBeBudgetedGroup,
@@ -21,6 +20,8 @@ import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { FieldLabel, TapField } from '../mobile/MobileForms';
import { AmountInput } from '../util/AmountInput';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+
type TransferModalProps = Extract<ModalType, { name: 'transfer' }>['options'];
export function TransferModal({
diff --git a/packages/desktop-client/src/components/modals/TransferOwnership.tsx b/packages/desktop-client/src/components/modals/TransferOwnership.tsx
index 9a4a1741e2..969aebfcd7 100644
--- a/packages/desktop-client/src/components/modals/TransferOwnership.tsx
+++ b/packages/desktop-client/src/components/modals/TransferOwnership.tsx
@@ -21,11 +21,12 @@ import { type Budget } from 'loot-core/types/budget';
import { type RemoteFile, type SyncedLocalFile } from 'loot-core/types/file';
import { type Handlers } from 'loot-core/types/handlers';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useDispatch, useSelector } from '../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { FormField, FormLabel } from '../forms';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
type TransferOwnershipProps = Extract<
ModalType,
{ name: 'transfer-ownership' }
diff --git a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
index cb818789b8..598d1be0fa 100644
--- a/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ConfirmChangeDocumentDir.tsx
@@ -9,12 +9,13 @@ import { View } from '@actual-app/components/view';
import { addNotification } from 'loot-core/client/notifications/notificationsSlice';
-import { useGlobalPref } from '../../../hooks/useGlobalPref';
import { useDispatch } from '../../../redux';
import { Information } from '../../alerts';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Checkbox } from '../../forms';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
function DirectoryDisplay({ directory }: { directory: string }) {
return (
<View style={{ flexDirection: 'row', gap: '0.5rem', width: '100%' }}>
diff --git a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
index 7ed4d983b9..79f63920ee 100644
--- a/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/FilesSettingsModal.tsx
@@ -11,10 +11,11 @@ import { View } from '@actual-app/components/view';
import { loadAllFiles } from 'loot-core/client/budgets/budgetsSlice';
import { pushModal } from 'loot-core/client/modals/modalsSlice';
-import { useGlobalPref } from '../../../hooks/useGlobalPref';
import { useDispatch } from '../../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
function FileLocationSettings() {
const [documentDir, _setDocumentDirPref] = useGlobalPref('documentDir');
const [_documentDirChanged, setDirChanged] = useState(false);
diff --git a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
index 7488a99c09..7769d93a94 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportActualModal.tsx
@@ -11,10 +11,11 @@ import { View } from '@actual-app/components/view';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
function getErrorMessage(error: string): string {
switch (error) {
case 'parse-error':
diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
index 15c4e33f39..9ad6a1263c 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB4Modal.tsx
@@ -11,10 +11,11 @@ import { View } from '@actual-app/components/view';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
function getErrorMessage(error: string): string {
switch (error) {
case 'not-ynab4':
diff --git a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
index 4fe7a52d8c..2a6852ad3e 100644
--- a/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
+++ b/packages/desktop-client/src/components/modals/manager/ImportYNAB5Modal.tsx
@@ -11,11 +11,12 @@ import { View } from '@actual-app/components/view';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { Link } from '../../common/Link';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
function getErrorMessage(error: string): string {
switch (error) {
case 'parse-error':
diff --git a/packages/desktop-client/src/components/payees/CategoryLearning.tsx b/packages/desktop-client/src/components/payees/CategoryLearning.tsx
index f6dc054bd0..653d827213 100644
--- a/packages/desktop-client/src/components/payees/CategoryLearning.tsx
+++ b/packages/desktop-client/src/components/payees/CategoryLearning.tsx
@@ -4,10 +4,11 @@ import { Trans, useTranslation } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { Paragraph } from '@actual-app/components/paragraph';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { Link } from '../common/Link';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function CategoryLearning() {
const { t } = useTranslation();
const [learnCategories = 'true', setLearnCategories] =
diff --git a/packages/desktop-client/src/components/payees/ManagePayees.tsx b/packages/desktop-client/src/components/payees/ManagePayees.tsx
index 8d5773c7ce..1370ad2ecf 100644
--- a/packages/desktop-client/src/components/payees/ManagePayees.tsx
+++ b/packages/desktop-client/src/components/payees/ManagePayees.tsx
@@ -19,12 +19,6 @@ import { getNormalisedString } from 'loot-core/shared/normalisation';
import { type Diff, groupById } from 'loot-core/shared/util';
import { type PayeeEntity } from 'loot-core/types/models';
-import {
- useSelected,
- SelectedProvider,
- useSelectedDispatch,
- useSelectedItems,
-} from '../../hooks/useSelected';
import { useDispatch } from '../../redux';
import { Search } from '../common/Search';
import { TableHeader, Cell, SelectCell } from '../table';
@@ -32,6 +26,13 @@ import { TableHeader, Cell, SelectCell } from '../table';
import { PayeeMenu } from './PayeeMenu';
import { PayeeTable } from './PayeeTable';
+import {
+ useSelected,
+ SelectedProvider,
+ useSelectedDispatch,
+ useSelectedItems,
+} from '@desktop-client/hooks/useSelected';
+
const getPayeesById = memoizeOne((payees: PayeeEntity[]) => groupById(payees));
function plural(count: number, singleText: string, pluralText: string) {
diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
index 911e607b7a..8274e73875 100644
--- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
+++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.tsx
@@ -11,11 +11,12 @@ import { type UndoState } from 'loot-core/server/undo';
import { applyChanges, type Diff } from 'loot-core/shared/util';
import { type NewRuleEntity, type PayeeEntity } from 'loot-core/types/models';
-import { usePayees } from '../../hooks/usePayees';
import { useDispatch } from '../../redux';
import { ManagePayees } from './ManagePayees';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
type ManagePayeesWithDataProps = {
initialSelectedIds: string[];
};
diff --git a/packages/desktop-client/src/components/payees/PayeeMenu.tsx b/packages/desktop-client/src/components/payees/PayeeMenu.tsx
index be92733983..f103ffa43d 100644
--- a/packages/desktop-client/src/components/payees/PayeeMenu.tsx
+++ b/packages/desktop-client/src/components/payees/PayeeMenu.tsx
@@ -8,7 +8,7 @@ import { View } from '@actual-app/components/view';
import { type PayeeEntity } from 'loot-core/types/models';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
type PayeeMenuProps = {
payeesById: Record<PayeeEntity['id'], PayeeEntity>;
diff --git a/packages/desktop-client/src/components/payees/PayeeTable.tsx b/packages/desktop-client/src/components/payees/PayeeTable.tsx
index 51c722866d..62ac70d7bb 100644
--- a/packages/desktop-client/src/components/payees/PayeeTable.tsx
+++ b/packages/desktop-client/src/components/payees/PayeeTable.tsx
@@ -12,11 +12,12 @@ import { View } from '@actual-app/components/view';
import { type PayeeEntity } from 'loot-core/types/models';
-import { useSelectedItems } from '../../hooks/useSelected';
import { useTableNavigator, Table } from '../table';
import { PayeeTableRow } from './PayeeTableRow';
+import { useSelectedItems } from '@desktop-client/hooks/useSelected';
+
// Table items require an ID to work, it's optional in the loot-core
// model so would need to verify accuracy of that before changing there
type PayeeWithId = PayeeEntity & Required<Pick<PayeeEntity, 'id'>>;
diff --git a/packages/desktop-client/src/components/payees/PayeeTableRow.tsx b/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
index 68211c05f4..c3ebff2803 100644
--- a/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
+++ b/packages/desktop-client/src/components/payees/PayeeTableRow.tsx
@@ -15,9 +15,6 @@ import { Tooltip } from '@actual-app/components/tooltip';
import { type PayeeEntity } from 'loot-core/types/models';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useSelectedDispatch } from '../../hooks/useSelected';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import {
Cell,
CellButton,
@@ -27,6 +24,10 @@ import {
SelectCell,
} from '../table';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useSelectedDispatch } from '@desktop-client/hooks/useSelected';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type RuleButtonProps = {
ruleCount: number;
focused: boolean;
diff --git a/packages/desktop-client/src/components/reports/DateRange.tsx b/packages/desktop-client/src/components/reports/DateRange.tsx
index cc2243674e..ac5fdba4ad 100644
--- a/packages/desktop-client/src/components/reports/DateRange.tsx
+++ b/packages/desktop-client/src/components/reports/DateRange.tsx
@@ -9,7 +9,7 @@ import * as d from 'date-fns';
import * as monthUtils from 'loot-core/shared/months';
-import { useLocale } from '../../hooks/useLocale';
+import { useLocale } from '@desktop-client/hooks/useLocale';
type DateRangeProps = {
start: string;
diff --git a/packages/desktop-client/src/components/reports/Header.tsx b/packages/desktop-client/src/components/reports/Header.tsx
index c7d68c12c6..229c303677 100644
--- a/packages/desktop-client/src/components/reports/Header.tsx
+++ b/packages/desktop-client/src/components/reports/Header.tsx
@@ -14,7 +14,6 @@ import {
} from 'loot-core/types/models';
import { type SyncedPrefs } from 'loot-core/types/prefs';
-import { useLocale } from '../../hooks/useLocale';
import { AppliedFilters } from '../filters/AppliedFilters';
import { FilterButton } from '../filters/FiltersMenu';
@@ -27,6 +26,8 @@ import {
validateStart,
} from './reportRanges';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type HeaderProps = {
start: TimeFrame['start'];
end: TimeFrame['end'];
diff --git a/packages/desktop-client/src/components/reports/Overview.tsx b/packages/desktop-client/src/components/reports/Overview.tsx
index f751da8171..1ed1c5bc68 100644
--- a/packages/desktop-client/src/components/reports/Overview.tsx
+++ b/packages/desktop-client/src/components/reports/Overview.tsx
@@ -27,10 +27,6 @@ import {
type Widget,
} from 'loot-core/types/models';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useNavigate } from '../../hooks/useNavigate';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
-import { useUndo } from '../../hooks/useUndo';
import { useDispatch } from '../../redux';
import { MOBILE_NAV_HEIGHT } from '../mobile/MobileNavTabs';
import { MobilePageHeader, Page, PageHeader } from '../Page';
@@ -46,6 +42,11 @@ import { SpendingCard } from './reports/SpendingCard';
import './overview.scss';
import { SummaryCard } from './reports/SummaryCard';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+import { useUndo } from '@desktop-client/hooks/useUndo';
+
const ResponsiveGridLayout = WidthProvider(Responsive);
function isCustomReportWidget(widget: Widget): widget is CustomReportWidget {
diff --git a/packages/desktop-client/src/components/reports/ReportCard.tsx b/packages/desktop-client/src/components/reports/ReportCard.tsx
index e063462af8..16a022d401 100644
--- a/packages/desktop-client/src/components/reports/ReportCard.tsx
+++ b/packages/desktop-client/src/components/reports/ReportCard.tsx
@@ -14,12 +14,12 @@ import { Popover } from '@actual-app/components/popover';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useIsInViewport } from '../../hooks/useIsInViewport';
-import { useNavigate } from '../../hooks/useNavigate';
-
import { NON_DRAGGABLE_AREA_CLASS_NAME } from './constants';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useIsInViewport } from '@desktop-client/hooks/useIsInViewport';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
type ReportCardProps = {
isEditing?: boolean;
disableClick?: boolean;
diff --git a/packages/desktop-client/src/components/reports/ReportSummary.tsx b/packages/desktop-client/src/components/reports/ReportSummary.tsx
index 8e393af5f1..e041b996a1 100644
--- a/packages/desktop-client/src/components/reports/ReportSummary.tsx
+++ b/packages/desktop-client/src/components/reports/ReportSummary.tsx
@@ -17,11 +17,12 @@ import {
type DataEntity,
} from 'loot-core/types/models';
-import { useLocale } from '../../hooks/useLocale';
import { PrivacyFilter } from '../PrivacyFilter';
import { ReportOptions } from './ReportOptions';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type ReportSummaryProps = {
startDate: string;
endDate: string;
diff --git a/packages/desktop-client/src/components/reports/SummaryNumber.tsx b/packages/desktop-client/src/components/reports/SummaryNumber.tsx
index f93c02b0cb..3d4fce40cc 100644
--- a/packages/desktop-client/src/components/reports/SummaryNumber.tsx
+++ b/packages/desktop-client/src/components/reports/SummaryNumber.tsx
@@ -5,13 +5,14 @@ import { debounce } from 'debounce';
import { amountToCurrency } from 'loot-core/shared/util';
-import { useMergedRefs } from '../../hooks/useMergedRefs';
-import { useResizeObserver } from '../../hooks/useResizeObserver';
import { PrivacyFilter } from '../PrivacyFilter';
import { chartTheme } from './chart-theme';
import { LoadingIndicator } from './LoadingIndicator';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
const FONT_SIZE_SCALE_FACTOR = 1.6;
const CONTAINER_MARGIN = 8;
diff --git a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
index ae4a449313..c01bd382e2 100644
--- a/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/AreaGraph.tsx
@@ -24,12 +24,13 @@ import {
type DataEntity,
} from 'loot-core/types/models';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { adjustTextSize } from './adjustTextSize';
import { renderCustomLabel } from './renderCustomLabel';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type PayloadItem = {
payload: {
date: string;
diff --git a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
index d4f563080d..8e88a17dcb 100644
--- a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx
@@ -28,10 +28,6 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { getCustomTick } from '../getCustomTick';
import { numberFormatterTooltip } from '../numberFormatter';
@@ -40,6 +36,11 @@ import { adjustTextSize } from './adjustTextSize';
import { renderCustomLabel } from './renderCustomLabel';
import { showActivity } from './showActivity';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type PayloadChild = {
props: {
name: string;
diff --git a/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
index c3efff14c7..0aba0f0e05 100644
--- a/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/CalendarGraph.tsx
@@ -18,10 +18,11 @@ import {
import { amountToCurrency } from 'loot-core/shared/util';
import { type SyncedPrefs } from 'loot-core/types/prefs';
-import { useResizeObserver } from '../../../hooks/useResizeObserver';
import { PrivacyFilter } from '../../PrivacyFilter';
import { chartTheme } from '../chart-theme';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
type CalendarGraphProps = {
data: {
date: Date;
diff --git a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx
index 79e765ad68..c56960c9f9 100644
--- a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.tsx
@@ -23,11 +23,12 @@ import {
amountToCurrencyNoDecimal,
} from 'loot-core/shared/util';
-import { useLocale } from '../../../hooks/useLocale';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { chartTheme } from '../chart-theme';
import { Container } from '../Container';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
const MAX_BAR_SIZE = 50;
const ANIMATION_DURATION = 1000; // in ms
diff --git a/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx b/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx
index 0b52866c54..4574314899 100644
--- a/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx
@@ -11,9 +11,6 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useNavigate } from '../../../hooks/useNavigate';
import { PrivacyFilter } from '../../PrivacyFilter';
import { Container } from '../Container';
@@ -21,6 +18,10 @@ import { adjustTextSize } from './adjustTextSize';
import { renderCustomLabel } from './renderCustomLabel';
import { showActivity } from './showActivity';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
const RADIAN = Math.PI / 180;
const ActiveShapeMobile = props => {
diff --git a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx
index 5369086e3f..ef8ba3da56 100644
--- a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx
@@ -25,16 +25,17 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { getCustomTick } from '../getCustomTick';
import { numberFormatterTooltip } from '../numberFormatter';
import { showActivity } from './showActivity';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type PayloadItem = {
dataKey: string;
value: number;
diff --git a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx
index 114340a106..f78f539f45 100644
--- a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx
@@ -18,10 +18,11 @@ import {
import { amountToCurrencyNoDecimal } from 'loot-core/shared/util';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { numberFormatterTooltip } from '../numberFormatter';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type NetWorthGraphProps = {
style?: CSSProperties;
graphData: {
diff --git a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
index 5b03d2cd80..2e9237bbd8 100644
--- a/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/SpendingGraph.tsx
@@ -21,10 +21,11 @@ import {
} from 'loot-core/shared/util';
import { type SpendingEntity } from 'loot-core/types/models';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { numberFormatterTooltip } from '../numberFormatter';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type PayloadItem = {
value: number;
payload: {
diff --git a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
index 1613d1b914..7109e6cd12 100644
--- a/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/StackedBarGraph.tsx
@@ -26,10 +26,6 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePrivacyMode } from '../../../hooks/usePrivacyMode';
import { Container } from '../Container';
import { getCustomTick } from '../getCustomTick';
import { numberFormatterTooltip } from '../numberFormatter';
@@ -37,6 +33,11 @@ import { numberFormatterTooltip } from '../numberFormatter';
import { renderCustomLabel } from './renderCustomLabel';
import { showActivity } from './showActivity';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePrivacyMode } from '@desktop-client/hooks/usePrivacyMode';
+
type PayloadItem = {
name: string;
value: number;
diff --git a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx
index 6ed4c1a2b9..9af2b98005 100644
--- a/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx
+++ b/packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx
@@ -21,12 +21,13 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../../hooks/useAccounts';
-import { useCategories } from '../../../../hooks/useCategories';
-import { useNavigate } from '../../../../hooks/useNavigate';
import { Row, Cell } from '../../../table';
import { showActivity } from '../showActivity';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
type ReportTableRowProps = {
item: GroupedEntity;
balanceTypeOp: balanceTypeOpType;
diff --git a/packages/desktop-client/src/components/reports/reports/Calendar.tsx b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
index d3607f931e..2af1c125c2 100644
--- a/packages/desktop-client/src/components/reports/reports/Calendar.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Calendar.tsx
@@ -41,18 +41,6 @@ import {
type TransactionEntity,
} from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useDateFormat } from '../../../hooks/useDateFormat';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useMergedRefs } from '../../../hooks/useMergedRefs';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePayees } from '../../../hooks/usePayees';
-import { useResizeObserver } from '../../../hooks/useResizeObserver';
-import { SelectedProviderWithItems } from '../../../hooks/useSelected';
-import { SplitsExpandedProvider } from '../../../hooks/useSplitsExpanded';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle';
import { MobileBackButton } from '../../mobile/MobileBackButton';
@@ -73,6 +61,19 @@ import {
import { useReport } from '../useReport';
import { fromDateRepr } from '../util';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+import { SelectedProviderWithItems } from '@desktop-client/hooks/useSelected';
+import { SplitsExpandedProvider } from '@desktop-client/hooks/useSplitsExpanded';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
const CHEVRON_HEIGHT = 42;
const SUMMARY_HEIGHT = 140;
diff --git a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
index 294b6e0455..20d6fafcb2 100644
--- a/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CalendarCard.tsx
@@ -29,9 +29,6 @@ import { amountToCurrency } from 'loot-core/shared/util';
import { type CalendarWidget } from 'loot-core/types/models';
import { type SyncedPrefs } from 'loot-core/types/prefs';
-import { useMergedRefs } from '../../../hooks/useMergedRefs';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useResizeObserver } from '../../../hooks/useResizeObserver';
import { PrivacyFilter } from '../../PrivacyFilter';
import { chartTheme } from '../chart-theme';
import { DateRange } from '../DateRange';
@@ -46,6 +43,10 @@ import {
} from '../spreadsheets/calendar-spreadsheet';
import { useReport } from '../useReport';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
type CalendarCardProps = {
widgetId: string;
isEditing?: boolean;
diff --git a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
index c3841feccd..a1d41c5d83 100644
--- a/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CashFlow.tsx
@@ -23,10 +23,6 @@ import {
type TimeFrame,
} from 'loot-core/types/models';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle';
import { MobileBackButton } from '../../mobile/MobileBackButton';
@@ -40,6 +36,11 @@ import { calculateTimeRange } from '../reportRanges';
import { cashFlowByDate } from '../spreadsheets/cash-flow-spreadsheet';
import { useReport } from '../useReport';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export const defaultTimeFrame = {
start: monthUtils.dayFromDate(monthUtils.currentMonth()),
end: monthUtils.currentDay(),
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
index 750481172a..f097ca9302 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReport.tsx
@@ -26,14 +26,6 @@ import {
} from 'loot-core/types/models';
import { type TransObjectLiteral } from 'loot-core/types/util';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useLocalPref } from '../../../hooks/useLocalPref';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { usePayees } from '../../../hooks/usePayees';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { Warning } from '../../alerts';
import { AppliedFilters } from '../../filters/AppliedFilters';
import { MobileBackButton } from '../../mobile/MobileBackButton';
@@ -64,6 +56,15 @@ import { createGroupedSpreadsheet } from '../spreadsheets/grouped-spreadsheet';
import { useReport } from '../useReport';
import { fromDateRepr } from '../util';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
/**
* Transform `selectedCategories` into `conditions`.
*/
diff --git a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
index 56264ce478..5e6ff306ba 100644
--- a/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
+++ b/packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx
@@ -14,10 +14,6 @@ import { send, sendCatch } from 'loot-core/platform/client/fetch';
import * as monthUtils from 'loot-core/shared/months';
import { type CustomReportEntity } from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useCategories } from '../../../hooks/useCategories';
-import { usePayees } from '../../../hooks/usePayees';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { DateRange } from '../DateRange';
import { ReportCard } from '../ReportCard';
@@ -26,6 +22,11 @@ import { ReportCardName } from '../ReportCardName';
import { GetCardData } from './GetCardData';
import { MissingReportCard } from './MissingReportCard';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type CustomReportListCardsProps = {
isEditing?: boolean;
report?: CustomReportEntity;
diff --git a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
index 7f11bbd38f..f07c47f53e 100644
--- a/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
+++ b/packages/desktop-client/src/components/reports/reports/NetWorth.tsx
@@ -17,11 +17,6 @@ import * as monthUtils from 'loot-core/shared/months';
import { integerToCurrency } from 'loot-core/shared/util';
import { type TimeFrame, type NetWorthWidget } from 'loot-core/types/models';
-import { useAccounts } from '../../../hooks/useAccounts';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle';
import { MobileBackButton } from '../../mobile/MobileBackButton';
@@ -36,6 +31,12 @@ import { createSpreadsheet as netWorthSpreadsheet } from '../spreadsheets/net-wo
import { useReport } from '../useReport';
import { fromDateRepr } from '../util';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function NetWorth() {
const params = useParams();
const { data: widget, isLoading } = useWidget<NetWorthWidget>(
diff --git a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
index 453ffa999e..ecaa3e54ac 100644
--- a/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/NetWorthCard.tsx
@@ -12,7 +12,6 @@ import {
type NetWorthWidget,
} from 'loot-core/types/models';
-import { useLocale } from '../../../hooks/useLocale';
import { PrivacyFilter } from '../../PrivacyFilter';
import { Change } from '../Change';
import { DateRange } from '../DateRange';
@@ -24,6 +23,8 @@ import { calculateTimeRange } from '../reportRanges';
import { createSpreadsheet as netWorthSpreadsheet } from '../spreadsheets/net-worth-spreadsheet';
import { useReport } from '../useReport';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type NetWorthCardProps = {
widgetId: string;
isEditing?: boolean;
diff --git a/packages/desktop-client/src/components/reports/reports/Spending.tsx b/packages/desktop-client/src/components/reports/reports/Spending.tsx
index b3dd5d6079..afc5fa4993 100644
--- a/packages/desktop-client/src/components/reports/reports/Spending.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Spending.tsx
@@ -26,9 +26,6 @@ import {
type RuleConditionEntity,
} from 'loot-core/types/models';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
import { useDispatch } from '../../../redux';
import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle';
import { AppliedFilters } from '../../filters/AppliedFilters';
@@ -45,6 +42,10 @@ import { createSpendingSpreadsheet } from '../spreadsheets/spending-spreadsheet'
import { useReport } from '../useReport';
import { fromDateRepr } from '../util';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
export function Spending() {
const params = useParams();
const { data: widget, isLoading } = useWidget<SpendingWidget>(
diff --git a/packages/desktop-client/src/components/reports/reports/Summary.tsx b/packages/desktop-client/src/components/reports/reports/Summary.tsx
index 5a3093a0ad..3251d4a5da 100644
--- a/packages/desktop-client/src/components/reports/reports/Summary.tsx
+++ b/packages/desktop-client/src/components/reports/reports/Summary.tsx
@@ -26,10 +26,6 @@ import {
type TimeFrame,
} from 'loot-core/types/models';
-import { useFilters } from '../../../hooks/useFilters';
-import { useLocale } from '../../../hooks/useLocale';
-import { useNavigate } from '../../../hooks/useNavigate';
-import { useSyncedPref } from '../../../hooks/useSyncedPref';
import { useDispatch } from '../../../redux';
import { EditablePageHeaderTitle } from '../../EditablePageHeaderTitle';
import { AppliedFilters } from '../../filters/AppliedFilters';
@@ -47,6 +43,11 @@ import { summarySpreadsheet } from '../spreadsheets/summary-spreadsheet';
import { useReport } from '../useReport';
import { fromDateRepr } from '../util';
+import { useFilters } from '@desktop-client/hooks/useFilters';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function Summary() {
const params = useParams();
const { data: widget, isLoading } = useWidget<SummaryWidget>(
diff --git a/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx b/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
index 47c8764612..dbfc9613d6 100644
--- a/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
+++ b/packages/desktop-client/src/components/reports/reports/SummaryCard.tsx
@@ -9,7 +9,6 @@ import {
type SummaryWidget,
} from 'loot-core/types/models';
-import { useLocale } from '../../../hooks/useLocale';
import { DateRange } from '../DateRange';
import { LoadingIndicator } from '../LoadingIndicator';
import { ReportCard } from '../ReportCard';
@@ -19,6 +18,8 @@ import { summarySpreadsheet } from '../spreadsheets/summary-spreadsheet';
import { SummaryNumber } from '../SummaryNumber';
import { useReport } from '../useReport';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
type SummaryCardProps = {
widgetId: string;
isEditing?: boolean;
diff --git a/packages/desktop-client/src/components/rules/RuleRow.tsx b/packages/desktop-client/src/components/rules/RuleRow.tsx
index 6a5cbf2fd7..00a881e0dc 100644
--- a/packages/desktop-client/src/components/rules/RuleRow.tsx
+++ b/packages/desktop-client/src/components/rules/RuleRow.tsx
@@ -16,13 +16,14 @@ import { v4 as uuid } from 'uuid';
import { friendlyOp } from 'loot-core/shared/rules';
import { type RuleEntity } from 'loot-core/types/models';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useSelectedDispatch } from '../../hooks/useSelected';
import { SelectCell, Row, Field, Cell } from '../table';
import { ActionExpression } from './ActionExpression';
import { ConditionExpression } from './ConditionExpression';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useSelectedDispatch } from '@desktop-client/hooks/useSelected';
+
type RuleRowProps = {
rule: RuleEntity;
hovered?: boolean;
diff --git a/packages/desktop-client/src/components/rules/RulesHeader.tsx b/packages/desktop-client/src/components/rules/RulesHeader.tsx
index a4d6d5ffa7..29cd371efd 100644
--- a/packages/desktop-client/src/components/rules/RulesHeader.tsx
+++ b/packages/desktop-client/src/components/rules/RulesHeader.tsx
@@ -1,9 +1,13 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
-import { useSelectedItems, useSelectedDispatch } from '../../hooks/useSelected';
import { SelectCell, Cell, TableHeader } from '../table';
+import {
+ useSelectedItems,
+ useSelectedDispatch,
+} from '@desktop-client/hooks/useSelected';
+
export function RulesHeader() {
const { t } = useTranslation();
const selectedItems = useSelectedItems();
diff --git a/packages/desktop-client/src/components/rules/ScheduleValue.tsx b/packages/desktop-client/src/components/rules/ScheduleValue.tsx
index 09e5f6c1dc..24ff1c3bfd 100644
--- a/packages/desktop-client/src/components/rules/ScheduleValue.tsx
+++ b/packages/desktop-client/src/components/rules/ScheduleValue.tsx
@@ -9,10 +9,10 @@ import { q } from 'loot-core/shared/query';
import { describeSchedule } from 'loot-core/shared/schedules';
import { type ScheduleEntity } from 'loot-core/types/models';
-import { usePayees } from '../../hooks/usePayees';
-
import { Value } from './Value';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
type ScheduleValueProps = {
value: ScheduleEntity;
};
diff --git a/packages/desktop-client/src/components/rules/Value.tsx b/packages/desktop-client/src/components/rules/Value.tsx
index fd503445a9..afcb553bd2 100644
--- a/packages/desktop-client/src/components/rules/Value.tsx
+++ b/packages/desktop-client/src/components/rules/Value.tsx
@@ -10,13 +10,14 @@ import { getMonthYearFormat } from 'loot-core/shared/months';
import { getRecurringDescription } from 'loot-core/shared/schedules';
import { integerToCurrency } from 'loot-core/shared/util';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useCategories } from '../../hooks/useCategories';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useLocale } from '../../hooks/useLocale';
-import { usePayees } from '../../hooks/usePayees';
import { Link } from '../common/Link';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
type ValueProps<T> = {
value: T;
field: unknown;
diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
index 145f6bac60..7d42bb3530 100644
--- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
+++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.tsx
@@ -14,21 +14,22 @@ import { q } from 'loot-core/shared/query';
import { getRecurringDescription } from 'loot-core/shared/schedules';
import type { DiscoverScheduleEntity } from 'loot-core/types/models';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useLocale } from '../../hooks/useLocale';
-import {
- useSelected,
- useSelectedDispatch,
- useSelectedItems,
- SelectedProvider,
-} from '../../hooks/useSelected';
-import { useSendPlatformRequest } from '../../hooks/useSendPlatformRequest';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { Table, TableHeader, Row, Field, SelectCell } from '../table';
import { DisplayId } from '../util/DisplayId';
import { ScheduleAmountCell } from './SchedulesTable';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import {
+ useSelected,
+ useSelectedDispatch,
+ useSelectedItems,
+ SelectedProvider,
+} from '@desktop-client/hooks/useSelected';
+import { useSendPlatformRequest } from '@desktop-client/hooks/useSendPlatformRequest';
+
const ROW_HEIGHT = 43;
function DiscoverSchedulesTable({
diff --git a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
index 1adc4beb33..08cb6e4b77 100644
--- a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
+++ b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.tsx
@@ -12,11 +12,12 @@ import { popModal } from 'loot-core/client/modals/modalsSlice';
import { send } from 'loot-core/platform/client/fetch';
import { type PayeeEntity } from 'loot-core/types/models';
-import { useFormatList } from '../../hooks/useFormatList';
import { useDispatch } from '../../redux';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { DisplayId } from '../util/DisplayId';
+import { useFormatList } from '@desktop-client/hooks/useFormatList';
+
export function PostsOfflineNotification() {
const { t, i18n } = useTranslation();
diff --git a/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx b/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
index d7a85e73ed..c522cfcd95 100644
--- a/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
+++ b/packages/desktop-client/src/components/schedules/ScheduleDetails.tsx
@@ -27,10 +27,6 @@ import {
type RecurConfig,
} from 'loot-core/types/models';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useLocale } from '../../hooks/useLocale';
-import { usePayees } from '../../hooks/usePayees';
-import { useSelected, SelectedProvider } from '../../hooks/useSelected';
import { useDispatch } from '../../redux';
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
import { PayeeAutocomplete } from '../autocomplete/PayeeAutocomplete';
@@ -44,6 +40,14 @@ import { SimpleTransactionsTable } from '../transactions/SimpleTransactionsTable
import { AmountInput, BetweenAmountInput } from '../util/AmountInput';
import { GenericInput } from '../util/GenericInput';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+import {
+ useSelected,
+ SelectedProvider,
+} from '@desktop-client/hooks/useSelected';
+
type Fields = {
payee: null | string;
account: null | string;
diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.tsx b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx
index 4ebef5225d..21822d06bf 100644
--- a/packages/desktop-client/src/components/schedules/SchedulesTable.tsx
+++ b/packages/desktop-client/src/components/schedules/SchedulesTable.tsx
@@ -21,16 +21,17 @@ import { getScheduledAmount } from 'loot-core/shared/schedules';
import { integerToCurrency } from 'loot-core/shared/util';
import { type ScheduleEntity } from 'loot-core/types/models';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { usePayees } from '../../hooks/usePayees';
import { PrivacyFilter } from '../PrivacyFilter';
import { Table, TableHeader, Row, Field, Cell } from '../table';
import { DisplayId } from '../util/DisplayId';
import { StatusBadge } from './StatusBadge';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { usePayees } from '@desktop-client/hooks/usePayees';
+
type SchedulesTableProps = {
isLoading?: boolean;
schedules: readonly ScheduleEntity[];
diff --git a/packages/desktop-client/src/components/schedules/UpcomingLength.tsx b/packages/desktop-client/src/components/schedules/UpcomingLength.tsx
index bc428515ea..b327d5bb4b 100644
--- a/packages/desktop-client/src/components/schedules/UpcomingLength.tsx
+++ b/packages/desktop-client/src/components/schedules/UpcomingLength.tsx
@@ -8,11 +8,12 @@ import { View } from '@actual-app/components/view';
import { type SyncedPrefs } from 'loot-core/types/prefs';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { CustomUpcomingLength } from './CustomUpcomingLength';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
function useUpcomingLengthOptions() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/select/DateSelect.tsx b/packages/desktop-client/src/components/select/DateSelect.tsx
index 1b1cec6fd3..e4808dd6a5 100644
--- a/packages/desktop-client/src/components/select/DateSelect.tsx
+++ b/packages/desktop-client/src/components/select/DateSelect.tsx
@@ -31,12 +31,12 @@ import {
currentDate,
} from 'loot-core/shared/months';
-import { useLocale } from '../../hooks/useLocale';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
-
import DateSelectLeft from './DateSelect.left.png';
import DateSelectRight from './DateSelect.right.png';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
const pickerStyles: CSSProperties = {
'& .pika-single.actual-date-picker': {
color: theme.calendarText,
diff --git a/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx b/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
index baa32a082b..05405a7f94 100644
--- a/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
+++ b/packages/desktop-client/src/components/select/RecurringSchedulePicker.tsx
@@ -30,12 +30,13 @@ import {
type WithRequired,
} from 'loot-core/types/util';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useLocale } from '../../hooks/useLocale';
import { Checkbox } from '../forms';
import { DateSelect } from './DateSelect';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useLocale } from '@desktop-client/hooks/useLocale';
+
// ex: There is no 6th Friday of the Month
const MAX_DAY_OF_WEEK_INTERVAL = 5;
diff --git a/packages/desktop-client/src/components/settings/AuthSettings.tsx b/packages/desktop-client/src/components/settings/AuthSettings.tsx
index 377388d186..4ff87bd7af 100644
--- a/packages/desktop-client/src/components/settings/AuthSettings.tsx
+++ b/packages/desktop-client/src/components/settings/AuthSettings.tsx
@@ -8,12 +8,13 @@ import { theme } from '@actual-app/components/theme';
import { pushModal } from 'loot-core/client/modals/modalsSlice';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
import { useDispatch } from '../../redux';
import { useMultiuserEnabled, useLoginMethod } from '../ServerContext';
import { Setting } from './UI';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+
export function AuthSettings() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
index 48905556bc..da848545e9 100644
--- a/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
+++ b/packages/desktop-client/src/components/settings/BudgetTypeSettings.tsx
@@ -4,11 +4,12 @@ import { Trans } from 'react-i18next';
import { Button } from '@actual-app/components/button';
import { Text } from '@actual-app/components/text';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { Link } from '../common/Link';
import { Setting } from './UI';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
export function BudgetTypeSettings() {
const [budgetType = 'rollover', setBudgetType] = useSyncedPref('budgetType');
diff --git a/packages/desktop-client/src/components/settings/Encryption.tsx b/packages/desktop-client/src/components/settings/Encryption.tsx
index 642094a2ac..0c9b2cb2c0 100644
--- a/packages/desktop-client/src/components/settings/Encryption.tsx
+++ b/packages/desktop-client/src/components/settings/Encryption.tsx
@@ -7,13 +7,14 @@ import { theme } from '@actual-app/components/theme';
import { pushModal } from 'loot-core/client/modals/modalsSlice';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
import { useServerURL } from '../ServerContext';
import { Setting } from './UI';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
export function EncryptionSettings() {
const dispatch = useDispatch();
const serverURL = useServerURL();
diff --git a/packages/desktop-client/src/components/settings/Experimental.tsx b/packages/desktop-client/src/components/settings/Experimental.tsx
index fe0df8c656..ea1bbfd769 100644
--- a/packages/desktop-client/src/components/settings/Experimental.tsx
+++ b/packages/desktop-client/src/components/settings/Experimental.tsx
@@ -7,13 +7,14 @@ import { View } from '@actual-app/components/view';
import type { FeatureFlag } from 'loot-core/types/prefs';
-import { useFeatureFlag } from '../../hooks/useFeatureFlag';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { Link } from '../common/Link';
import { Checkbox } from '../forms';
import { Setting } from './UI';
+import { useFeatureFlag } from '@desktop-client/hooks/useFeatureFlag';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type FeatureToggleProps = {
flag: FeatureFlag;
disableToggle?: boolean;
diff --git a/packages/desktop-client/src/components/settings/Export.tsx b/packages/desktop-client/src/components/settings/Export.tsx
index be0d03f29c..42f39610f7 100644
--- a/packages/desktop-client/src/components/settings/Export.tsx
+++ b/packages/desktop-client/src/components/settings/Export.tsx
@@ -9,10 +9,10 @@ import { format } from 'date-fns';
import { send } from 'loot-core/platform/client/fetch';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
-
import { Setting } from './UI';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
export function ExportBudget() {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(false);
diff --git a/packages/desktop-client/src/components/settings/Format.tsx b/packages/desktop-client/src/components/settings/Format.tsx
index 5380bcdeb0..0e520aba71 100644
--- a/packages/desktop-client/src/components/settings/Format.tsx
+++ b/packages/desktop-client/src/components/settings/Format.tsx
@@ -12,13 +12,14 @@ import { css } from '@emotion/css';
import { numberFormats } from 'loot-core/shared/util';
import { type SyncedPrefs } from 'loot-core/types/prefs';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { Checkbox } from '../forms';
import { useSidebar } from '../sidebar/SidebarProvider';
import { Setting } from './UI';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
// Follows Pikaday 'firstDay' numbering
// https://github.com/Pikaday/Pikaday
function useDaysOfWeek() {
diff --git a/packages/desktop-client/src/components/settings/LanguageSettings.tsx b/packages/desktop-client/src/components/settings/LanguageSettings.tsx
index dee10cb28c..d3e768e00f 100644
--- a/packages/desktop-client/src/components/settings/LanguageSettings.tsx
+++ b/packages/desktop-client/src/components/settings/LanguageSettings.tsx
@@ -6,12 +6,13 @@ import { Select, type SelectOption } from '@actual-app/components/select';
import { Text } from '@actual-app/components/text';
import { type TFunction } from 'i18next';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
import { availableLanguages, setI18NextLanguage } from '../../i18n';
import { Link } from '../common/Link';
import { Setting } from './UI';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
const languageDisplayNameOverride: { [key: string]: string } = {
'pt-BR': 'Português (Brasil)',
};
diff --git a/packages/desktop-client/src/components/settings/Reset.tsx b/packages/desktop-client/src/components/settings/Reset.tsx
index 05616cea2d..d06184b5c5 100644
--- a/packages/desktop-client/src/components/settings/Reset.tsx
+++ b/packages/desktop-client/src/components/settings/Reset.tsx
@@ -7,11 +7,12 @@ import { Text } from '@actual-app/components/text';
import { resetSync } from 'loot-core/client/app/appSlice';
import { send } from 'loot-core/platform/client/fetch';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useDispatch } from '../../redux';
import { Setting } from './UI';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
export function ResetCache() {
const [resetting, setResetting] = useState(false);
diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx
index ada5a29c13..8b3d0121c0 100644
--- a/packages/desktop-client/src/components/settings/index.tsx
+++ b/packages/desktop-client/src/components/settings/index.tsx
@@ -15,9 +15,6 @@ import { loadPrefs } from 'loot-core/client/prefs/prefsSlice';
import { listen } from 'loot-core/platform/client/fetch';
import { isElectron } from 'loot-core/shared/environment';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-import { useIsOutdated, useLatestVersion } from '../../hooks/useLatestVersion';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
import { FormField, FormLabel } from '../forms';
@@ -38,6 +35,13 @@ import { ResetCache, ResetSync } from './Reset';
import { ThemeSettings } from './Themes';
import { AdvancedToggle, Setting } from './UI';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import {
+ useIsOutdated,
+ useLatestVersion,
+} from '@desktop-client/hooks/useLatestVersion';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+
function About() {
const version = useServerVersion();
const latestVersion = useLatestVersion();
diff --git a/packages/desktop-client/src/components/sidebar/Account.tsx b/packages/desktop-client/src/components/sidebar/Account.tsx
index ddf88b182f..5277123c26 100644
--- a/packages/desktop-client/src/components/sidebar/Account.tsx
+++ b/packages/desktop-client/src/components/sidebar/Account.tsx
@@ -21,9 +21,6 @@ import {
} from 'loot-core/client/queries/queriesSlice';
import { type AccountEntity } from 'loot-core/types/models';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useDragRef } from '../../hooks/useDragRef';
-import { useNotes } from '../../hooks/useNotes';
import { useDispatch } from '../../redux';
import { Link } from '../common/Link';
import { Notes } from '../Notes';
@@ -37,6 +34,10 @@ import {
import { type SheetFields, type Binding } from '../spreadsheet';
import { CellValue } from '../spreadsheet/CellValue';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useDragRef } from '@desktop-client/hooks/useDragRef';
+import { useNotes } from '@desktop-client/hooks/useNotes';
+
export const accountNameStyle: CSSProperties = {
marginTop: -2,
marginBottom: 2,
diff --git a/packages/desktop-client/src/components/sidebar/Accounts.tsx b/packages/desktop-client/src/components/sidebar/Accounts.tsx
index 0e1e62ce03..e1e8c82c7e 100644
--- a/packages/desktop-client/src/components/sidebar/Accounts.tsx
+++ b/packages/desktop-client/src/components/sidebar/Accounts.tsx
@@ -8,18 +8,19 @@ import * as queries from 'loot-core/client/queries';
import { type AccountEntity } from 'loot-core/types/models';
import { moveAccount } from '../../accounts/accountsSlice';
-import { useAccounts } from '../../hooks/useAccounts';
-import { useClosedAccounts } from '../../hooks/useClosedAccounts';
-import { useFailedAccounts } from '../../hooks/useFailedAccounts';
-import { useLocalPref } from '../../hooks/useLocalPref';
-import { useOffBudgetAccounts } from '../../hooks/useOffBudgetAccounts';
-import { useOnBudgetAccounts } from '../../hooks/useOnBudgetAccounts';
-import { useUpdatedAccounts } from '../../hooks/useUpdatedAccounts';
import { useSelector, useDispatch } from '../../redux';
import { Account } from './Account';
import { SecondaryItem } from './SecondaryItem';
+import { useAccounts } from '@desktop-client/hooks/useAccounts';
+import { useClosedAccounts } from '@desktop-client/hooks/useClosedAccounts';
+import { useFailedAccounts } from '@desktop-client/hooks/useFailedAccounts';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useOffBudgetAccounts } from '@desktop-client/hooks/useOffBudgetAccounts';
+import { useOnBudgetAccounts } from '@desktop-client/hooks/useOnBudgetAccounts';
+import { useUpdatedAccounts } from '@desktop-client/hooks/useUpdatedAccounts';
+
const fontWeight = 600;
export function Accounts() {
diff --git a/packages/desktop-client/src/components/sidebar/BudgetName.tsx b/packages/desktop-client/src/components/sidebar/BudgetName.tsx
index fd76d17914..8c92a55f50 100644
--- a/packages/desktop-client/src/components/sidebar/BudgetName.tsx
+++ b/packages/desktop-client/src/components/sidebar/BudgetName.tsx
@@ -14,11 +14,12 @@ import { View } from '@actual-app/components/view';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import * as Platform from 'loot-core/client/platform';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useMetadataPref } from '../../hooks/useMetadataPref';
-import { useNavigate } from '../../hooks/useNavigate';
import { useDispatch } from '../../redux';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useMetadataPref } from '@desktop-client/hooks/useMetadataPref';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+
type BudgetNameProps = {
children?: ReactNode;
};
diff --git a/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx b/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
index 29ee4329ec..1368a254f0 100644
--- a/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
+++ b/packages/desktop-client/src/components/sidebar/PrimaryButtons.tsx
@@ -15,11 +15,11 @@ import {
import { SvgCalendar3 } from '@actual-app/components/icons/v2';
import { View } from '@actual-app/components/view';
-import { useSyncServerStatus } from '../../hooks/useSyncServerStatus';
-
import { Item } from './Item';
import { SecondaryItem } from './SecondaryItem';
+import { useSyncServerStatus } from '@desktop-client/hooks/useSyncServerStatus';
+
export function PrimaryButtons() {
const { t } = useTranslation();
const [isOpen, setOpen] = useState(false);
diff --git a/packages/desktop-client/src/components/sidebar/Sidebar.tsx b/packages/desktop-client/src/components/sidebar/Sidebar.tsx
index 2b4b7fe26d..fa64a010f5 100644
--- a/packages/desktop-client/src/components/sidebar/Sidebar.tsx
+++ b/packages/desktop-client/src/components/sidebar/Sidebar.tsx
@@ -12,9 +12,6 @@ import { Resizable } from 're-resizable';
import { replaceModal } from 'loot-core/client/modals/modalsSlice';
import * as Platform from 'loot-core/client/platform';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-import { useLocalPref } from '../../hooks/useLocalPref';
-import { useResizeObserver } from '../../hooks/useResizeObserver';
import { useDispatch } from '../../redux';
import { Accounts } from './Accounts';
@@ -24,6 +21,10 @@ import { SecondaryButtons } from './SecondaryButtons';
import { useSidebar } from './SidebarProvider';
import { ToggleButton } from './ToggleButton';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+import { useLocalPref } from '@desktop-client/hooks/useLocalPref';
+import { useResizeObserver } from '@desktop-client/hooks/useResizeObserver';
+
export function Sidebar() {
const hasWindowButtons = !Platform.isBrowser && Platform.OS === 'mac';
diff --git a/packages/desktop-client/src/components/sidebar/SidebarProvider.tsx b/packages/desktop-client/src/components/sidebar/SidebarProvider.tsx
index 1d08f2b407..c704a6d847 100644
--- a/packages/desktop-client/src/components/sidebar/SidebarProvider.tsx
+++ b/packages/desktop-client/src/components/sidebar/SidebarProvider.tsx
@@ -11,7 +11,7 @@ import React, {
import { useResponsive } from '@actual-app/components/hooks/useResponsive';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
type SidebarContextValue = {
hidden: boolean;
diff --git a/packages/desktop-client/src/components/sidebar/index.tsx b/packages/desktop-client/src/components/sidebar/index.tsx
index 2c57ab39bd..e9fbdc0e05 100644
--- a/packages/desktop-client/src/components/sidebar/index.tsx
+++ b/packages/desktop-client/src/components/sidebar/index.tsx
@@ -4,11 +4,11 @@ import { useResponsive } from '@actual-app/components/hooks/useResponsive';
import { View } from '@actual-app/components/view';
import { useDebounceCallback } from 'usehooks-ts';
-import { useGlobalPref } from '../../hooks/useGlobalPref';
-
import { Sidebar } from './Sidebar';
import { useSidebar } from './SidebarProvider';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
export function FloatableSidebar() {
const [floatingSidebar] = useGlobalPref('floatingSidebar');
diff --git a/packages/desktop-client/src/components/sort.tsx b/packages/desktop-client/src/components/sort.tsx
index cde164e694..8dbff75d93 100644
--- a/packages/desktop-client/src/components/sort.tsx
+++ b/packages/desktop-client/src/components/sort.tsx
@@ -13,8 +13,8 @@ import { useDrag, useDrop } from 'react-dnd';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useDragRef } from '../hooks/useDragRef';
-import { useMergedRefs } from '../hooks/useMergedRefs';
+import { useDragRef } from '@desktop-client/hooks/useDragRef';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
export type DragState<T> = {
state: 'start-preview' | 'start' | 'end';
diff --git a/packages/desktop-client/src/components/spreadsheet/useFormat.ts b/packages/desktop-client/src/components/spreadsheet/useFormat.ts
index bca2ad9cb3..6d25904cf6 100644
--- a/packages/desktop-client/src/components/spreadsheet/useFormat.ts
+++ b/packages/desktop-client/src/components/spreadsheet/useFormat.ts
@@ -7,7 +7,7 @@ import {
setNumberFormat,
} from 'loot-core/shared/util';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
export type FormatType =
| 'string'
diff --git a/packages/desktop-client/src/components/table.tsx b/packages/desktop-client/src/components/table.tsx
index 181e97ebaf..a0a2a31d18 100644
--- a/packages/desktop-client/src/components/table.tsx
+++ b/packages/desktop-client/src/components/table.tsx
@@ -30,13 +30,6 @@ import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
-import { useModalState } from '../hooks/useModalState';
-import {
- AvoidRefocusScrollProvider,
- useProperFocus,
-} from '../hooks/useProperFocus';
-import { useSelectedItems } from '../hooks/useSelected';
-
import { FixedSizeList } from './FixedSizeList';
import {
ConditionalPrivacyFilter,
@@ -51,6 +44,13 @@ import {
import { type FormatType, useFormat } from './spreadsheet/useFormat';
import { useSheetValue } from './spreadsheet/useSheetValue';
+import { useModalState } from '@desktop-client/hooks/useModalState';
+import {
+ AvoidRefocusScrollProvider,
+ useProperFocus,
+} from '@desktop-client/hooks/useProperFocus';
+import { useSelectedItems } from '@desktop-client/hooks/useSelected';
+
export const ROW_HEIGHT = 32;
function fireBlur(onBlur, e) {
diff --git a/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx b/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx
index 833a93c806..155821f615 100644
--- a/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx
+++ b/packages/desktop-client/src/components/transactions/SelectedTransactionsButton.tsx
@@ -15,10 +15,11 @@ import {
import { isPreviewId } from 'loot-core/shared/transactions';
import { type TransactionEntity } from 'loot-core/types/models';
-import { useSelectedItems } from '../../hooks/useSelected';
import { useDispatch } from '../../redux';
import { SelectedItemsButton } from '../table';
+import { useSelectedItems } from '@desktop-client/hooks/useSelected';
+
type SelectedTransactionsButtonProps = {
getTransaction: (id: string) => TransactionEntity | undefined;
onShow: (selectedIds: string[]) => void;
diff --git a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
index 70702f95d0..9cab3faad5 100644
--- a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
+++ b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.tsx
@@ -20,13 +20,17 @@ import * as monthUtils from 'loot-core/shared/months';
import { integerToCurrency } from 'loot-core/shared/util';
import { type TransactionEntity } from 'loot-core/types/models';
-import { useAccount } from '../../hooks/useAccount';
-import { useCategory } from '../../hooks/useCategory';
-import { useDateFormat } from '../../hooks/useDateFormat';
-import { useSelectedItems, useSelectedDispatch } from '../../hooks/useSelected';
import { Cell, Field, Row, SelectCell, Table } from '../table';
import { DisplayId } from '../util/DisplayId';
+import { useAccount } from '@desktop-client/hooks/useAccount';
+import { useCategory } from '@desktop-client/hooks/useCategory';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+import {
+ useSelectedItems,
+ useSelectedDispatch,
+} from '@desktop-client/hooks/useSelected';
+
function serializeTransaction(
transaction: TransactionEntity,
dateFormat: string,
diff --git a/packages/desktop-client/src/components/transactions/TransactionList.jsx b/packages/desktop-client/src/components/transactions/TransactionList.jsx
index 872954dd6b..77d8e1d1c9 100644
--- a/packages/desktop-client/src/components/transactions/TransactionList.jsx
+++ b/packages/desktop-client/src/components/transactions/TransactionList.jsx
@@ -13,12 +13,13 @@ import {
} from 'loot-core/shared/transactions';
import { getChangedValues, applyChanges } from 'loot-core/shared/util';
-import { useNavigate } from '../../hooks/useNavigate';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useDispatch } from '../../redux';
import { TransactionTable } from './TransactionsTable';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
// When data changes, there are two ways to update the UI:
//
// * Optimistic updates: we apply the needed updates to local data
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
index cb0b71e720..0615d2cbb3 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx
@@ -68,13 +68,6 @@ import {
titleFirst,
} from 'loot-core/shared/util';
-import { useContextMenu } from '../../hooks/useContextMenu';
-import { useDisplayPayee } from '../../hooks/useDisplayPayee';
-import { useMergedRefs } from '../../hooks/useMergedRefs';
-import { usePrevious } from '../../hooks/usePrevious';
-import { useProperFocus } from '../../hooks/useProperFocus';
-import { useSelectedDispatch, useSelectedItems } from '../../hooks/useSelected';
-import { useSplitsExpanded } from '../../hooks/useSplitsExpanded';
import { useDispatch } from '../../redux';
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
import { CategoryAutocomplete } from '../autocomplete/CategoryAutocomplete';
@@ -98,6 +91,17 @@ import {
import { TransactionMenu } from './TransactionMenu';
+import { useContextMenu } from '@desktop-client/hooks/useContextMenu';
+import { useDisplayPayee } from '@desktop-client/hooks/useDisplayPayee';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { usePrevious } from '@desktop-client/hooks/usePrevious';
+import { useProperFocus } from '@desktop-client/hooks/useProperFocus';
+import {
+ useSelectedDispatch,
+ useSelectedItems,
+} from '@desktop-client/hooks/useSelected';
+import { useSplitsExpanded } from '@desktop-client/hooks/useSplitsExpanded';
+
function getDisplayValue(obj, name) {
return obj ? obj[name] : '';
}
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
index b6d7bc4b07..b1f03dbe4f 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.test.tsx
@@ -29,12 +29,13 @@ import {
} from 'loot-core/types/models';
import { AuthProvider } from '../../auth/AuthProvider';
-import { SelectedProviderWithItems } from '../../hooks/useSelected';
-import { SplitsExpandedProvider } from '../../hooks/useSplitsExpanded';
import { TestProvider } from '../../redux/mock';
import { TransactionTable } from './TransactionsTable';
+import { SelectedProviderWithItems } from '@desktop-client/hooks/useSelected';
+import { SplitsExpandedProvider } from '@desktop-client/hooks/useSplitsExpanded';
+
vi.mock('loot-core/platform/client/fetch');
vi.mock('../../hooks/useFeatureFlag', () => ({
default: vi.fn().mockReturnValue(false),
diff --git a/packages/desktop-client/src/components/util/AmountInput.tsx b/packages/desktop-client/src/components/util/AmountInput.tsx
index 6eecf242c6..c845758141 100644
--- a/packages/desktop-client/src/components/util/AmountInput.tsx
+++ b/packages/desktop-client/src/components/util/AmountInput.tsx
@@ -19,10 +19,11 @@ import { View } from '@actual-app/components/view';
import { evalArithmetic } from 'loot-core/shared/arithmetic';
import { amountToInteger, appendDecimals } from 'loot-core/shared/util';
-import { useMergedRefs } from '../../hooks/useMergedRefs';
-import { useSyncedPref } from '../../hooks/useSyncedPref';
import { useFormat } from '../spreadsheet/useFormat';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+import { useSyncedPref } from '@desktop-client/hooks/useSyncedPref';
+
type AmountInputProps = {
id?: string;
inputRef?: Ref<HTMLInputElement>;
diff --git a/packages/desktop-client/src/components/util/DisplayId.tsx b/packages/desktop-client/src/components/util/DisplayId.tsx
index 6362effdea..0ff4c45636 100644
--- a/packages/desktop-client/src/components/util/DisplayId.tsx
+++ b/packages/desktop-client/src/components/util/DisplayId.tsx
@@ -5,8 +5,8 @@ import { useTranslation } from 'react-i18next';
import { Text } from '@actual-app/components/text';
import { theme } from '@actual-app/components/theme';
-import { useAccount } from '../../hooks/useAccount';
-import { usePayee } from '../../hooks/usePayee';
+import { useAccount } from '@desktop-client/hooks/useAccount';
+import { usePayee } from '@desktop-client/hooks/usePayee';
type DisplayIdProps = {
type: 'accounts' | 'payees';
diff --git a/packages/desktop-client/src/components/util/GenericInput.jsx b/packages/desktop-client/src/components/util/GenericInput.jsx
index 85ae02a01e..7fa30935d1 100644
--- a/packages/desktop-client/src/components/util/GenericInput.jsx
+++ b/packages/desktop-client/src/components/util/GenericInput.jsx
@@ -8,8 +8,6 @@ import { useReports } from 'loot-core/client/data-hooks/reports';
import { getMonthYearFormat } from 'loot-core/shared/months';
import { integerToAmount, amountToInteger } from 'loot-core/shared/util';
-import { useCategories } from '../../hooks/useCategories';
-import { useDateFormat } from '../../hooks/useDateFormat';
import { useSelector } from '../../redux';
import { AccountAutocomplete } from '../autocomplete/AccountAutocomplete';
import { Autocomplete } from '../autocomplete/Autocomplete';
@@ -24,6 +22,9 @@ import { RecurringSchedulePicker } from '../select/RecurringSchedulePicker';
import { AmountInput } from './AmountInput';
import { PercentInput } from './PercentInput';
+import { useCategories } from '@desktop-client/hooks/useCategories';
+import { useDateFormat } from '@desktop-client/hooks/useDateFormat';
+
export function GenericInput({
field,
subfield,
diff --git a/packages/desktop-client/src/components/util/PercentInput.tsx b/packages/desktop-client/src/components/util/PercentInput.tsx
index 631d1b30d4..dcfd135576 100644
--- a/packages/desktop-client/src/components/util/PercentInput.tsx
+++ b/packages/desktop-client/src/components/util/PercentInput.tsx
@@ -12,9 +12,10 @@ import { Input } from '@actual-app/components/input';
import { evalArithmetic } from 'loot-core/shared/arithmetic';
-import { useMergedRefs } from '../../hooks/useMergedRefs';
import { useFormat } from '../spreadsheet/useFormat';
+import { useMergedRefs } from '@desktop-client/hooks/useMergedRefs';
+
type PercentInputProps = {
id?: string;
inputRef?: Ref<HTMLInputElement>;
diff --git a/packages/desktop-client/src/index.tsx b/packages/desktop-client/src/index.tsx
index c376c13d88..24e1c5d9b0 100644
--- a/packages/desktop-client/src/index.tsx
+++ b/packages/desktop-client/src/index.tsx
@@ -28,12 +28,11 @@ import { q } from 'loot-core/shared/query';
import * as accountsSlice from './accounts/accountsSlice';
import { AuthProvider } from './auth/AuthProvider';
-import { App } from './components/App';
-import { ServerProvider } from './components/ServerContext';
-
// See https://github.com/WICG/focus-visible. Only makes the blue
// focus outline appear from keyboard events.
import 'focus-visible';
+import { App } from './components/App';
+import { ServerProvider } from './components/ServerContext';
const boundActions = bindActionCreators(
{
diff --git a/packages/desktop-client/src/style/theme.tsx b/packages/desktop-client/src/style/theme.tsx
index 29890cdfe3..13189a55a3 100644
--- a/packages/desktop-client/src/style/theme.tsx
+++ b/packages/desktop-client/src/style/theme.tsx
@@ -3,13 +3,13 @@ import { useEffect, useState } from 'react';
import { isNonProductionEnvironment } from 'loot-core/shared/environment';
import type { DarkTheme, Theme } from 'loot-core/types/prefs';
-import { useGlobalPref } from '../hooks/useGlobalPref';
-
import * as darkTheme from './themes/dark';
import * as developmentTheme from './themes/development';
import * as lightTheme from './themes/light';
import * as midnightTheme from './themes/midnight';
+import { useGlobalPref } from '@desktop-client/hooks/useGlobalPref';
+
const themes = {
light: { name: 'Light', colors: lightTheme },
dark: { name: 'Dark', colors: darkTheme },
diff --git a/packages/desktop-client/src/util/router-tools.ts b/packages/desktop-client/src/util/router-tools.ts
index 1bba51ee67..8b0515a6c2 100644
--- a/packages/desktop-client/src/util/router-tools.ts
+++ b/packages/desktop-client/src/util/router-tools.ts
@@ -1,6 +1,6 @@
import { useLayoutEffect } from 'react';
-import { useNavigate } from '../hooks/useNavigate';
+import { useNavigate } from '@desktop-client/hooks/useNavigate';
export function ExposeNavigate() {
const navigate = useNavigate();
diff --git a/tsconfig.json b/tsconfig.json
index 2ef647829e..838dee965e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -31,7 +31,8 @@
"noEmit": true,
"paths": {
// TEMPORARY: Until we can fix the "exports" in the loot-core package.json
- "loot-core/*": ["./packages/loot-core/src/*"]
+ "loot-core/*": ["./packages/loot-core/src/*"],
+ "@desktop-client/*": ["./packages/desktop-client/src/*"]
},
"plugins": [
{
diff --git a/upcoming-release-notes/4789.md b/upcoming-release-notes/4789.md
new file mode 100644
index 0000000000..97e58f111d
--- /dev/null
+++ b/upcoming-release-notes/4789.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [joel-jeremy]
+---
+
+Use @hooks path alias for cleaner imports