diff --git a/src/app/components/FileManager.tsx b/src/app/components/FileManager.tsx index dcbd75a..f406c33 100644 --- a/src/app/components/FileManager.tsx +++ b/src/app/components/FileManager.tsx @@ -252,8 +252,10 @@ interface FileManagerProps { // ─── Main component ─────────────────────────────────────────────────────────── +const FM_PATH_KEY = 'fileManager.path'; + export default function FileManager({ initialPath = '/', config, setConfig, onBack }: FileManagerProps) { - const [path, setPath] = useState(normalizePath(initialPath)); + const [path, setPath] = useState(() => normalizePath(localStorage.getItem(FM_PATH_KEY) || initialPath)); const [entries, setEntries] = useState([]); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); @@ -303,7 +305,12 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa useEffect(() => { void load(path); }, [path, load]); - const navigateTo = (p: string) => { setPath(normalizePath(p)); setFilter(''); }; + const navigateTo = (p: string) => { + const norm = normalizePath(p); + localStorage.setItem(FM_PATH_KEY, norm); + setPath(norm); + setFilter(''); + }; const navigateUp = () => { if (path !== '/') navigateTo(splitPath(path).parent); }; // ── Sort + filter ──────────────────────────────────────────────────────── @@ -862,7 +869,7 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa )} - {actionEntry?.type === 'file' && fileCategory(actionEntry) === 'disk' && ( + {actionEntry?.type === 'file' && (