From fa3e5ead63b5397bd8e14d25e8a65eaf0e3789df Mon Sep 17 00:00:00 2001 From: FTCHD <144691102+FTCHD@users.noreply.github.com> Date: Sun, 30 Aug 2026 19:35:20 +0300 Subject: [PATCH] preview --- .gitignore | 1 + lib/preview.tsx | 11 +++++ scripts/buildExternal.js | 5 ++- src/components/JobDetailsDrawer.tsx | 3 ++ src/pages/Commander.tsx | 3 ++ src/pages/Delete.tsx | 5 +-- src/pages/Settings/NotificationsSection.tsx | 3 +- src/pages/Settings/RemotesSection.tsx | 3 +- src/pages/Settings/index.tsx | 45 +++++++++++++-------- src/pages/Transfers.tsx | 5 ++- tailwind.config.js | 1 + 11 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 lib/preview.tsx diff --git a/.gitignore b/.gitignore index 84137ef..346613b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ scripts/release.md src-tauri/binaries/* !src-tauri/binaries/.gitkeep /public/out.js +video diff --git a/lib/preview.tsx b/lib/preview.tsx new file mode 100644 index 0000000..8f5e615 --- /dev/null +++ b/lib/preview.tsx @@ -0,0 +1,11 @@ +import { type ReactNode, createContext, useContext } from 'react' + +const PreviewContext = createContext(false) + +export function PreviewProvider({ children }: { children: ReactNode }) { + return {children} +} + +export function useIsPreview(): boolean { + return useContext(PreviewContext) +} diff --git a/scripts/buildExternal.js b/scripts/buildExternal.js index 1b8f1df..9f1cabf 100644 --- a/scripts/buildExternal.js +++ b/scripts/buildExternal.js @@ -15,7 +15,10 @@ async function buildExternal() { // Compile TypeScript using local tsc console.log('[buildExternal] Compiling TypeScript...') execSync( - 'npx tsc main.ts --target es2020 --module esnext --moduleResolution bundler --listEmittedFiles', + // skipLibCheck mirrors tsconfig.json: a bare-CLI tsc ignores tsconfig and + // auto-includes every node_modules/@types package, and Remotion's transitive + // @types/dom-webcodecs collides with the WebCodecs types TS now bundles in lib.dom. + 'npx tsc main.ts --target es2020 --module esnext --moduleResolution bundler --skipLibCheck --listEmittedFiles', { stdio: 'inherit', cwd: projectRoot, diff --git a/src/components/JobDetailsDrawer.tsx b/src/components/JobDetailsDrawer.tsx index 421f372..4fd81aa 100644 --- a/src/components/JobDetailsDrawer.tsx +++ b/src/components/JobDetailsDrawer.tsx @@ -17,6 +17,7 @@ import { platform } from '@tauri-apps/plugin-os' import { ExternalLinkIcon, RefreshCwIcon, SearchCheckIcon, SquareIcon } from 'lucide-react' import { useMemo, useState } from 'react' import { formatBytes } from '../../lib/format' +import { useIsPreview } from '../../lib/preview' import { notify } from '../../lib/notifications' import { startBatch } from '../../lib/rclone/api' import rclone from '../../lib/rclone/client' @@ -35,6 +36,7 @@ export default function JobDetailsDrawer({ onSelectJob?: (job: JobItem) => void }) { const queryClient = useQueryClient() + const isPreview = useIsPreview() const [retryStatus, setRetryStatus] = useState< Map >(new Map()) @@ -302,6 +304,7 @@ export default function JobDetailsDrawer({ > If you're deleting a entire folder, "{sourceRemoteName}" supports Purge - which is more efficient! + which is more efficient. )} @@ -303,7 +303,6 @@ export default function Delete() { buttonText={buttonText} buttonIcon={buttonIcon} newLabel="NEW DELETE" - newButtonPrimary={false} showViewTransfers={false} resetPathsLabel="Reset Path" onResetPaths={handleResetPaths} diff --git a/src/pages/Settings/NotificationsSection.tsx b/src/pages/Settings/NotificationsSection.tsx index 5cf0b61..5a7ae17 100644 --- a/src/pages/Settings/NotificationsSection.tsx +++ b/src/pages/Settings/NotificationsSection.tsx @@ -91,7 +91,7 @@ export default function NotificationsSection() { /> ))} } onPress={() => @@ -166,6 +166,7 @@ function ProviderCard({ onPress={onPress} className="h-24 bg-content2" data-focus-visible="false" + data-provider={provider} > -

No remotes found

+

Add your first remote!