diff --git a/lib/tray.ts b/lib/tray.ts index 1380ff8..4b7ba7a 100644 --- a/lib/tray.ts +++ b/lib/tray.ts @@ -4,8 +4,7 @@ import { Menu, MenuItem, PredefinedMenuItem } from '@tauri-apps/api/menu' import { resolveResource } from '@tauri-apps/api/path' import { TrayIcon, type TrayIconEvent } from '@tauri-apps/api/tray' import { getCurrentWindow } from '@tauri-apps/api/window' -import { ask, message } from '@tauri-apps/plugin-dialog' -import { openUrl } from '@tauri-apps/plugin-opener' +import { message } from '@tauri-apps/plugin-dialog' import { platform } from '@tauri-apps/plugin-os' import { exit } from '@tauri-apps/plugin-process' import { usePersistedStore } from '../store/persisted' @@ -62,6 +61,18 @@ async function buildMenu() { menuItems.push(item) }) + const commanderMenuItem = await MenuItem.new({ + id: 'commander', + text: 'Commander', + action: async () => { + await openWindow({ + name: 'Commander', + url: '/commander', + }) + }, + }) + menuItems.push(commanderMenuItem) + const transfersMenuItem = await MenuItem.new({ id: 'transfers', text: 'Transfers', @@ -116,23 +127,6 @@ async function buildMenu() { }) menuItems.push(settingsItem) - const issuesItem = await MenuItem.new({ - id: 'issues', - text: 'Issues?', - action: async () => { - const confirmed = await ask(`Please open an issue on Github and we'll get it sorted.`, { - title: 'Sorry ):', - kind: 'info', - okLabel: 'Open Github', - cancelLabel: 'Cancel', - }) - if (confirmed) { - await openUrl('https://github.com/rclone-ui/rclone-ui/issues') - } - }, - }) - menuItems.push(issuesItem) - const quitItem = await MenuItem.new({ id: 'quit', text: 'Quit', diff --git a/src/pages/Commander.tsx b/src/pages/Commander.tsx index 8ee9235..450b9be 100644 --- a/src/pages/Commander.tsx +++ b/src/pages/Commander.tsx @@ -33,7 +33,7 @@ import { SearchCheckIcon, XCircleIcon, } from 'lucide-react' -import { useCallback, useEffect, useRef, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Group, Panel, Separator } from 'react-resizable-panels' import { onErrorDialog, reportError } from '../../lib/errors' import { getFsInfo } from '../../lib/format' @@ -77,6 +77,16 @@ export default function Browser() { const remotes = remotesQuery.data ?? [] const firstRemote = remotes[0] ?? null + + const rightPanelTarget = useMemo(() => { + const raw = new URLSearchParams(window.location.search).get('path') + if (!raw) return null + if (raw.includes(':/')) { + const [remote, ...rest] = raw.split(':/') + return { remote, path: rest.join('/') } + } + return { remote: 'UI_LOCAL_FS', path: raw } + }, []) const handleDrop = useCallback( (items: SelectItem[], destination: string, _sourceSide: 'left' | 'right') => { setDropOperation({ items, destination }) @@ -297,7 +307,8 @@ export default function Browser() {