diff --git a/.github/workflows/cache-factory.yaml b/.github/workflows/cache-factory.yaml index 04ea557d8..335f42a2d 100644 --- a/.github/workflows/cache-factory.yaml +++ b/.github/workflows/cache-factory.yaml @@ -54,11 +54,11 @@ jobs: runs-on: ${{ matrix.settings.host }} if: github.repository == 'spacedriveapp/spacedrive' permissions: {} - timeout-minutes: 150 # 2.5 hours + timeout-minutes: 150 # 2.5 hours steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} - uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c # master + uses: easimon/maximize-build-space@master with: swap-size-mb: 4096 root-reserve-mb: 6144 @@ -68,17 +68,13 @@ jobs: remove-docker-images: 'true' - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Symlink target to C:\ if: ${{ runner.os == 'Windows' }} shell: powershell run: | New-Item -ItemType Directory -Force -Path C:\spacedrive_target - - name: Symlink target to C:\ - if: ${{ runner.os == 'Windows' }} - shell: powershell - run: | New-Item -Path target -ItemType Junction -Value C:\spacedrive_target - name: Setup System and Rust diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b9161572..c95f758c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: permissions: {} steps: - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Setup Node.js, pnpm and dependencies uses: ./.github/actions/setup-pnpm @@ -43,7 +43,7 @@ jobs: timeout-minutes: 5 steps: - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Setup Node.js, pnpm and dependencies uses: ./.github/actions/setup-pnpm @@ -60,7 +60,7 @@ jobs: permissions: {} steps: - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Setup System and Rust uses: ./.github/actions/setup-system @@ -81,7 +81,7 @@ jobs: ln -sf /Users/runner/Library/Caches/Cypress /Users/runner/.cache/Cypress - name: Setup Cypress - uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6 + uses: cypress-io/github-action@v6 with: runTests: false working-directory: . @@ -90,7 +90,7 @@ jobs: run: pnpm test-data small - name: E2E test - uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6 + uses: cypress-io/github-action@v6 with: build: npx cypress info install: false @@ -98,14 +98,15 @@ jobs: working-directory: apps/web - name: Upload cypress screenshots - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 + uses: actions/upload-artifact@v4 + if: always() with: name: cypress-screenshots path: apps/web/cypress/screenshots if-no-files-found: ignore - name: Upload cypress video's - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 + uses: actions/upload-artifact@v4 if: always() with: name: cypress-videos @@ -121,7 +122,7 @@ jobs: steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} - uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c # master + uses: easimon/maximize-build-space@master with: swap-size-mb: 3072 root-reserve-mb: 6144 @@ -142,10 +143,10 @@ jobs: New-Item -Path target -ItemType Junction -Value C:\spacedrive_target - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Check if files have changed - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 + uses: dorny/paths-filter@v3 continue-on-error: true id: filter with: @@ -184,7 +185,7 @@ jobs: steps: - name: Maximize build space if: ${{ runner.os == 'Linux' }} - uses: easimon/maximize-build-space@fc881a613ad2a34aca9c9624518214ebc21dfc0c # master + uses: easimon/maximize-build-space@master with: swap-size-mb: 3072 root-reserve-mb: 6144 @@ -198,17 +199,13 @@ jobs: shell: powershell run: | New-Item -ItemType Directory -Force -Path C:\spacedrive_target - - name: Symlink target to C:\ - if: ${{ runner.os == 'Windows' }} - shell: powershell - run: | New-Item -Path target -ItemType Junction -Value C:\spacedrive_target - name: Checkout repository - uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 + uses: actions/checkout@v4 - name: Find files that have changed - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 + uses: dorny/paths-filter@v3 continue-on-error: true id: filter with: @@ -235,7 +232,7 @@ jobs: - name: Run Clippy if: steps.filter.outcome != 'success' || steps.filter.outputs.changes == 'true' - uses: actions-rs-plus/clippy-check@30fef0f891edb491831cd248156cfb18d7d12fda # v2 + uses: actions-rs-plus/clippy-check@v2 with: args: --workspace --all-features --locked diff --git a/apps/mobile/src/components/header/DynamicHeader.tsx b/apps/mobile/src/components/header/DynamicHeader.tsx index 5973280f3..88e8c7b06 100644 --- a/apps/mobile/src/components/header/DynamicHeader.tsx +++ b/apps/mobile/src/components/header/DynamicHeader.tsx @@ -6,8 +6,8 @@ import { Platform, Pressable, Text, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { tw, twStyle } from '~/lib/tailwind'; import { getExplorerStore, useExplorerStore } from '~/stores/explorerStore'; -import { Icon } from '../icons/Icon'; +import { Icon } from '../icons/Icon'; type Props = { headerRoute?: NativeStackHeaderProps; //supporting title from the options object of navigation @@ -36,15 +36,12 @@ export default function DynamicHeader({ - navigation.goBack()} - > - - + navigation.goBack()}> + + - - + @@ -52,8 +49,9 @@ export default function DynamicHeader({ - - {explorerMenu && + {explorerMenu && ( + { getExplorerStore().toggleMenu = !explorerStore.toggleMenu; @@ -65,22 +63,23 @@ export default function DynamicHeader({ explorerStore.toggleMenu ? 'text-accent' : 'text-zinc-300' )} /> - } + + )} { - navigation.navigate('SearchStack', { - screen: 'Search' - }); - }} - > - - - + hitSlop={12} + onPress={() => { + navigation.navigate('SearchStack', { + screen: 'Search' + }); + }} + > + + + @@ -92,7 +91,7 @@ interface HeaderIconKindProps { kind: Props['kind']; } -const HeaderIconKind = ({routeParams, kind }: HeaderIconKindProps) => { +const HeaderIconKind = ({ routeParams, kind }: HeaderIconKindProps) => { switch (kind) { case 'location': return ; diff --git a/apps/mobile/src/components/header/Header.tsx b/apps/mobile/src/components/header/Header.tsx index a60fd4b2e..d6133fcc0 100644 --- a/apps/mobile/src/components/header/Header.tsx +++ b/apps/mobile/src/components/header/Header.tsx @@ -13,12 +13,7 @@ type Props = { }; // Default header with search bar and button to open drawer -export default function Header({ - route, - navBack, - title, - search = false -}: Props) { +export default function Header({ route, navBack, title, search = false }: Props) { const navigation = useNavigation(); const headerHeight = useSafeAreaInsets().top; const isAndroid = Platform.OS === 'android'; @@ -32,35 +27,33 @@ export default function Header({ - {navBack ? ( - navigation.goBack()} - > - - - - ) : ( - navigation.openDrawer()}> - - - )} + {navBack ? ( + navigation.goBack()}> + + + ) : ( + navigation.openDrawer()}> + + + )} {title || route?.name} - {search && { - navigation.navigate('SearchStack', { - screen: 'Search' - }); - }} - > - - } + {search && ( + { + navigation.navigate('SearchStack', { + screen: 'Search' + }); + }} + > + + + )} diff --git a/apps/mobile/src/components/header/SearchHeader.tsx b/apps/mobile/src/components/header/SearchHeader.tsx index 0312f6544..4a76ea278 100644 --- a/apps/mobile/src/components/header/SearchHeader.tsx +++ b/apps/mobile/src/components/header/SearchHeader.tsx @@ -4,14 +4,14 @@ import { ArrowLeft } from 'phosphor-react-native'; import { Platform, Pressable, Text, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { tw, twStyle } from '~/lib/tailwind'; -import Search from '../search/Search'; +import Search from '../search/Search'; const searchPlaceholder = { locations: 'Search location name...', tags: 'Search tag name...', - categories: 'Search category name...', -} + categories: 'Search category name...' +}; type Props = { route?: RouteProp; // supporting title from the options object of navigation @@ -19,11 +19,7 @@ type Props = { title?: string; // in some cases - we want to override the route title }; -export default function SearchHeader({ - route, - kind, - title -}: Props) { +export default function SearchHeader({ route, kind, title }: Props) { const navigation = useNavigation(); const headerHeight = useSafeAreaInsets().top; const isAndroid = Platform.OS === 'android'; @@ -37,12 +33,9 @@ export default function SearchHeader({ - navigation.goBack()} - > - - + navigation.goBack()}> + + {title || route?.name} diff --git a/apps/mobile/src/components/layout/ScreenContainer.tsx b/apps/mobile/src/components/layout/ScreenContainer.tsx index 79f3684b7..eecee3b4d 100644 --- a/apps/mobile/src/components/layout/ScreenContainer.tsx +++ b/apps/mobile/src/components/layout/ScreenContainer.tsx @@ -24,32 +24,32 @@ const ScreenContainer = ({ const bottomTabBarHeight = Platform.OS === 'ios' ? 80 : 60; return scrollview ? ( - { - if (!scrollToBottomOnChange) return; - ref.current?.scrollToEnd({ animated: true }); - }} - contentContainerStyle={twStyle('justify-between gap-10 py-6', style)} - style={twStyle( - 'flex-1 bg-black', - tabHeight && { marginBottom: bottomTabBarHeight } - )} - > - {children} - + { + if (!scrollToBottomOnChange) return; + ref.current?.scrollToEnd({ animated: true }); + }} + contentContainerStyle={twStyle('justify-between gap-10 py-6', style)} + style={twStyle( + 'flex-1 bg-black', + tabHeight && { marginBottom: bottomTabBarHeight } + )} + > + {children} + ) : ( - - {children} - + + {children} + ); }; diff --git a/apps/mobile/src/navigation/tabs/BrowseStack.tsx b/apps/mobile/src/navigation/tabs/BrowseStack.tsx index cdf751c55..2126f1937 100644 --- a/apps/mobile/src/navigation/tabs/BrowseStack.tsx +++ b/apps/mobile/src/navigation/tabs/BrowseStack.tsx @@ -1,6 +1,8 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; +import DynamicHeader from '~/components/header/DynamicHeader'; import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import BrowseScreen from '~/screens/browse/Browse'; import LibraryScreen from '~/screens/browse/Library'; import LocationScreen from '~/screens/browse/Location'; @@ -8,8 +10,6 @@ import LocationsScreen from '~/screens/browse/Locations'; import TagScreen from '~/screens/browse/Tag'; import TagsScreen from '~/screens/browse/Tags'; -import DynamicHeader from '~/components/header/DynamicHeader'; -import SearchHeader from '~/components/header/SearchHeader'; import { TabScreenProps } from '../TabNavigator'; const Stack = createNativeStackNavigator(); @@ -20,42 +20,50 @@ export default function BrowseStack() { ({ + options={({ route }) => ({ header: () => })} /> ({ - header: (route) => + options={({ route: optionsRoute }) => ({ + header: (route) => ( + + ) })} /> ({ + options={({ route }) => ({ header: () => })} /> ({ + options={({ route }) => ({ header: () => })} /> ({ - header: (route) => + options={({ route: optionsRoute }) => ({ + header: (route) => ( + + ) })} /> ({ + options={({ route }) => ({ header: () => })} /> diff --git a/apps/mobile/src/navigation/tabs/NetworkStack.tsx b/apps/mobile/src/navigation/tabs/NetworkStack.tsx index 25171b516..5bf8489d6 100644 --- a/apps/mobile/src/navigation/tabs/NetworkStack.tsx +++ b/apps/mobile/src/navigation/tabs/NetworkStack.tsx @@ -13,7 +13,7 @@ export default function NetworkStack() { ({ + options={({ route }) => ({ header: () => })} /> diff --git a/apps/mobile/src/navigation/tabs/OverviewStack.tsx b/apps/mobile/src/navigation/tabs/OverviewStack.tsx index ac0dd6068..d5826a25c 100644 --- a/apps/mobile/src/navigation/tabs/OverviewStack.tsx +++ b/apps/mobile/src/navigation/tabs/OverviewStack.tsx @@ -1,10 +1,10 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; +import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import CategoriesScreen from '~/screens/overview/Categories'; import OverviewScreen from '~/screens/overview/Overview'; -import Header from '~/components/header/Header'; -import SearchHeader from '~/components/header/SearchHeader'; import { TabScreenProps } from '../TabNavigator'; const Stack = createNativeStackNavigator(); @@ -15,14 +15,14 @@ export default function OverviewStack() { ({ + options={({ route }) => ({ header: () => })} /> ({ + options={({ route }) => ({ header: () => })} /> diff --git a/apps/mobile/src/navigation/tabs/SettingsStack.tsx b/apps/mobile/src/navigation/tabs/SettingsStack.tsx index 1ace6dded..36d12cd35 100644 --- a/apps/mobile/src/navigation/tabs/SettingsStack.tsx +++ b/apps/mobile/src/navigation/tabs/SettingsStack.tsx @@ -3,6 +3,7 @@ import { CompositeScreenProps } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; import Header from '~/components/header/Header'; +import SearchHeader from '~/components/header/SearchHeader'; import AppearanceSettingsScreen from '~/screens/settings/client/AppearanceSettings'; import ExtensionsSettingsScreen from '~/screens/settings/client/ExtensionsSettings'; import GeneralSettingsScreen from '~/screens/settings/client/GeneralSettings'; @@ -18,7 +19,6 @@ import NodesSettingsScreen from '~/screens/settings/library/NodesSettings'; import TagsSettingsScreen from '~/screens/settings/library/TagsSettings'; import SettingsScreen from '~/screens/settings/Settings'; -import SearchHeader from '~/components/header/SearchHeader'; import { TabScreenProps } from '../TabNavigator'; const Stack = createNativeStackNavigator(); @@ -29,7 +29,7 @@ export default function SettingsStack() { ({ + options={({ route }) => ({ header: () => })} /> diff --git a/apps/mobile/src/screens/settings/Settings.tsx b/apps/mobile/src/screens/settings/Settings.tsx index bfd6fc588..613f3d2ef 100644 --- a/apps/mobile/src/screens/settings/Settings.tsx +++ b/apps/mobile/src/screens/settings/Settings.tsx @@ -142,24 +142,24 @@ export default function SettingsScreen({ navigation }: SettingsStackScreenProps< return ( - ( - navigation.navigate(item.navigateTo as any)} - rounded={item.rounded} - /> - )} - renderSectionHeader={renderSectionHeader} - ListFooterComponent={} - showsVerticalScrollIndicator={false} - stickySectionHeadersEnabled={false} - initialNumToRender={50} - /> - + ( + navigation.navigate(item.navigateTo as any)} + rounded={item.rounded} + /> + )} + renderSectionHeader={renderSectionHeader} + ListFooterComponent={} + showsVerticalScrollIndicator={false} + stickySectionHeadersEnabled={false} + initialNumToRender={50} + /> + ); } diff --git a/core/src/api/files.rs b/core/src/api/files.rs index f5105c21d..977fb5c91 100644 --- a/core/src/api/files.rs +++ b/core/src/api/files.rs @@ -104,7 +104,7 @@ pub(crate) fn mount() -> AlphaRouter { .include(object_with_file_paths::include()) .exec() .await? - .map(|item| ObjectWithFilePaths2::from_db(item))) + .map(ObjectWithFilePaths2::from_db)) }) }) .procedure("getMediaData", { diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs index adbbdd83a..3b71df218 100644 --- a/core/src/api/locations.rs +++ b/core/src/api/locations.rs @@ -271,7 +271,7 @@ pub(crate) fn mount() -> AlphaRouter { .include(location_with_indexer_rules::include()) .exec() .await? - .map(|location| LocationWithIndexerRule::from_db(location))) + .map(LocationWithIndexerRule::from_db)) }) }) .procedure("create", { diff --git a/core/src/api/search/mod.rs b/core/src/api/search/mod.rs index 3e4f4c5d4..1547d0b27 100644 --- a/core/src/api/search/mod.rs +++ b/core/src/api/search/mod.rs @@ -7,12 +7,8 @@ use crate::{ }; use prisma_client_rust::Operator; -use sd_core_indexer_rules::seed::no_hidden; -use sd_core_indexer_rules::IndexerRule; use sd_core_prisma_helpers::{file_path_with_object, object_with_file_paths}; -use sd_file_ext::kind::ObjectKind; -use sd_prisma::prisma::{self, location, PrismaClient}; -use sd_utils::chain_optional_iter; +use sd_prisma::prisma::{self, PrismaClient}; use std::path::PathBuf; @@ -420,6 +416,6 @@ fn andify>>(params: Vec) -> Vec { params.into_iter().fold(vec![], |mut params, param| { params.push(param); - vec![prisma_client_rust::operator::and(params).into()] + vec![prisma_client_rust::operator::and(params)] }) } diff --git a/interface/app/$libraryId/Explorer/View/ViewItem.tsx b/interface/app/$libraryId/Explorer/View/ViewItem.tsx index c9362dd43..c4436e47b 100644 --- a/interface/app/$libraryId/Explorer/View/ViewItem.tsx +++ b/interface/app/$libraryId/Explorer/View/ViewItem.tsx @@ -60,7 +60,9 @@ export const useViewItemDoubleClick = () => { break; default: { const paths = - selectedItem.type === 'Path' ? [selectedItem.item] : selectedItem.item.file_paths; + selectedItem.type === 'Path' + ? [selectedItem.item] + : selectedItem.item.file_paths; for (const filePath of paths) { if (filePath.is_dir) { diff --git a/interface/app/$libraryId/debug/sync.tsx b/interface/app/$libraryId/debug/sync.tsx index d7807e271..9c4c337d3 100644 --- a/interface/app/$libraryId/debug/sync.tsx +++ b/interface/app/$libraryId/debug/sync.tsx @@ -33,7 +33,10 @@ export const Component = () => { onData: () => messages.refetch() }); - const groups = useMemo(() => (messages.data && calculateGroups(messages.data)) || [], [messages]); + const groups = useMemo( + () => (messages.data && calculateGroups(messages.data)) || [], + [messages] + ); return ( @@ -41,7 +44,9 @@ export const Component = () => { { - dialogManager.create((dialogProps) => ); + dialogManager.create((dialogProps) => ( + + )); }} disabled={backfillSync.isLoading} > diff --git a/packages/ui/src/Dialog.tsx b/packages/ui/src/Dialog.tsx index 22f0a5950..f2b7f7ff6 100644 --- a/packages/ui/src/Dialog.tsx +++ b/packages/ui/src/Dialog.tsx @@ -271,7 +271,9 @@ export function Dialog({ props.ignoreClickOutside && e.preventDefault()} + onInteractOutside={(e) => + props.ignoreClickOutside && e.preventDefault() + } > ({ )} > {form.formState.isSubmitting && } - {props.buttonsSideContent && {props.buttonsSideContent}} + {props.buttonsSideContent && ( + {props.buttonsSideContent} + )} {!props.hideButtons && (