Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(mobile): rename resource Export menu to Download

tianma-if2c2b5e3f0c62
diff --git a/apps/mobile/src/components/MobileResourceActions.tsx b/apps/mobile/src/components/MobileResourceActions.tsx
index 076de533..9ee9ea4f 100644
--- a/apps/mobile/src/components/MobileResourceActions.tsx
+++ b/apps/mobile/src/components/MobileResourceActions.tsx
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState, type ReactNode } from "react";
import { ActivityIndicator, Alert, Modal, StyleSheet, View } from "react-native";
-import { FileText, HardDrive, MoreHorizontal, Pencil, Share2, Trash2, X } from "./icons";
+import { Download, FileText, MoreHorizontal, Pencil, Share2, Trash2, X } from "./icons";
import { Pressable, Text, TextInput } from "./LocalizedText";
import {
MobileResourceCancelledError,
@@ -28,9 +28,11 @@ const copy = {
delete: "删除",
attachmentDeleteConfirm: "附件会从存储空间和当前笔记中永久删除,此操作无法撤销。",
attachmentDeleteTitle: "删除附件",
- // Opens the system share sheet (not a silent download-to-folder).
+ // Opens the system share sheet (not a silent save-to-folder).
share: "分享",
- exportFailed: "无法导出",
+ // Saves to a user-chosen folder (Android SAF) or share-as-save fallback.
+ download: "下载",
+ downloadFailed: "无法下载",
failed: "资源操作失败,请重试。",
filename: "文件名",
rename: "重命名",
@@ -38,7 +40,6 @@ const copy = {
imageDeleteConfirm: "图片会从存储空间和当前笔记中永久删除,此操作无法撤销。",
imageDeleteTitle: "删除图片",
imageRenameTitle: "重命名图片",
- saveAs: "导出",
save: "保存",
syncedOnly: "资源同步完成后才能重命名或删除。",
},
@@ -49,9 +50,11 @@ const copy = {
delete: "Delete",
attachmentDeleteConfirm: "The attachment will be permanently removed from storage and this note. This cannot be undone.",
attachmentDeleteTitle: "Delete attachment",
- // Opens the system share sheet (not a silent download-to-folder).
+ // Opens the system share sheet (not a silent save-to-folder).
share: "Share",
- exportFailed: "Unable to export",
+ // Saves to a user-chosen folder (Android SAF) or share-as-save fallback.
+ download: "Download",
+ downloadFailed: "Unable to download",
failed: "The resource action failed. Try again.",
filename: "Filename",
rename: "Rename",
@@ -59,7 +62,6 @@ const copy = {
imageDeleteConfirm: "The image will be permanently removed from storage and this note. This cannot be undone.",
imageDeleteTitle: "Delete image",
imageRenameTitle: "Rename image",
- saveAs: "Export",
save: "Save",
syncedOnly: "Rename and delete are available after the resource has synced.",
},
@@ -168,7 +170,7 @@ export const MobileResourceActions = ({
};
/**
- * Share / export open Android system UI (share sheet or SAF folder picker).
+ * Share / download open Android system UI (share sheet or SAF folder picker).
* Dismiss our Modal first so the activity-result channel is free — otherwise SAF
* often never appears and the tap looks like a dead button.
*/
@@ -224,9 +226,9 @@ export const MobileResourceActions = ({
pending={pending}
/>
<ResourceActionRow
- icon={<HardDrive color="#0f172a" size={19} />}
- label={labels.saveAs}
- onPress={() => void runSystemUiAction((current) => onSaveAs(current), labels.exportFailed)}
+ icon={<Download color="#0f172a" size={19} />}
+ label={labels.download}
+ onPress={() => void runSystemUiAction((current) => onSaveAs(current), labels.downloadFailed)}
pending={pending}
/>
<ResourceActionRow disabled={!canMutate} icon={<Pencil color={canMutate ? "#0f172a" : "#94a3b8"} size={19} />} label={labels.rename} onPress={() => setMode("rename")} pending={pending} />
diff --git a/apps/mobile/src/lib/mobile-attachments.ts b/apps/mobile/src/lib/mobile-attachments.ts
index decba72f..56ccd93e 100644
--- a/apps/mobile/src/lib/mobile-attachments.ts
+++ b/apps/mobile/src/lib/mobile-attachments.ts
@@ -243,7 +243,7 @@ export const resolveExportFilename = (filename: string, mimeType: string) => {
export class MobileResourceCancelledError extends Error {
readonly code = "cancelled" as const;
- constructor(message = "已取消导出") {
+ constructor(message = "已取消下载") {
super(message);
this.name = "MobileResourceCancelledError";
}
@@ -291,7 +291,7 @@ export const openMobileResource = async (client: AttachmentClient, target: Mobil
};
/**
- * Export resource to a user-chosen folder (Android SAF) or the system share sheet.
+ * Download resource to a user-chosen folder (Android SAF) or the system share sheet.
* Android: the action sheet Modal must be closed first — SAF needs a free activity
* result channel; otherwise the folder picker never appears and it looks like a no-op.
*/
@@ -307,7 +307,7 @@ export const saveMobileResourceAs = async (client: AttachmentClient, target: Mob
const permission = await FileSystem.StorageAccessFramework.requestDirectoryPermissionsAsync();
if (!permission.granted) {
// Do not return null — callers treated that as success and closed the sheet.
- throw new MobileResourceCancelledError("已取消导出");
+ throw new MobileResourceCancelledError("已取消下载");
}
const destination = await FileSystem.StorageAccessFramework.createFileAsync(
permission.directoryUri,
@@ -323,9 +323,9 @@ export const saveMobileResourceAs = async (client: AttachmentClient, target: Mob
if (error instanceof MobileResourceCancelledError) {
throw error;
}
- // SAF is flaky on some OEM builds — fall back to the share sheet so export still works.
+ // SAF is flaky on some OEM builds — fall back to the share sheet so download still works.
await shareCachedResource(file.uri, {
- dialogTitle: `导出 ${exportName}`,
+ dialogTitle: `下载 ${exportName}`,
mimeType,
});
return { kind: "share" as const, uri: file.uri, filename: exportName };
@@ -333,7 +333,7 @@ export const saveMobileResourceAs = async (client: AttachmentClient, target: Mob
}
await shareCachedResource(file.uri, {
- dialogTitle: `导出 ${exportName}`,
+ dialogTitle: `下载 ${exportName}`,
mimeType,
});
return { kind: "share" as const, uri: file.uri, filename: exportName };
diff --git a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
index b6bfd6ed..32975052 100644
--- a/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
+++ b/apps/mobile/src/screens/WorkspaceMemoDetail.tsx
@@ -367,7 +367,7 @@ export const MemoDetailModal = ({
const result = await saveMobileResourceAs(client, target);
if (result.kind === "saf") {
Alert.alert(
- resolvedLocale === "en-US" ? "Exported" : "导出成功",
+ resolvedLocale === "en-US" ? "Downloaded" : "下载成功",
resolvedLocale === "en-US" ? `Saved ${result.filename}` : `已保存:${result.filename}`
);
}
diff --git a/apps/mobile/src/screens/WorkspaceScreen.tsx b/apps/mobile/src/screens/WorkspaceScreen.tsx
index ca2d7232..dd5ea2b4 100644
--- a/apps/mobile/src/screens/WorkspaceScreen.tsx
+++ b/apps/mobile/src/screens/WorkspaceScreen.tsx
@@ -1914,7 +1914,7 @@ const CreateMemoModal = ({
const result = await saveMobileResourceAs(client, target);
if (result.kind === "saf") {
Alert.alert(
- resolvedLocale === "en-US" ? "Exported" : "导出成功",
+ resolvedLocale === "en-US" ? "Downloaded" : "下载成功",
resolvedLocale === "en-US" ? `Saved ${result.filename}` : `已保存:${result.filename}`
);
}
@@ -2466,7 +2466,7 @@ const RichEditorModal = ({
const result = await saveMobileResourceAs(client, target);
if (result.kind === "saf") {
Alert.alert(
- resolvedLocale === "en-US" ? "Exported" : "导出成功",
+ resolvedLocale === "en-US" ? "Downloaded" : "下载成功",
resolvedLocale === "en-US" ? `Saved ${result.filename}` : `已保存:${result.filename}`
);
}