diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx index 9961253..d58af92 100644 --- a/apps/desktop/src/App.tsx +++ b/apps/desktop/src/App.tsx @@ -27,9 +27,11 @@ function App() { const activeView = useSettingsStore(state => state.activeView); const appFontSize = useSettingsStore(state => state.appFontSize); const showDockBadge = useSettingsStore(state => state.showDockBadge); - const activeDownloadCount = useDownloadStore(state => state.downloads.filter(download => download.status === 'downloading').length); - const schedulerRunning = useSettingsStore(state => state.schedulerRunning); const downloads = useDownloadStore(state => state.downloads); + const activeDownloadCount = downloads.filter(download => download.status === 'downloading').length; + const queuedCount = downloads.filter(download => download.status === 'queued').length; + const doneCount = downloads.filter(download => download.status === 'completed').length; + const schedulerRunning = useSettingsStore(state => state.schedulerRunning); const globalSpeedLimit = useSettingsStore(state => state.globalSpeedLimit); const previousSpeedLimit = useRef(globalSpeedLimit); @@ -179,11 +181,34 @@ function App() { return (
- {isSidebarVisible && { setFilter(f); useSettingsStore.getState().setActiveView('downloads'); }} />} - {activeView === 'downloads' && } - {activeView === 'settings' && } - {activeView === 'scheduler' && } - {activeView === 'speedLimiter' && } + + {/* Left Side Panel - Curved Second Layer on Top */} + {isSidebarVisible && ( +
+ { setFilter(f); useSettingsStore.getState().setActiveView('downloads'); }} /> +
+ )} + + {/* Main Content - Base Layer */} +
+
+ {activeView === 'downloads' && } + {activeView === 'settings' && } + {activeView === 'scheduler' && } + {activeView === 'speedLimiter' && } +
+ + {/* Status Bar */} +
+ Ready +
+ {activeDownloadCount} active + {queuedCount} queued + {doneCount} done +
+
+
+
diff --git a/apps/desktop/src/components/AddDownloadsModal.tsx b/apps/desktop/src/components/AddDownloadsModal.tsx index 79b2936..f7526f1 100644 --- a/apps/desktop/src/components/AddDownloadsModal.tsx +++ b/apps/desktop/src/components/AddDownloadsModal.tsx @@ -8,12 +8,12 @@ import { invoke } from '@tauri-apps/api/core'; function determineCategory(fileName: string): DownloadCategory { const ext = fileName.split('.').pop()?.toLowerCase() || ''; - if (['mp4', 'mkv', 'webm', 'avi', 'mov', 'flv'].includes(ext)) return 'Video'; - if (['mp3', 'm4a', 'wav', 'flac', 'ogg', 'aac'].includes(ext)) return 'Audio'; + if (['mp4', 'mkv', 'avi', 'mov', 'wmv', 'flv', 'webm', 'm4v'].includes(ext)) return 'Movies'; + if (['mp3', 'wav', 'aac', 'flac', 'ogg', 'm4a', 'wma'].includes(ext)) return 'Musics'; if (['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'rtf'].includes(ext)) return 'Documents'; - if (['exe', 'dmg', 'pkg', 'app', 'apk', 'deb', 'rpm'].includes(ext)) return 'Apps'; - if (['jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'bmp', 'tiff'].includes(ext)) return 'Images'; - if (['zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz'].includes(ext)) return 'Archives'; + if (['exe', 'dmg', 'apk', 'app', 'pkg', 'deb', 'rpm', 'msi', 'iso', 'bin', 'run'].includes(ext)) return 'Applications'; + if (['jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'tiff', 'svg'].includes(ext)) return 'Pictures'; + if (['zip', 'rar', '7z', 'tar', 'gz', 'xz', 'bz2'].includes(ext)) return 'Compressed'; return 'Other'; } diff --git a/apps/desktop/src/components/DownloadTable.tsx b/apps/desktop/src/components/DownloadTable.tsx index 2e6ce2e..da81884 100644 --- a/apps/desktop/src/components/DownloadTable.tsx +++ b/apps/desktop/src/components/DownloadTable.tsx @@ -99,18 +99,19 @@ export const DownloadTable: React.FC = ({ filter }) => { const getCategoryIcon = (category: string) => { switch(category) { + case 'Musics': return ; + case 'Movies': return ; case 'Documents': return ; - case 'Images': return ; - case 'Audio': return ; - case 'Video': return ; - case 'Apps': return ; - case 'Archives': return ; + case 'Applications': return ; + case 'Pictures': return ; + case 'Compressed': return ; + case 'Other': return ; default: return ; } } return ( -
+
@@ -163,7 +164,7 @@ export const DownloadTable: React.FC = ({ filter }) => {
{/* Table */} -
+
@@ -269,11 +270,6 @@ export const DownloadTable: React.FC = ({ filter }) => {
- {/* Status Bar */} -
- {downloads.length} Item{downloads.length !== 1 ? 's' : ''} -
- {/* Floating Context Menu */} {contextMenu && contextItem && (
{ try { - const selected = await open({ + const base = await open({ directory: true, multiple: false }); - if (selected && typeof selected === 'string') { - // Automatically populate all category folders - const cleanBase = selected.endsWith('/') ? selected.slice(0, -1) : selected; - settings.setCategoryDirectory('Video', `${cleanBase}/Video`); - settings.setCategoryDirectory('Audio', `${cleanBase}/Audio`); + if (base && typeof base === 'string') { + const cleanBase = base.replace(/\/$/, ''); + settings.setCategoryDirectory('Musics', `${cleanBase}/Musics`); + settings.setCategoryDirectory('Movies', `${cleanBase}/Movies`); + settings.setCategoryDirectory('Compressed', `${cleanBase}/Compressed`); settings.setCategoryDirectory('Documents', `${cleanBase}/Documents`); - settings.setCategoryDirectory('Apps', `${cleanBase}/Apps`); - settings.setCategoryDirectory('Images', `${cleanBase}/Images`); - settings.setCategoryDirectory('Archives', `${cleanBase}/Archives`); + settings.setCategoryDirectory('Pictures', `${cleanBase}/Pictures`); + settings.setCategoryDirectory('Applications', `${cleanBase}/Applications`); settings.setCategoryDirectory('Other', `${cleanBase}/Other`); - showToast("Created subfolders for all categories"); + showToast("Updated all categories to use base folder"); } } catch (e) { console.error("Failed to browse base path:", e); @@ -492,13 +491,13 @@ export default function SettingsView() {
- {Object.keys(settings.downloadDirectories || {}).map((category) => ( + {['Musics', 'Movies', 'Compressed', 'Documents', 'Pictures', 'Applications', 'Other'].map((category) => (
settings.setCategoryDirectory(category, e.target.value)} className="flex-1 bg-bg-input border border-border-modal rounded-md px-3 py-1 text-xs text-text-primary font-mono" /> diff --git a/apps/desktop/src/components/Sidebar.tsx b/apps/desktop/src/components/Sidebar.tsx index 6d14790..6815640 100644 --- a/apps/desktop/src/components/Sidebar.tsx +++ b/apps/desktop/src/components/Sidebar.tsx @@ -168,7 +168,7 @@ export const Sidebar: React.FC = (props) => { }; return ( -