- {/* Selection / clipboard bar */}
+ {/* ── Selection / clipboard bar ── */}
{(selCount > 0 || clipboard) && (
{selCount > 0 && (
@@ -538,12 +669,11 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
{loading && (
-
- Loading…
+ Loading…
)}
@@ -551,7 +681,7 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
Failed to load directory
{error}
-
@@ -602,6 +732,7 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
{renameEntry?.path === entry.path ? (
setRenameName(e.target.value)}
onKeyDown={e => {
@@ -609,12 +740,10 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
if (e.key === 'Escape') setRenameEntry(null);
}}
onBlur={() => void commitRename()}
- ref={renameInputRef}
onClick={e => e.stopPropagation()}
onFocus={e => {
- const dotIdx = renameName.lastIndexOf('.');
- const end = dotIdx > 0 ? dotIdx : renameName.length;
- e.currentTarget.setSelectionRange(0, end);
+ const dot = renameName.lastIndexOf('.');
+ e.currentTarget.setSelectionRange(0, dot > 0 ? dot : renameName.length);
}}
className="w-full px-1 py-0 border border-blue-400 rounded text-sm"
autoFocus
@@ -642,9 +771,7 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
))}
{visible.length === 0 && entries.length === 0 && (
-
- Empty folder — drop files here to upload
-
+
Empty folder — drop files here to upload
)}
{visible.length === 0 && entries.length > 0 && (
No files match the filter
@@ -653,9 +780,9 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
)}
- {/* Drag overlay */}
+ {/* ── Drag overlay ── */}
{dragOver && (
-
+
Drop to upload to {path}
@@ -663,7 +790,7 @@ export default function FileManager({ initialPath = '/', config, setConfig, onBa
)}
- {/* Per-entry action menu */}
+ {/* ── Per-entry action menu ── */}