let anyone toggle hidden files again
the show/hide dotfiles button was dead for members. they open the browser at their own home, that home is `/`, and the toggle is disabled at `/`. it was never meant to apply to them.74894b0cwrote it as user?.role === 'Super Admin' && currentPath === '/' to keep the OWNER's home root readable — it is all .bashrc and .ssh and .claude. then044aacf4removed the multi-user surface, dropped users.role, and noted in its own message that "every role === 'Super Admin' check was permanently true". so it folded the conjunct away and left `currentPath === '/'`. correct on a single-user server. multi-user came back on 2026-08-07 and this line did not come back with it, so a rule about one account's home quietly became a rule about everyone's — and members feel it constantly, because members are always at their root. removed rather than restored to owner-only: the point was a tidy default, not a prohibition, and `files/showHidden` already defaults to false. so dotfiles stay hidden until asked for, everywhere, for everyone — and the asking now works. the server never filtered dotfiles; readdir returns them and always did. this was only ever the client. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+3
-5
@@ -23,7 +23,6 @@ export const Toolbar = ({ fileBrowserManager }: ToolbarProps) => {
|
|||||||
setViewMode,
|
setViewMode,
|
||||||
setShowVideoDownload,
|
setShowVideoDownload,
|
||||||
setShowDictate,
|
setShowDictate,
|
||||||
hiddenForced,
|
|
||||||
} = fileBrowserManager;
|
} = fileBrowserManager;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -124,11 +123,10 @@ export const Toolbar = ({ fileBrowserManager }: ToolbarProps) => {
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowHidden((v) => !v)}
|
onClick={() => setShowHidden((v) => !v)}
|
||||||
disabled={hiddenForced}
|
className={`hidden md:block p-1.5 rounded-md cursor-pointer transition-colors ${showHidden ? 'bg-duck-teal text-duck-yellow' : 'text-duck-teal hover:bg-duck-dark/5'}`}
|
||||||
className={`hidden md:block p-1.5 rounded-md transition-colors ${hiddenForced ? 'opacity-30 cursor-not-allowed' : `cursor-pointer ${showHidden && !hiddenForced ? 'bg-duck-teal text-duck-yellow' : 'text-duck-teal hover:bg-duck-dark/5'}`}`}
|
title={showHidden ? 'Hide hidden files' : 'Show hidden files'}
|
||||||
title={hiddenForced ? 'Hidden files not shown in home directory' : showHidden ? 'Hide hidden files' : 'Show hidden files'}
|
|
||||||
>
|
>
|
||||||
{showHidden && !hiddenForced ? <Eye className="h-4 w-4" /> : <EyeOff className="h-4 w-4" />}
|
{showHidden ? <Eye className="h-4 w-4" /> : <EyeOff className="h-4 w-4" />}
|
||||||
</button>
|
</button>
|
||||||
<div className="flex items-center border border-duck-dark/20 rounded-md overflow-hidden">
|
<div className="flex items-center border border-duck-dark/20 rounded-md overflow-hidden">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -97,8 +97,7 @@ export const useFileBrowserApp = (basePath: string, rootOverride?: string, urlPa
|
|||||||
filesRef.current = files;
|
filesRef.current = files;
|
||||||
const currentPathRef = useRef(currentPath);
|
const currentPathRef = useRef(currentPath);
|
||||||
currentPathRef.current = currentPath;
|
currentPathRef.current = currentPath;
|
||||||
const hiddenForced = currentPath === '/';
|
const visibleEntries = showHidden ? entries : entries.filter((e) => !e.name.startsWith('.'));
|
||||||
const visibleEntries = showHidden && !hiddenForced ? entries : entries.filter((e) => !e.name.startsWith('.'));
|
|
||||||
|
|
||||||
const entryPath = (name: string) => (currentPath === '/' ? `/${name}` : `${currentPath}/${name}`);
|
const entryPath = (name: string) => (currentPath === '/' ? `/${name}` : `${currentPath}/${name}`);
|
||||||
const selectedPaths = () => Array.from(selected).map(entryPath);
|
const selectedPaths = () => Array.from(selected).map(entryPath);
|
||||||
@@ -676,7 +675,6 @@ export const useFileBrowserApp = (basePath: string, rootOverride?: string, urlPa
|
|||||||
setViewMode,
|
setViewMode,
|
||||||
showHidden,
|
showHidden,
|
||||||
setShowHidden,
|
setShowHidden,
|
||||||
hiddenForced,
|
|
||||||
// Selection
|
// Selection
|
||||||
selected,
|
selected,
|
||||||
setSelected,
|
setSelected,
|
||||||
|
|||||||
Reference in New Issue
Block a user