refactor(imports): replace relative imports with path aliases (#2741)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-13 20:18:22 +02:00
1 parent a59b80ce11
commit 84dcf6b8a8
1834 files changed
+11601 -10725

No files matched your search

@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const FEATURE_TEMPORARILY_DISABLED_DESCRIPTOR = msg({
message: 'Feature temporarily disabled',
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {Limits} from '@app/features/app/utils/UserLimits';
@@ -11,7 +12,6 @@ import {MAX_BOOKMARKS_PREMIUM} from '@fluxer/constants/src/LimitConstants';
import {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const BOOKMARK_LIMIT_REACHED_DESCRIPTOR = msg({
message: 'Bookmark limit reached',
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {ConfirmModal} from '@app/features/app/components/dialogs/ConfirmModal';
import {PREMIUM_PRODUCT_NAME} from '@app/features/app/config/I18nDisplayConstants';
import {Limits} from '@app/features/app/utils/UserLimits';
@@ -11,7 +12,6 @@ import {MAX_FAVORITE_MEMES_PREMIUM} from '@fluxer/constants/src/LimitConstants';
import {msg, plural} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const SAVED_MEDIA_LIMIT_REACHED_DESCRIPTOR = msg({
message: 'Saved media limit reached',
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const ROLE_NAME_CANNOT_BE_BLANK_DESCRIPTOR = msg({
message: 'Role name is required',
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
import {observer} from 'mobx-react-lite';
import {GenericErrorModal} from './GenericErrorModal';
const GATEWAY_CONNECTION_REQUIRED_DESCRIPTOR = msg({
message: 'Gateway connection required',
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {isForwardableChannelType} from '@app/features/app/components/dialogs/shared/ForwardChannelEligibility';
import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {describe, expect, it} from 'vitest';
import {isForwardableChannelType} from './ForwardChannelEligibility';
describe('forward channel eligibility', () => {
it('allows every text-based message destination, including text-in-voice channels', () => {
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {isForwardableChannelType} from '@app/features/app/components/dialogs/shared/ForwardChannelEligibility';
import {matchesForwardChannelSearch} from '@app/features/app/components/dialogs/shared/ForwardChannelSearchMatch';
import {formatSlowmodeTime} from '@app/features/channel/components/SlowmodeIndicator';
import type {Channel} from '@app/features/channel/models/Channel';
import {PERSONAL_NOTES_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';
@@ -8,8 +10,6 @@ import {formatPermissionLabel} from '@app/features/permissions/utils/PermissionU
import {ChannelTypes, Permissions} from '@fluxer/constants/src/ChannelConstants';
import type {I18n} from '@lingui/core';
import {msg} from '@lingui/core/macro';
import {isForwardableChannelType} from './ForwardChannelEligibility';
import {matchesForwardChannelSearch} from './ForwardChannelSearchMatch';
const GUILD_MESSAGES_DISABLED_DESCRIPTOR = msg({
message: 'Sending messages is disabled in this community',
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {
type ForwardChannelSearchValues,
matchesForwardChannelSearch,
} from '@app/features/app/components/dialogs/shared/ForwardChannelSearchMatch';
import {describe, expect, it} from 'vitest';
import {type ForwardChannelSearchValues, matchesForwardChannelSearch} from './ForwardChannelSearchMatch';
const PERSONAL_NOTES = 'personal notes';
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {selectFrozenUnreadChannels} from '@app/features/app/components/floating/UnreadChannelOrder';
import {describe, expect, it} from 'vitest';
import {selectFrozenUnreadChannels} from './UnreadChannelOrder';
function ids(channels: ReadonlyArray<{id: string}>): Array<string> {
return channels.map((channel) => channel.id);
@@ -2,6 +2,7 @@
import {Routes} from '@app/app/Routes';
import Accessibility from '@app/features/accessibility/state/Accessibility';
import {GenericErrorModal} from '@app/features/app/components/alerts/GenericErrorModal';
import {ChannelItem} from '@app/features/app/components/layout/ChannelItem';
import channelItemStyles from '@app/features/app/components/layout/ChannelItem.module.css';
import {ChannelItemContent} from '@app/features/app/components/layout/ChannelItemContent';
@@ -70,7 +71,6 @@ import {observer} from 'mobx-react-lite';
import type {MotionValue} from 'motion';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {useDragLayer} from 'react-dnd';
import {GenericErrorModal} from '../alerts/GenericErrorModal';
const CATEGORY_FULL_DESCRIPTOR = msg({
message: 'Category full',
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import styles from '@app/features/app/components/layout/NativeTitlebar.module.css';
import {NativeWindowControls} from '@app/features/app/components/layout/NativeWindowControls';
import {FluxerWordmark} from '@app/features/ui/components/icons/FluxerWordmark';
import {getElectronAPI, type NativePlatform} from '@app/features/ui/utils/NativeUtils';
import type React from 'react';
import {useLayoutEffect} from 'react';
import {NativeWindowControls} from './NativeWindowControls';
const STARTUP_NATIVE_TITLEBAR_ID = 'fluxer-startup-native-titlebar';
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {describe, expect, it} from 'vitest';
import {
createScrollIndicatorSnapshot,
getScrollIndicatorStateValue,
@@ -10,7 +9,8 @@ import {
type ScrollIndicatorTargetMeasurement,
selectActiveScrollIndicator,
transitionScrollIndicatorSnapshot,
} from './ScrollIndicatorStateMachine';
} from '@app/features/app/components/layout/ScrollIndicatorStateMachine';
import {describe, expect, it} from 'vitest';
function target(
id: string,
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {
selectUserAreaMicrophoneState,
type UserAreaMicrophoneSignals,
} from '@app/features/app/components/layout/UserAreaState';
import {describe, expect, it} from 'vitest';
import {selectUserAreaMicrophoneState, type UserAreaMicrophoneSignals} from './UserAreaState';
const baseSignals: UserAreaMicrophoneSignals = {
effectiveAudioMuted: false,
@@ -1,5 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {
type ChannelReorderRect,
type ChannelReorderTarget,
selectChannelReorderIntent,
} from '@app/features/app/components/layout/dnd/ChannelReorderStateMachine';
import {type DragItem, DragItemType, type DropResult} from '@app/features/app/components/layout/types/DndTypes';
import {
type ChannelMoveOperation,
@@ -9,11 +14,6 @@ import type {Channel} from '@app/features/channel/models/Channel';
import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {computeGuildChannelReorderPlan} from '@fluxer/schema/src/domains/channel/GuildChannelOrdering';
import {describe, expect, it} from 'vitest';
import {
type ChannelReorderRect,
type ChannelReorderTarget,
selectChannelReorderIntent,
} from './ChannelReorderStateMachine';
const rect: ChannelReorderRect = {
top: 100,
@@ -1,8 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {type DragItem, DragItemType} from '@app/features/app/components/layout/types/DndTypes';
import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {describe, expect, it} from 'vitest';
import {
type ChannelReorderRect,
type ChannelReorderTarget,
@@ -13,7 +10,10 @@ import {
selectChannelReorderIntent,
selectChannelReorderResolution,
transitionChannelReorderSnapshot,
} from './ChannelReorderStateMachine';
} from '@app/features/app/components/layout/dnd/ChannelReorderStateMachine';
import {type DragItem, DragItemType} from '@app/features/app/components/layout/types/DndTypes';
import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
import {describe, expect, it} from 'vitest';
const rect: ChannelReorderRect = {
top: 40,
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {describe, expect, it} from 'vitest';
import {
shouldShowCategoryWhenHidingMutedChannels,
shouldShowChannelInCollapsedCategory,
shouldShowChannelWhenHidingMutedChannels,
} from './ChannelListVisibility';
} from '@app/features/app/components/layout/utils/ChannelListVisibility';
import {describe, expect, it} from 'vitest';
describe('shouldShowChannelWhenHidingMutedChannels', () => {
it('keeps muted channels with visible unread state so mentions are findable', () => {
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {getChannelUnreadState} from '@app/features/app/components/layout/utils/ChannelUnreadState';
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
import {describe, expect, it} from 'vitest';
import {getChannelUnreadState} from './ChannelUnreadState';
describe('getChannelUnreadState', () => {
it('shows a normal unread indicator for all-messages unread badges', () => {
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {resolveChannelUnreadState} from './ChannelUnreadStateMachine';
import {resolveChannelUnreadState} from '@app/features/app/components/layout/utils/ChannelUnreadStateMachine';
export interface ChannelUnreadStateInput {
hasUnread: boolean;
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
import {describe, expect, it} from 'vitest';
import type {ChannelUnreadStateInput} from './ChannelUnreadState';
import type {ChannelUnreadStateInput} from '@app/features/app/components/layout/utils/ChannelUnreadState';
import {
type ChannelUnreadStateValue,
createChannelUnreadSnapshot,
selectChannelUnreadState,
transitionChannelUnreadSnapshot,
} from './ChannelUnreadStateMachine';
} from '@app/features/app/components/layout/utils/ChannelUnreadStateMachine';
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
import {describe, expect, it} from 'vitest';
function input(overrides: Partial<ChannelUnreadStateInput> = {}): ChannelUnreadStateInput {
return {
@@ -1,8 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {
ChannelUnreadState,
ChannelUnreadStateInput,
} from '@app/features/app/components/layout/utils/ChannelUnreadState';
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
import {assign, initialTransition, type SnapshotFrom, setup, transition} from 'xstate';
import type {ChannelUnreadState, ChannelUnreadStateInput} from './ChannelUnreadState';
interface ChannelUnreadMachineContext extends ChannelUnreadStateInput {}
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {describe, expect, it} from 'vitest';
import {
createSetupWizardSnapshot,
type SetupWizardMachineEvent,
type SetupWizardSnapshot,
selectSetupWizardModel,
transitionSetupWizardSnapshot,
} from './SetupWizardStateMachine';
} from '@app/features/app/components/setup/SetupWizardStateMachine';
import {describe, expect, it} from 'vitest';
function transition(snapshot: SetupWizardSnapshot, event: SetupWizardMachineEvent): SetupWizardSnapshot {
return transitionSetupWizardSnapshot(snapshot, event);
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {describe, expect, it} from 'vitest';
import {
createRandomWelcomeRotationState,
createWelcomeRotationState,
WELCOME_ROTATION,
type WelcomeRotationState,
} from './SetupWizardWelcomeRotation';
} from '@app/features/app/components/setup/SetupWizardWelcomeRotation';
import {describe, expect, it} from 'vitest';
function constantRandom(value: number): () => number {
return () => value;