fix(webui): enable rename and delete actions in file detail top bar breadcrumb (#288)

* fix(webui): enable rename and delete actions in file detail top bar breadcrumb

* fix(webui): select only base file name when renaming from file detail breadcrumb
This commit is contained in:
Yiling-J
2026-08-09 20:49:55 +08:00
committed by GitHub
parent e67552d8bd
commit a680fccb12
4 changed files with 200 additions and 8 deletions
+12 -7
View File
@@ -65,6 +65,8 @@ interface BreadcrumbNavProps {
shareId?: string
allowDownload?: boolean
onFolderClick?: (folderId: string) => void
onRename?: () => void
onDelete?: () => void
fileId?: string
downloadInfo?: {
originalKey?: string
@@ -103,6 +105,8 @@ export function BreadcrumbNav({
onChatbotToggle,
isPublic = false,
onFolderClick,
onRename,
onDelete,
fileId,
shareId,
allowDownload = true,
@@ -290,14 +294,15 @@ export function BreadcrumbNav({
{m.download()}
</DropdownMenuItem>
))}
{canEdit && (
<DropdownMenuItem onClick={() => console.log('Rename')}>
Rename
</DropdownMenuItem>
{canEdit && onRename && (
<DropdownMenuItem onClick={onRename}>{m.rename()}</DropdownMenuItem>
)}
{canEdit && (
<DropdownMenuItem onClick={() => console.log('Delete')}>
Delete
{canEdit && onDelete && (
<DropdownMenuItem
onClick={onDelete}
className="text-destructive focus:text-destructive"
>
{m.delete()}
</DropdownMenuItem>
)}
+4
View File
@@ -27,6 +27,8 @@ export function TopNav() {
shareId,
allowDownload,
onFolderClick,
onRename,
onDelete,
compareMode,
canCompareVersions,
onCompareVersions,
@@ -118,6 +120,8 @@ export function TopNav() {
downloadInfo={downloadInfo}
versions={versions}
onFolderClick={onFolderClick}
onRename={onRename}
onDelete={onDelete}
compareMode={compareMode}
canCompareVersions={canCompareVersions}
onCompareVersions={onCompareVersions}