mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 11:24:43 +00:00
fix(backend,ui): fix version stack overcounting and ShareManager navigation issues
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
ContextMenuSub,
|
||||
ContextMenuSubContent,
|
||||
ContextMenuSubTrigger,
|
||||
ContextMenuPortal,
|
||||
} from '@/ui/components/ui/context-menu'
|
||||
import {
|
||||
Download,
|
||||
@@ -177,16 +178,18 @@ export function FileBrowserContextMenu({
|
||||
<Link className="mr-2 h-4 w-4" />
|
||||
<span>Add to Share Links</span>
|
||||
</ContextMenuSubTrigger>
|
||||
<ContextMenuSubContent className="w-48">
|
||||
{shareLinks.map((share) => (
|
||||
<ContextMenuItem
|
||||
key={share.id}
|
||||
onSelect={() => onAddToShareLink?.(share.id, itemsToModify)}
|
||||
>
|
||||
<span className="truncate">{share.name}</span>
|
||||
</ContextMenuItem>
|
||||
))}
|
||||
</ContextMenuSubContent>
|
||||
<ContextMenuPortal>
|
||||
<ContextMenuSubContent className="w-48">
|
||||
{shareLinks.map((share) => (
|
||||
<ContextMenuItem
|
||||
key={share.id}
|
||||
onSelect={() => onAddToShareLink?.(share.id, itemsToModify)}
|
||||
>
|
||||
<span className="truncate">{share.name}</span>
|
||||
</ContextMenuItem>
|
||||
))}
|
||||
</ContextMenuSubContent>
|
||||
</ContextMenuPortal>
|
||||
</ContextMenuSub>
|
||||
)}
|
||||
</ContextMenuContent>
|
||||
@@ -241,16 +244,18 @@ export function FileBrowserContextMenu({
|
||||
<Link className="mr-2 h-4 w-4" />
|
||||
<span>Add to Share Links</span>
|
||||
</ContextMenuSubTrigger>
|
||||
<ContextMenuSubContent className="w-48">
|
||||
{shareLinks.map((share) => (
|
||||
<ContextMenuItem
|
||||
key={share.id}
|
||||
onSelect={() => onAddToShareLink?.(share.id, itemsToModify)}
|
||||
>
|
||||
<span className="truncate">{share.name}</span>
|
||||
</ContextMenuItem>
|
||||
))}
|
||||
</ContextMenuSubContent>
|
||||
<ContextMenuPortal>
|
||||
<ContextMenuSubContent className="w-48">
|
||||
{shareLinks.map((share) => (
|
||||
<ContextMenuItem
|
||||
key={share.id}
|
||||
onSelect={() => onAddToShareLink?.(share.id, itemsToModify)}
|
||||
>
|
||||
<span className="truncate">{share.name}</span>
|
||||
</ContextMenuItem>
|
||||
))}
|
||||
</ContextMenuSubContent>
|
||||
</ContextMenuPortal>
|
||||
</ContextMenuSub>
|
||||
)}
|
||||
</ContextMenuContent>
|
||||
|
||||
@@ -56,10 +56,12 @@ export default function ShareManager({
|
||||
const [ancestorFolders, setAncestorFolders] = useState<AncestorFolder[]>([])
|
||||
|
||||
useEffect(() => {
|
||||
if (shareRootId && !currentFolderId) {
|
||||
if (shareRootId) {
|
||||
setCurrentFolderId(shareRootId)
|
||||
setAncestorFolders([])
|
||||
setSelectedIds(new Set())
|
||||
}
|
||||
}, [shareRootId, currentFolderId])
|
||||
}, [shareRootId, shareId])
|
||||
|
||||
const setProjectState = useTopNavStore((s) => s.setProjectState)
|
||||
const clearProjectState = useTopNavStore((s) => s.clearProjectState)
|
||||
@@ -157,7 +159,7 @@ export default function ShareManager({
|
||||
: folders.find((f) => f.id === currentFolderId)?.name || shareLink.name,
|
||||
type: 'folder',
|
||||
},
|
||||
isRootFolder: currentFolderId === shareRootId,
|
||||
isRootFolder: false, // Ensure share link name or subfolder is always shown in TopNav
|
||||
shareId,
|
||||
onFolderClick: handleBreadcrumbClick,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user