@@ -301,6 +403,15 @@ export default function AgentOPFS() {
...(entry.kind === "file" && entry.size != null ? [formatSize(entry.size)] : []),
...(entry.lastModified ? [dayFormat(new Date(entry.lastModified), "MM-DD HH:mm")] : []),
].join(" · ");
+ const items = menuItems(entry, {
+ openEntry,
+ handleDownload,
+ handleDelete,
+ openRenameDialog,
+ openMoveDialog,
+ t,
+ editable,
+ });
return (
{sub}
-
+ {items.length > 0 &&
}
);
})}
@@ -349,7 +460,7 @@ export default function AgentOPFS() {
dir={sort.dir}
onClick={() => toggleSort("time")}
/>
-
{t("agent:opfs_actions")}
+
{t("agent:opfs_actions")}
{sorted.map((entry) => {
const meta = entryMeta(entry);
@@ -381,12 +492,15 @@ export default function AgentOPFS() {
+
@@ -407,6 +521,47 @@ export default function AgentOPFS() {
onOpenChange={(v) => (v ? undefined : closePreview())}
/>
)}
+
+
);
}
@@ -439,19 +594,25 @@ function SortHeader({
);
}
-// 移动端 kebab 菜单项:按类型给出 预览 / 下载 / 删除
+// 移动端 kebab 菜单项:按权限给出 预览 / 下载 / 重命名 / 移动 / 删除
function menuItems(
entry: FileEntry,
{
openEntry,
handleDownload,
handleDelete,
+ openRenameDialog,
+ openMoveDialog,
t,
+ editable,
}: {
openEntry: (e: FileEntry) => void | Promise