fix: make pinned items tab-specific and fix pinned file clicking
All checks were successful
Automated Container Build / build-and-push (push) Successful in 24s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 24s
This commit is contained in:
parent
e7cbb3c386
commit
f3ea79ab1f
1 changed files with 11 additions and 2 deletions
|
|
@ -1321,7 +1321,13 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
}, [displayFiles, activeSection, trashAutoPurgeDays]);
|
||||
|
||||
const renderPinnedSidebarSection = (filterExt?: string) => {
|
||||
const displayedPinned = filterExt ? pinnedFiles.filter(f => f.name.endsWith(filterExt)) : pinnedFiles;
|
||||
let displayedPinned = pinnedFiles;
|
||||
if (filterExt) {
|
||||
displayedPinned = pinnedFiles.filter(f => f.name.endsWith(filterExt));
|
||||
} else {
|
||||
// In "Drive" (files) mode, exclude office documents from the root pinned list
|
||||
displayedPinned = pinnedFiles.filter(f => !f.name.endsWith('.docx') && !f.name.endsWith('.pptx') && !f.name.endsWith('.xlsx') && !f.name.endsWith('.xls'));
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="py-1">
|
||||
|
|
@ -1380,7 +1386,10 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
color: activeSection === 'files' && currentPath === file.path ? 'var(--color-accent)' : 'var(--color-text-secondary)',
|
||||
borderTop: dragOverPinnedItem === file.path ? '2px solid var(--color-accent)' : '2px solid transparent',
|
||||
}}
|
||||
onClick={() => { setActiveSection('files'); navigateTo(file.path); }}
|
||||
onClick={(e) => {
|
||||
setActiveSection('files');
|
||||
handleFileClick(file, e as any);
|
||||
}}
|
||||
onContextMenu={(e) => handleContextMenu(e, file)}
|
||||
>
|
||||
<div className="w-4 h-4 flex items-center justify-center flex-shrink-0 [&>svg]:w-4 [&>svg]:h-4">
|
||||
|
|
|
|||
Reference in a new issue