From 5ae3a6e58449970af8fa37163cd5fc248a58efa5 Mon Sep 17 00:00:00 2001 From: Jaime Idolpx Date: Tue, 9 Jun 2026 04:00:55 -0400 Subject: [PATCH] feat(StatusPage): remove directory and disk map overlays to simplify UI --- src/app/components/StatusPage.tsx | 132 +----------------------------- 1 file changed, 2 insertions(+), 130 deletions(-) diff --git a/src/app/components/StatusPage.tsx b/src/app/components/StatusPage.tsx index afcf331..5d60a1c 100644 --- a/src/app/components/StatusPage.tsx +++ b/src/app/components/StatusPage.tsx @@ -1,12 +1,10 @@ -import { useEffect, useState } from 'react'; -import { HardDrive, Activity, Wifi, Radio, Signal, Clock, RefreshCw, FolderOpen, Map, Loader2 } from 'lucide-react'; +import { useState } from 'react'; +import { HardDrive, Activity, Wifi, Radio, Clock, RefreshCw, Loader2 } from 'lucide-react'; import { useWs } from '../ws'; import DeviceDetailOverlay from './DeviceDetailOverlay'; import MediaSet from './MediaSet'; import { ImageWithFallback } from './figma/ImageWithFallback'; import { Dialog, DialogContent, DialogTitle, DialogDescription } from './ui/dialog'; -import DirectoryListing from './DirectoryListing'; -import { listDirectory, normalizePath, splitPath, type EntryInfo } from '../webdav'; interface StatusPageProps { config: any; @@ -82,51 +80,6 @@ export default function StatusPage({ config, setConfig }: StatusPageProps) { const [showResetModal, setShowResetModal] = useState(null); const [resetStatus, setResetStatus] = useState('idle'); // 'idle' | 'in-progress' | 'done' - // Overlay state for directory/disk map - const [showDirectory, setShowDirectory] = useState(false); - const [showDiskMap, setShowDiskMap] = useState(false); - - // Real directory contents for the active device's mounted file. - // Pulled from the WebDAV server (parent folder of the mounted image). - const [dirEntries, setDirEntries] = useState([]); - const [dirLoading, setDirLoading] = useState(false); - const [dirError, setDirError] = useState(null); - - const directoryPath: string | null = (() => { - const url = activeDevice?.url; - if (!url) return null; - return splitPath(normalizePath(url)).parent; - })(); - - useEffect(() => { - if (!showDirectory) return; - if (!directoryPath) { - setDirEntries([]); - setDirError(null); - return; - } - let cancelled = false; - setDirLoading(true); - setDirError(null); - listDirectory(directoryPath) - .then((items) => { - if (cancelled) return; - setDirEntries(items); - }) - .catch((e: any) => { - if (cancelled) return; - setDirError((e && e.message) || 'Failed to load directory'); - setDirEntries([]); - }) - .finally(() => { - if (cancelled) return; - setDirLoading(false); - }); - return () => { - cancelled = true; - }; - }, [showDirectory, directoryPath]); - return (
@@ -163,8 +116,6 @@ export default function StatusPage({ config, setConfig }: StatusPageProps) {
)} - {/* Directory and Disk Map buttons at bottom */} - {/* New device info cards */}
@@ -200,20 +151,6 @@ export default function StatusPage({ config, setConfig }: StatusPageProps) {
)} -
- - -
{showDeviceOverlay && ( @@ -236,71 +173,6 @@ export default function StatusPage({ config, setConfig }: StatusPageProps) { /> )} - {/* Directory Overlay */} - {showDirectory && ( - <> -
setShowDirectory(false)} /> -
e.stopPropagation()}> -
-
-

Directory

-
- Device #{activeDevice.number} • {activeDevice.url ? activeDevice.url.split('/').pop() : 'No file mounted'} -
-
- -
-
- {!activeDevice?.url && ( -
- No file mounted on this device. -
- )} - - {activeDevice?.url && dirLoading && ( -
- - Loading directory from WebDAV… -
- )} - - {activeDevice?.url && !dirLoading && dirError && ( -
-
Failed to load directory
-
{dirError}
-
- )} - - {activeDevice?.url && !dirLoading && !dirError && ( - ({ - name: e.name, - type: e.type === 'folder' ? 'DIR' : (e.name.split('.').pop() || 'FILE').toUpperCase(), - blocks: e.type === 'file' ? Math.max(1, Math.ceil(e.size / 254)) : 0, - }))} - footerNote={`${dirEntries.length} ENTRIES · ${directoryPath ?? ''}`} - /> - )} -
-
- - )} - - {/* Disk Map Overlay */} - {showDiskMap && ( - <> -
setShowDiskMap(false)} /> -
e.stopPropagation()}> -
-

Disk Map

- -
-
- Disk map visualization goes here. -
-
- - )} {/* Reset Activity Modal */} !open && setShowResetModal(null)}>