From 6e916f05afdf1b9e46759c3ebdc366342e4b0ade Mon Sep 17 00:00:00 2001 From: Launch Lee <80872691+LaunchLee@users.noreply.github.com> Date: Mon, 9 Nov 2026 04:42:33 +0000 Subject: [PATCH 01/27] Update zh-cn.json and zh-hant.json (#3022) (cherry picked from commit dba9741f04a8e014093fbb50607fe0ff7cb8d90b) --- src/lang/zh-cn.json | 74 +++++++++++++++++----------------- src/lang/zh-hant.json | 92 +++++++++++++++++++++---------------------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 5e10cf0..a85376e 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -213,7 +213,7 @@ "app settings": "应用设置", "disable in-app-browser caching": "关闭内置浏览器缓存", "copied to clipboard": "复制到剪贴板", - "clipboard not available": "Clipboard is not available.", + "clipboard not available": "剪贴板不可用。", "remember opened files": "记住打开过的文件", "remember opened folders": "记住打开过的文件夹", "no suggestions": "不显示建议", @@ -385,11 +385,11 @@ "quicktools:exclamation": "插入感叹号", "quicktools:alt-key": "Alt 键", "quicktools:meta-key": "Windows/Meta 键", - "quicktools:search-prev": "Previous Match", - "quicktools:search-next": "Next Match", - "quicktools:search-settings": "Search Settings", - "quicktools:search-replace": "Replace", - "quicktools:search-replace-all": "Replace All", + "quicktools:search-prev": "上一个匹配项", + "quicktools:search-next": "下一个匹配项", + "quicktools:search-settings": "搜索设置", + "quicktools:search-replace": "替换", + "quicktools:search-replace-all": "全部替换", "info-quicktoolssettings": "个性化编辑器下边的快捷工具栏内的快捷键按钮和键盘按键以增强代码体验。", "info-excludefolders": "使用表达式 **/node_modules/** 以忽略所有 node_modules 文件夹下的文件。这将排除文件列表中列出的文件并阻止在这些文件中搜索。", "missed files": "自搜索开始后扫描了 {count} 个文件并将不会被包含在搜索中。", @@ -592,14 +592,14 @@ "lsp-startup-timeout-set": "启动超时已设置为 {timeout} ms", "lsp-state-disabled": "禁用", "lsp-state-enabled": "启用", - "lsp-status": "Status", + "lsp-status": "状态", "lsp-status-check-failed": "检查失败", "lsp-status-installed": "已安装", "lsp-status-installed-version": "已安装({version})", "lsp-status-line": "状态:{status}", "lsp-status-not-installed": "未安装", "lsp-status-unknown": "未知", - "lsp-timeout-ms": "{timeout} ms", + "lsp-timeout-ms": "{timeout} 毫秒", "lsp-uninstall-command-unavailable": "卸载命令不可用", "lsp-uninstall-notification": "点击卸载 {server}。", "lsp-uninstall-server": "卸载服务器", @@ -723,13 +723,13 @@ "unpin tab before closing": "关闭前请先取消固定该标签页。", "app font": "应用字体", "app icon": "应用图标", - "app icon changed": "App icon changed", - "app icon change warning": "The app will exit after the app icon is changed.", + "app icon changed": "应用图标已更改", + "app icon change warning": "更改应用图标后,应用将退出。", "settings-info-app-font-family": "选择在应用界面中使用的字体。", "settings-info-app-icon": "选择在设备上显示的应用图标。", "lsp-transport-method-stdio": "STDIO(启动可执行命令)", "lsp-transport-method-websocket": "WebSocket(连接到 ws/wss URL)", - "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-url": "WebSocket 地址", "lsp-websocket-server-managed-externally": "该服务器通过 WebSocket 在外部管理。", "lsp-error-websocket-url-invalid": "WebSocket URL 必须以 ws:// 或 wss:// 开头", "lsp-error-websocket-url-required": "必须提供 WebSocket URL", @@ -803,7 +803,7 @@ "quicktools-trigger:touch": "触摸", "settings-info-terminal-uninstall": "确定要卸载终端?", "terminal:inactive outline": "方框", - "restored successfully": "终端重置成功", + "restored successfully": "终端恢复成功", "uninstalled successfully": "终端卸载成功", "enter plugin source": "输入插件源", "enter keywords": "输入关键字", @@ -886,34 +886,34 @@ "wrap-indent-same": "与首行对齐", "wrap-indent-indent": "缩进(+1 级)", "wrap-indent-deep": "深度缩进(+2 级)", - "settings-info-editor-wrapping-indent": "选择折行后的文本是从行首靠左对齐、保持原行的缩进,还是进一步向内缩进。每增加一级缩进将遵循您设定的制表符宽度。", + "settings-info-editor-wrapping-indent": "选择折行后的文本是靠左对齐、保持原行的缩进,还是进一步缩进。每增加一级缩进,宽度均为所设置的制表符宽度。", "icon pack": "图标包", "settings-info-icon-pack": "选择资源管理器及整个应用文件列表中文件和文件夹所使用的图标。", "unavailable": "不可用", - "editor renderer": "Renderer", - "editor renderer dom": "DOM (default)", - "editor renderer canvas": "Canvas (experimental)", - "settings-info-editor-renderer": "Canvas draws code with the GPU for smoother scrolling in large files. It is experimental: some plugins may not work with it. Applies after a reload.", - "canvas backend": "Canvas backend", - "canvas backend auto": "Auto (WebGL2)", - "settings-info-canvas-backend": "The GPU API the canvas renderer draws with. WebGPU falls back to WebGL2 where it isn't available. Applies after a reload.", - "sticky scroll": "Sticky scroll", - "settings-info-sticky-scroll": "Keep the first lines of the functions, classes and blocks around the top line pinned while scrolling.", - "sticky scroll max lines": "Sticky scroll lines", - "settings-info-sticky-scroll-max-lines": "The most header lines sticky scroll keeps pinned at the top (1–10).", - "gutter markers": "Gutter markers", - "gutter markers shared": "One column", - "gutter markers columns": "Column per gutter", - "gutter markers overlay": "Over line numbers", - "settings-info-gutter-markers": "Where lint and other gutter markers go: one shared column, a column for each gutter, or over the line numbers to save width.", - "cursor blink rate": "Cursor blink rate", - "settings-info-cursor-blink-rate": "How long one cursor blink takes, in milliseconds. 0 keeps the cursor steady.", - "settings-info-scroll-speed": "How far a fling or a mouse wheel turn scrolls the editor.", - "clear all": "Clear all", - "error-permission-revoked": "Acode can no longer access this location. Open the folder again to grant access.", - "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", - "error-no-space": "There isn't enough storage space left on this device.", - "error-network": "Couldn't reach the server. Check your connection and try again.", + "editor renderer": "渲染器", + "editor renderer dom": "DOM(默认)", + "editor renderer canvas": "Canvas(实验性)", + "settings-info-editor-renderer": "Canvas 使用 GPU 绘制代码,使大文件中的滚动更流畅。此功能仍处于实验阶段,部分插件可能不兼容。重新加载后生效。", + "canvas backend": "Canvas 后端", + "canvas backend auto": "自动(WebGL2)", + "settings-info-canvas-backend": "Canvas 渲染器用于绘制的 GPU API。若 WebGPU 不可用,则回退至 WebGL2。重新加载后生效。", + "sticky scroll": "粘性滚动", + "settings-info-sticky-scroll": "滚动时,将当前顶部行所在函数、类和代码块的首行固定在编辑器顶部。", + "sticky scroll max lines": "粘性滚动行数", + "settings-info-sticky-scroll-max-lines": "粘性滚动固定在顶部的最大标题行数(1–10)。", + "gutter markers": "边栏标记", + "gutter markers shared": "共用一列", + "gutter markers columns": "每种边栏独占一列", + "gutter markers overlay": "覆盖行号", + "settings-info-gutter-markers": "设置语法检查等边栏标记的位置:共用一列、每种边栏独占一列,或覆盖在行号上以节省宽度。", + "cursor blink rate": "光标闪烁周期", + "settings-info-cursor-blink-rate": "光标闪烁一次所需的时间,单位为毫秒。设为 0 时,光标不闪烁。", + "settings-info-scroll-speed": "设置滑动手势或转动鼠标滚轮时编辑器的滚动距离。", + "clear all": "全部清除", + "error-permission-revoked": "Acode 已无法访问此位置。请重新打开文件夹以授予访问权限。", + "error-not-found": "此文件或文件夹已不存在,可能已被移动、重命名或删除。", + "error-no-space": "此设备的剩余存储空间不足。", + "error-network": "无法连接到服务器。请检查网络连接后重试。", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 584d3cc..c6c80b3 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -213,7 +213,7 @@ "app settings": "應用設置", "disable in-app-browser caching": "關閉內置瀏覽器緩存", "copied to clipboard": "復製到剪貼板", - "clipboard not available": "Clipboard is not available.", + "clipboard not available": "剪貼簿無法使用。", "remember opened files": "記住打開過的文件", "remember opened folders": "記住打開過的文件夾", "no suggestions": "不顯示建議", @@ -385,11 +385,11 @@ "quicktools:exclamation": "插入感嘆號", "quicktools:alt-key": "Alt 鍵", "quicktools:meta-key": "Windows/Meta 鍵", - "quicktools:search-prev": "Previous Match", - "quicktools:search-next": "Next Match", - "quicktools:search-settings": "Search Settings", - "quicktools:search-replace": "Replace", - "quicktools:search-replace-all": "Replace All", + "quicktools:search-prev": "上一個符合項目", + "quicktools:search-next": "下一個符合項目", + "quicktools:search-settings": "搜尋設定", + "quicktools:search-replace": "替換", + "quicktools:search-replace-all": "全部替換", "info-quicktoolssettings": "個性化編輯器下邊的快捷工具欄內的快捷鍵按鈕和鍵盤按鍵以增強代碼體驗。", "info-excludefolders": "使用表達式 **/node_modules/** 以忽略所有 node_modules 文件夾下的文件。這將排除文件列表中列出的文件並阻止在這些文件中搜索。", "missed files": "自搜索開始後掃描了 {count} 個文件並將不會被包含在搜索中。", @@ -592,14 +592,14 @@ "lsp-startup-timeout-set": "啟動超時已設置為 {timeout} ms", "lsp-state-disabled": "禁用", "lsp-state-enabled": "啟用", - "lsp-status": "Status", + "lsp-status": "狀態", "lsp-status-check-failed": "檢查失敗", "lsp-status-installed": "已安裝", "lsp-status-installed-version": "已安裝({version})", "lsp-status-line": "狀態:{status}", "lsp-status-not-installed": "未安裝", "lsp-status-unknown": "未知", - "lsp-timeout-ms": "{timeout} ms", + "lsp-timeout-ms": "{timeout} 毫秒", "lsp-uninstall-command-unavailable": "卸載命令不可用", "lsp-uninstall-notification": "點擊卸載 {server}。", "lsp-uninstall-server": "卸載服務器", @@ -723,13 +723,13 @@ "unpin tab before closing": "關閉前請先取消固定該標籤頁。", "app font": "應用字體", "app icon": "應用程式圖示", - "app icon changed": "App icon changed", - "app icon change warning": "The app will exit after the app icon is changed.", + "app icon changed": "應用程式圖示已變更", + "app icon change warning": "變更應用程式圖示後,應用程式將結束。", "settings-info-app-font-family": "選擇在應用介面中使用的字體。", "settings-info-app-icon": "選擇在裝置上顯示的應用程式圖示。", "lsp-transport-method-stdio": "STDIO(啟動可執行命令)", "lsp-transport-method-websocket": "WebSocket(連線至 ws/wss URL)", - "lsp-websocket-url": "WebSocket URL", + "lsp-websocket-url": "WebSocket 位址", "lsp-websocket-server-managed-externally": "此伺服器透過 WebSocket 由外部管理。", "lsp-error-websocket-url-invalid": "WebSocket URL 必須以 ws:// 或 wss:// 開頭", "lsp-error-websocket-url-required": "必須提供 WebSocket URL", @@ -803,7 +803,7 @@ "quicktools-trigger:touch": "觸控", "settings-info-terminal-uninstall": "確定要卸載終端?", "terminal:inactive outline": "方框", - "restored successfully": "終端重置成功", + "restored successfully": "終端還原成功", "uninstalled successfully": "終端卸載成功", "enter plugin source": "輸入插件來源", "enter keywords": "輸入關鍵字", @@ -840,23 +840,23 @@ "command": "命令", "managed": "已託管", "acode service": "Acode 服務", - "info-terminal-show-scrollbar": "在終端旁邊顯示 xterm 滾動條。", - "terminal:show scrollbar": "顯示滾動條", + "info-terminal-show-scrollbar": "在終端旁邊顯示 xterm 捲動條。", + "terminal:show scrollbar": "顯示捲動條", "apply exclusions when copying": "複製時應用排除項", - "settings-info-app-use-file-operation-exclusions": "在複製和粘貼操作期間,跳過符合排除規則的文件和文件夾。", - "horizontal scroll margin": "水平滾動邊距", - "settings-info-horizontal-scroll-margin": "在關閉自動換行時,爲最長行的末尾添加空白區域。請輸入任意非負整數的像素值。", + "settings-info-app-use-file-operation-exclusions": "在複製和貼上操作期間,略過符合排除規則的檔案和資料夾。", + "horizontal scroll margin": "水平捲動邊距", + "settings-info-horizontal-scroll-margin": "關閉自動換行時,在最長行的末尾加入空白區域。請輸入以像素為單位的非負整數。", "confirm app icon reward": "觀看一則獎勵廣告以套用此應用程式圖示?", "rewarded ad unavailable": "獎勵廣告暫時無法使用,請再試一次。", "rewarded ad failed": "廣告未能完成,請再試一次。", "rewarded ad incomplete": "請完整觀看廣告以獲得獎勵。", - "plugin-review:dialog-label": "外掛評論", + "plugin-review:dialog-label": "插件評論", "plugin-review:account-check-failed": "無法檢查你的帳戶,請再試一次。", "plugin-review:sign-in": "登入以撰寫評論", "plugin-review:edit": "編輯你的評論", "plugin-review:add": "新增評論…", "plugin-review:placeholder": "分享你的使用體驗…", - "plugin-review:input-label": "外掛評論", + "plugin-review:input-label": "插件評論", "plugin-review:vote-group-label": "投票", "plugin-review:thumbs-up": "讚", "plugin-review:thumbs-down": "倒讚", @@ -877,7 +877,7 @@ "plugin-review:delete-failed": "無法刪除評論。", "plugin-review:you": "你", "plugin-review:edit-action": "編輯評論", - "plugin-review:recommended": "推薦了此外掛", + "plugin-review:recommended": "推薦了此插件", "plugin-review:error-max-length": "評論不得超過 {max} 個字元。", "plugin-review:error-downvote-comment": "告訴開發者哪些地方可以改進。", "plugin-review:error-empty": "新增留言或選擇「讚」。", @@ -886,34 +886,34 @@ "wrap-indent-same": "與首行對齊", "wrap-indent-indent": "縮排(+1 級)", "wrap-indent-deep": "深度縮排(+2 級)", - "settings-info-editor-wrapping-indent": "選擇換行後的文字是靠左對齊、保持原行的縮排,還是進一步向內縮排。每增加一級縮排將遵循您設定的製表符寬度。", + "settings-info-editor-wrapping-indent": "選擇換行後的文字是靠左對齊、保持原行的縮排,還是進一步縮排。每增加一級縮排,寬度均為所設定的定位字元寬度。", "icon pack": "圖標包", - "settings-info-icon-pack": "選擇檔案總管及整個應用程式檔案列表中檔案和文件夾所使用的圖標。", + "settings-info-icon-pack": "選擇檔案總管及整個應用程式檔案清單中,檔案和資料夾所使用的圖標。", "unavailable": "不可用", - "editor renderer": "Renderer", - "editor renderer dom": "DOM (default)", - "editor renderer canvas": "Canvas (experimental)", - "settings-info-editor-renderer": "Canvas draws code with the GPU for smoother scrolling in large files. It is experimental: some plugins may not work with it. Applies after a reload.", - "canvas backend": "Canvas backend", - "canvas backend auto": "Auto (WebGL2)", - "settings-info-canvas-backend": "The GPU API the canvas renderer draws with. WebGPU falls back to WebGL2 where it isn't available. Applies after a reload.", - "sticky scroll": "Sticky scroll", - "settings-info-sticky-scroll": "Keep the first lines of the functions, classes and blocks around the top line pinned while scrolling.", - "sticky scroll max lines": "Sticky scroll lines", - "settings-info-sticky-scroll-max-lines": "The most header lines sticky scroll keeps pinned at the top (1–10).", - "gutter markers": "Gutter markers", - "gutter markers shared": "One column", - "gutter markers columns": "Column per gutter", - "gutter markers overlay": "Over line numbers", - "settings-info-gutter-markers": "Where lint and other gutter markers go: one shared column, a column for each gutter, or over the line numbers to save width.", - "cursor blink rate": "Cursor blink rate", - "settings-info-cursor-blink-rate": "How long one cursor blink takes, in milliseconds. 0 keeps the cursor steady.", - "settings-info-scroll-speed": "How far a fling or a mouse wheel turn scrolls the editor.", - "clear all": "Clear all", - "error-permission-revoked": "Acode can no longer access this location. Open the folder again to grant access.", - "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", - "error-no-space": "There isn't enough storage space left on this device.", - "error-network": "Couldn't reach the server. Check your connection and try again.", + "editor renderer": "渲染器", + "editor renderer dom": "DOM(預設)", + "editor renderer canvas": "Canvas(實驗性)", + "settings-info-editor-renderer": "Canvas 使用 GPU 繪製代碼,讓大型檔案中的捲動更流暢。此功能仍處於實驗階段,部分插件可能不相容。重新載入後生效。", + "canvas backend": "Canvas 後端", + "canvas backend auto": "自動(WebGL2)", + "settings-info-canvas-backend": "Canvas 渲染器用於繪製的 GPU API。若 WebGPU 無法使用,則改用 WebGL2。重新載入後生效。", + "sticky scroll": "黏性捲動", + "settings-info-sticky-scroll": "捲動時,將目前頂端行所在函式、類別和代碼區塊的首行固定在編輯器頂端。", + "sticky scroll max lines": "黏性捲動行數", + "settings-info-sticky-scroll-max-lines": "黏性捲動固定在頂端的標題行數上限(1–10)。", + "gutter markers": "側欄標記", + "gutter markers shared": "共用一欄", + "gutter markers columns": "每種側欄各佔一欄", + "gutter markers overlay": "覆蓋行號", + "settings-info-gutter-markers": "設定語法檢查等側欄標記的位置:共用一欄、每種側欄各佔一欄,或覆蓋在行號上以節省寬度。", + "cursor blink rate": "游標閃爍週期", + "settings-info-cursor-blink-rate": "游標閃爍一次所需的時間,單位為毫秒。設為 0 時,游標不閃爍。", + "settings-info-scroll-speed": "設定滑動手勢或轉動滑鼠滾輪時編輯器的捲動距離。", + "clear all": "全部清除", + "error-permission-revoked": "Acode 已無法存取此位置。請重新開啟資料夾以授予存取權限。", + "error-not-found": "此檔案或資料夾已不存在,可能已被移動、重新命名或刪除。", + "error-no-space": "此裝置的剩餘儲存空間不足。", + "error-network": "無法連線至伺服器。請檢查網路連線後重試。", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" From f066852508f8a693c9e1d767eed6addda441d382 Mon Sep 17 00:00:00 2001 From: Jamal Ali Date: Mon, 9 Nov 2026 04:56:14 +0000 Subject: [PATCH 02/27] chore(lang): translate remaining Azerbaijani UI strings (#3012) (cherry picked from commit 568286d5186ebf37334a86d24a93eb36c1f6daac) --- src/lang/az-az.json | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lang/az-az.json b/src/lang/az-az.json index 6d982f7..74e9c71 100644 --- a/src/lang/az-az.json +++ b/src/lang/az-az.json @@ -890,30 +890,30 @@ "plugin-review:error-downvote-comment": "Nəyin yaxşılaşdırıla biləcəyini tərtibatçıya bildir.", "plugin-review:error-empty": "Şərh əlavə et və ya «Bəyən» seçimini et.", "plugin-review:unrated": "Qiymətləndirilməyib", - "editor renderer": "Renderer", - "editor renderer dom": "DOM (default)", - "editor renderer canvas": "Canvas (experimental)", - "settings-info-editor-renderer": "Canvas draws code with the GPU for smoother scrolling in large files. It is experimental: some plugins may not work with it. Applies after a reload.", - "canvas backend": "Canvas backend", - "canvas backend auto": "Auto (WebGL2)", - "settings-info-canvas-backend": "The GPU API the canvas renderer draws with. WebGPU falls back to WebGL2 where it isn't available. Applies after a reload.", - "sticky scroll": "Sticky scroll", - "settings-info-sticky-scroll": "Keep the first lines of the functions, classes and blocks around the top line pinned while scrolling.", - "sticky scroll max lines": "Sticky scroll lines", - "settings-info-sticky-scroll-max-lines": "The most header lines sticky scroll keeps pinned at the top (1–10).", - "gutter markers": "Gutter markers", - "gutter markers shared": "One column", - "gutter markers columns": "Column per gutter", - "gutter markers overlay": "Over line numbers", - "settings-info-gutter-markers": "Where lint and other gutter markers go: one shared column, a column for each gutter, or over the line numbers to save width.", - "cursor blink rate": "Cursor blink rate", - "settings-info-cursor-blink-rate": "How long one cursor blink takes, in milliseconds. 0 keeps the cursor steady.", - "settings-info-scroll-speed": "How far a fling or a mouse wheel turn scrolls the editor.", - "clear all": "Clear all", - "error-permission-revoked": "Acode can no longer access this location. Open the folder again to grant access.", - "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", - "error-no-space": "There isn't enough storage space left on this device.", - "error-network": "Couldn't reach the server. Check your connection and try again.", + "editor renderer": "Göstərmə üsulu", + "editor renderer dom": "DOM (standart)", + "editor renderer canvas": "Canvas (sınaq mərhələsində)", + "settings-info-editor-renderer": "Canvas böyük fayllarda daha axıcı sürüşdürmə üçün kodu GPU ilə göstərir. Bu funksiya sınaq mərhələsindədir: bəzi qoşmalar onunla işləməyə bilər. Yenidən yüklədikdən sonra tətbiq olunur.", + "canvas backend": "Canvas qrafik interfeysi", + "canvas backend auto": "Avtomatik (WebGL2)", + "settings-info-canvas-backend": "Canvas ilə kodun göstərilməsi üçün istifadə olunan GPU interfeysi. WebGPU əlçatan olmadıqda WebGL2 istifadə olunur. Yenidən yüklədikdən sonra tətbiq olunur.", + "sticky scroll": "Sabit başlıq sətirləri", + "settings-info-sticky-scroll": "Sürüşdürərkən yuxarıda görünən sətri əhatə edən funksiyaların, siniflərin və blokların ilk sətirlərini yuxarıda bərkit.", + "sticky scroll max lines": "Sabit başlıq sətirlərinin sayı", + "settings-info-sticky-scroll-max-lines": "Yuxarıda bərkidilən başlıq sətirlərinin ən çox sayını təyin et (1–10).", + "gutter markers": "Kənar zolaq nişanları", + "gutter markers shared": "Bir ortaq sütun", + "gutter markers columns": "Hər zolaq üçün ayrı sütun", + "gutter markers overlay": "Sətir nömrələrinin üzərində", + "settings-info-gutter-markers": "Kod yoxlaması və digər kənar zolaq nişanlarının harada görünəcəyini seç: bir ortaq sütunda, hər zolaq üçün ayrı sütunda və ya enə qənaət etmək üçün sətir nömrələrinin üzərində.", + "cursor blink rate": "Kursorun yanıb-sönmə müddəti", + "settings-info-cursor-blink-rate": "Kursorun bir dəfə yanıb-sönməsi üçün lazım olan müddət, millisaniyə ilə. 0 dəyəri kursoru sabit saxlayır.", + "settings-info-scroll-speed": "Sürətli sürüşdürmə jestinin və ya siçan çarxının bir dövrəsinin redaktoru nə qədər sürüşdürdüyünü təyin et.", + "clear all": "Hamısını təmizlə", + "error-permission-revoked": "Acode artıq bu məkana daxil ola bilmir. Giriş icazəsi vermək üçün qovluğu yenidən aç.", + "error-not-found": "Bu fayl və ya qovluq artıq mövcud deyil. Yeri dəyişdirilmiş, adı dəyişdirilmiş və ya silinmiş ola bilər.", + "error-no-space": "Bu cihazda kifayət qədər boş yaddaş sahəsi qalmayıb.", + "error-network": "Serverlə əlaqə qurmaq mümkün olmadı. Əlaqəni yoxla və yenidən cəhd et.", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" From 33314a378897b8691ebe8c7b5f4c04e7f0f449eb Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:19:57 +0000 Subject: [PATCH 03/27] fix(styles): guard color-mix() with @supports for old WebViews (#3025) (cherry picked from commit 84995d75692aedda68750cdf82998d845c1fe1e3) --- postcss.config.js | 11 +++-- utils/postcss/colorMixSupports.js | 81 +++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 utils/postcss/colorMixSupports.js diff --git a/postcss.config.js b/postcss.config.js index c7db4e5..b0df55d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,5 +1,6 @@ -module.exports = { - plugins: [ - require('autoprefixer')({}) - ] -}; \ No newline at end of file +module.exports = { + plugins: [ + require('./utils/postcss/colorMixSupports'), + require('autoprefixer')({}) + ] +}; diff --git a/utils/postcss/colorMixSupports.js b/utils/postcss/colorMixSupports.js new file mode 100644 index 0000000..60ac221 --- /dev/null +++ b/utils/postcss/colorMixSupports.js @@ -0,0 +1,81 @@ +/** + * Moves every declaration that uses `color-mix()` into an + * `@supports (color: color-mix(...))` block placed right after its rule. + * + * Why: a declaration containing `var()` is always accepted at parse time, so + * on WebViews without `color-mix()` it becomes "invalid at computed-value + * time" and resets to `unset` (usually transparent) instead of falling back to + * the plain declaration written before it. Guarding it with `@supports` lets + * old WebViews keep the fallback while newer ones still get the mixed color. + */ +const SUPPORTS = "(color: color-mix(in srgb, red 50%, transparent))"; +const HAS_COLOR_MIX = /color-mix\(/i; + +const isColorMix = (node) => + node.type === "decl" && + !node.prop.startsWith("--") && + HAS_COLOR_MIX.test(node.value); + +const isKeyframes = (node) => + node?.type === "atrule" && /keyframes$/i.test(node.name); + +const isInsideSupportsGuard = (node) => { + for (let p = node.parent; p; p = p.parent) { + if (p.type === "atrule" && p.name === "supports" && p.params === SUPPORTS) + return true; + } + return false; +}; + +/** @type {import('postcss').PluginCreator} */ +module.exports = () => ({ + postcssPlugin: "color-mix-supports", + OnceExit(root, { AtRule }) { + const keyframes = new Set(); + const rules = []; + + root.walkRules((rule) => { + if (isInsideSupportsGuard(rule)) return; + if (!rule.nodes?.some(isColorMix)) return; + if (isKeyframes(rule.parent)) keyframes.add(rule.parent); + else rules.push(rule); + }); + + for (const rule of rules) { + const guarded = rule.clone({ nodes: [] }); + const decls = rule.nodes.filter(isColorMix); + for (const decl of decls) { + // A later declaration of the same property must keep winning. + if (hasLaterProp(decl, decl.prop)) continue; + guarded.append(decl.clone()); + decl.remove(); + } + if (!guarded.nodes.length) continue; + const supports = new AtRule({ name: "supports", params: SUPPORTS }); + supports.append(guarded); + rule.after(supports); + if (!rule.nodes.length) rule.remove(); + } + + // @supports can't go inside @keyframes, so the whole block is duplicated: + // the original keeps the fallbacks, the guarded copy (later, so it wins) + // keeps everything. + for (const atRule of keyframes) { + const supports = new AtRule({ name: "supports", params: SUPPORTS }); + supports.append(atRule.clone()); + atRule.walkDecls((decl) => { + if (isColorMix(decl)) decl.remove(); + }); + atRule.after(supports); + } + }, +}); + +function hasLaterProp(decl, prop) { + for (let n = decl.next(); n; n = n.next()) { + if (n.type === "decl" && n.prop === prop) return true; + } + return false; +} + +module.exports.postcss = true; From 7cd14b6f59c41f202149a780be9e45c918472aa2 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:52:35 +0530 Subject: [PATCH 04/27] chore(deps): bump @acode.app/canvas-view to 0.0.5 (cherry picked from commit 59fadfc72c6023e7707f7e32660b02b804ac24cc) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3e2d68..306b383 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.13.6", "license": "MIT", "dependencies": { - "@acode.app/canvas-view": "^0.0.4", + "@acode.app/canvas-view": "^0.0.5", "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/lang-angular": "^0.1.4", @@ -161,9 +161,9 @@ } }, "node_modules/@acode.app/canvas-view": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@acode.app/canvas-view/-/canvas-view-0.0.4.tgz", - "integrity": "sha512-o88sexJ31AywiloTxu1RRqD1JLcfO7zcfKEHoDwUOSdsmHd9bptO7K6j8dov7XK6PdVaXk3IGwa1s0egRtz1yQ==", + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@acode.app/canvas-view/-/canvas-view-0.0.5.tgz", + "integrity": "sha512-cvrwvSH65clHN2XZpBQxy1NXYHhNf3u/sQTIwPR8SnFYzcmwYdh4vxZVQ3wqIxZr3u5yRWns4t9bs2T77aQDbw==", "license": "MIT", "dependencies": { "@codemirror/language": "^6.13.1", diff --git a/package.json b/package.json index 22b2072..6ef9c97 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "ws": "^8.21.3" }, "dependencies": { - "@acode.app/canvas-view": "^0.0.4", + "@acode.app/canvas-view": "^0.0.5", "@codemirror/autocomplete": "^6.20.3", "@codemirror/commands": "^6.11.0", "@codemirror/lang-angular": "^0.1.4", From 71235fead34e4014748b1b0c4aff8e2af2d277ab Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:55:13 +0000 Subject: [PATCH 05/27] fix(search): expand regex capture groups in native replace (#3033) * fix(search): expand regex capture groups in native replace Replacements on file:// and SAF files escaped the replacement string, so $1, $& and $ were inserted literally. In regex mode, apply JS String.replace substitution rules so both search paths behave the same. Fixes #3026 * fix(search): ignore character classes when detecting named groups (cherry picked from commit 4e21bbe2e754e8f5991a15730776dfc37d69a5d1) --- .../foxdebug/acode/sdcard/WorkspaceIndex.java | 136 +++++++++++++++++- 1 file changed, 134 insertions(+), 2 deletions(-) diff --git a/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/WorkspaceIndex.java b/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/WorkspaceIndex.java index fca431d..eb23a64 100644 --- a/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/WorkspaceIndex.java +++ b/platforms/android/app/src/main/java/com/foxdebug/acode/sdcard/WorkspaceIndex.java @@ -1009,8 +1009,11 @@ private void runSearch(Job job, JSONObject options, Callback callback) } if ("replace".equals(mode)) { - String replacement = Matcher.quoteReplacement(replace == null ? "" : replace); - String text = pattern.matcher(new SearchInput(content, job)).replaceAll(replacement); + String replacement = replace == null ? "" : replace; + Matcher matcher = pattern.matcher(new SearchInput(content, job)); + String text = searchOptions.optBoolean("regExp", false) + ? replaceAllJs(matcher, content, replacement) + : matcher.replaceAll(Matcher.quoteReplacement(replacement)); JSONObject result = baseEvent(job.id, "replace-result"); result.put("file", file); result.put("text", text); @@ -1026,6 +1029,135 @@ private void runSearch(Job job, JSONObject options, Callback callback) send(callback, baseEvent(job.id, "replace".equals(mode) ? "done-replacing" : "done-searching"), false); } + /** + * Replaces every match using JavaScript String.prototype.replace substitution + * rules ($$, $&, $`, $', $1..$99, $), so regex replacements behave the + * same as the JS worker path. + */ + static String replaceAllJs(Matcher matcher, String content, String replace) { + StringBuilder out = new StringBuilder(content.length()); + boolean namedGroups = hasNamedGroups(matcher.pattern().pattern()); + int last = 0; + while (matcher.find()) { + out.append(content, last, matcher.start()); + appendJsSubstitution(out, matcher, content, replace, namedGroups); + last = matcher.end(); + } + out.append(content, last, content.length()); + return out.toString(); + } + + /** + * Whether the pattern declares a named capture group, ignoring escaped text, + * \Q...\E quotes and character classes. + */ + static boolean hasNamedGroups(String pattern) { + int len = pattern.length(); + int classDepth = 0; + for (int i = 0; i < len; i++) { + char c = pattern.charAt(i); + if (c == '\\') { + if (i + 1 < len && pattern.charAt(i + 1) == 'Q') { + int end = pattern.indexOf("\\E", i + 2); + if (end == -1) return false; + i = end + 1; + } else { + i++; + } + } else if (classDepth > 0) { + if (c == '[') classDepth++; + else if (c == ']') classDepth--; + } else if (c == '[') { + classDepth = 1; + if (i + 1 < len && pattern.charAt(i + 1) == '^') i++; + if (i + 1 < len && pattern.charAt(i + 1) == ']') i++; + } else if ( + c == '(' && + i + 3 < len && + pattern.charAt(i + 1) == '?' && + pattern.charAt(i + 2) == '<' && + Character.isLetter(pattern.charAt(i + 3)) + ) { + return true; + } + } + return false; + } + + private static void appendJsSubstitution( + StringBuilder out, + Matcher matcher, + String content, + String replace, + boolean namedGroups + ) { + int groups = matcher.groupCount(); + int len = replace.length(); + for (int i = 0; i < len; i++) { + char c = replace.charAt(i); + if (c != '$' || i + 1 >= len) { + out.append(c); + continue; + } + + char next = replace.charAt(i + 1); + if (next == '$') { + out.append('$'); + i++; + } else if (next == '&') { + out.append(content, matcher.start(), matcher.end()); + i++; + } else if (next == '`') { + out.append(content, 0, matcher.start()); + i++; + } else if (next == '\'') { + out.append(content, matcher.end(), content.length()); + i++; + } else if (next >= '0' && next <= '9') { + int index = next - '0'; + int consumed = 1; + if (i + 2 < len) { + char digit = replace.charAt(i + 2); + if (digit >= '0' && digit <= '9') { + int twoDigit = index * 10 + (digit - '0'); + if (twoDigit >= 1 && twoDigit <= groups) { + index = twoDigit; + consumed = 2; + } + } + } + if (index >= 1 && index <= groups) { + String group = matcher.group(index); + if (group != null) out.append(group); + i += consumed; + } else { + out.append(c); + } + } else if (next == '<') { + int close = replace.indexOf('>', i + 2); + boolean found = false; + String group = null; + if (close != -1) { + try { + group = matcher.group(replace.substring(i + 2, close)); + found = true; + } catch (IllegalArgumentException ignored) { + // JS: an unknown name is empty when the pattern has named groups. + found = namedGroups; + } + } + if (found) { + if (group != null) out.append(group); + i = close; + } else { + out.append(c); + } + } else { + out.append(c); + } + } + } + private Pattern compileSearchPattern(String search, JSONObject options) throws PatternSyntaxException { boolean regExp = options.optBoolean("regExp", false); From 20abca4c9bbdcab8ac75fbadb33a331631c4fda9 Mon Sep 17 00:00:00 2001 From: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:28:54 +0000 Subject: [PATCH 06/27] perf(tabs): speed up closing and saving many tabs (#3035) * perf(tabs): speed up closing and saving many tabs - Close background tabs before active ones so no tab is activated only to be closed, and sync the tab list and session state once per batch. - Save all: save files with a location four at a time with a progress dialog, then retry the rest one by one with the usual prompts; files that fail stay open instead of aborting the whole operation. - Check the file mtime before reading it back for conflict detection. - Keep a save timer per file so concurrent saves all finish, and coalesce the session update. - Only run format-on-save when the saved file is the active one. Fixes #3030, fixes #3031, fixes #3032 * test(save): cover batched save-all and keep reporting save errors * fix(save): keep remote saves sequential and restore content conflict check - Only save local (file:) and SAF (content:) files in parallel; remote providers such as SFTP share a connection and now save one by one. - Restore the content comparison before overwriting so an external edit that keeps the mtime still triggers the conflict prompt. - Show how many files were saved, or could not be saved, once save all finishes. (cherry picked from commit 27454184a150d716bbe3e3057b344ca2d7cfd776) --- src/lang/ar-ye.json | 2 + src/lang/az-az.json | 2 + src/lang/be-by.json | 2 + src/lang/bn-bd.json | 2 + src/lang/cs-cz.json | 2 + src/lang/de-de.json | 2 + src/lang/en-us.json | 4 +- src/lang/es-sv.json | 2 + src/lang/fr-fr.json | 2 + src/lang/he-il.json | 2 + src/lang/hi-in.json | 2 + src/lang/hu-hu.json | 2 + src/lang/id-id.json | 2 + src/lang/index.d.ts | 2 + src/lang/ir-fa.json | 2 + src/lang/it-it.json | 2 + src/lang/ja-jp.json | 2 + src/lang/ko-kr.json | 2 + src/lang/ln-ln.json | 2 + src/lang/ml-in.json | 2 + src/lang/mm-unicode.json | 2 + src/lang/mm-zawgyi.json | 2 + src/lang/pl-pl.json | 2 + src/lang/pt-br.json | 2 + src/lang/pu-in.json | 2 + src/lang/ru-ru.json | 2 + src/lang/tl-ph.json | 2 + src/lang/tr-tr.json | 2 + src/lang/uk-ua.json | 2 + src/lang/uz-uz.json | 2 + src/lang/vi-vn.json | 2 + src/lang/zh-cn.json | 2 + src/lang/zh-hant.json | 2 + src/lang/zh-tw.json | 2 + src/lib/commands.js | 146 ++++++++++++++++++++++++++------ src/lib/editorManager.js | 26 +++++- src/lib/saveFile.js | 34 +++++--- src/lib/saveState.js | 32 ++++++- tests/unit/saveCommands.test.js | 110 ++++++++++++++++++++---- 39 files changed, 361 insertions(+), 57 deletions(-) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index bf8f2ac..5ea8e7e 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/az-az.json b/src/lang/az-az.json index 74e9c71..23e6491 100644 --- a/src/lang/az-az.json +++ b/src/lang/az-az.json @@ -914,6 +914,8 @@ "error-not-found": "Bu fayl və ya qovluq artıq mövcud deyil. Yeri dəyişdirilmiş, adı dəyişdirilmiş və ya silinmiş ola bilər.", "error-no-space": "Bu cihazda kifayət qədər boş yaddaş sahəsi qalmayıb.", "error-network": "Serverlə əlaqə qurmaq mümkün olmadı. Əlaqəni yoxla və yenidən cəhd et.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 11c19f4..0228073 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index 9af4cf9..ee24b5d 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index 5f737f4..0d288a7 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/de-de.json b/src/lang/de-de.json index c6650d0..0157e62 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 5d6ef39..e3e0fe9 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -916,5 +916,7 @@ "error-permission-revoked": "Acode can no longer access this location. Open the folder again to grant access.", "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", - "error-network": "Couldn't reach the server. Check your connection and try again." + "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}" } diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index b9f709d..fa253c3 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index 316c866..3742b3d 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/he-il.json b/src/lang/he-il.json index e043a94..a829a8f 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 105d36a..0ae2edd 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index bef09f2..882dad3 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/id-id.json b/src/lang/id-id.json index 8dea45a..b1db4c6 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/index.d.ts b/src/lang/index.d.ts index 5a41da0..fba1b08 100644 --- a/src/lang/index.d.ts +++ b/src/lang/index.d.ts @@ -920,6 +920,8 @@ declare type LangStrings = { "error-not-found": string; "error-no-space": string; "error-network": string; + "files saved count": string; + "files not saved count": string; }; declare var strings: LangStrings; diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index ed089a7..b7ff5c1 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/it-it.json b/src/lang/it-it.json index 5ea821d..326f2d3 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index 12b7ea5..2da7e8c 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index b9e3d36..68e518f 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/ln-ln.json b/src/lang/ln-ln.json index f344ba0..7c53d58 100644 --- a/src/lang/ln-ln.json +++ b/src/lang/ln-ln.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index 6e12d8b..5144661 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index fa13060..7a1100f 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index 9313949..7d3f0e7 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index f364139..599437d 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index 2e6ef31..30edeb0 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index de1f679..272e5fc 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index 4d38706..8b2adeb 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index e372890..09a89b7 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 0562d00..509ca5f 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index 5a49d94..7a37503 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 2cdd2d3..0855eb7 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 0894968..5b5f7ff 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index a85376e..c44a352 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -914,6 +914,8 @@ "error-not-found": "此文件或文件夹已不存在,可能已被移动、重命名或删除。", "error-no-space": "此设备的剩余存储空间不足。", "error-network": "无法连接到服务器。请检查网络连接后重试。", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index c6c80b3..1eaf035 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -914,6 +914,8 @@ "error-not-found": "此檔案或資料夾已不存在,可能已被移動、重新命名或刪除。", "error-no-space": "此裝置的剩餘儲存空間不足。", "error-network": "無法連線至伺服器。請檢查網路連線後重試。", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 15179b8..1249fbf 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -914,6 +914,8 @@ "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", "error-no-space": "There isn't enough storage space left on this device.", "error-network": "Couldn't reach the server. Check your connection and try again.", + "files saved count": "Files saved: {count}", + "files not saved count": "Files not saved: {count}", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" diff --git a/src/lib/commands.js b/src/lib/commands.js index 55a3997..ec5df90 100644 --- a/src/lib/commands.js +++ b/src/lib/commands.js @@ -4,6 +4,7 @@ import { focusEditorIfEditable } from "cm/editorReadOnly"; import Sidebar from "components/sidebar"; import { loadTerminalManager } from "components/terminal/loader"; import confirm from "dialogs/confirm"; +import loader from "dialogs/loader"; import prompt from "dialogs/prompt"; import select from "dialogs/select"; import actions from "handlers/quickTools"; @@ -13,13 +14,13 @@ import helpers from "utils/helpers"; import Url from "utils/Url"; import checkFiles from "./checkFiles"; import config from "./config"; -import EditorFile from "./editorFile"; +import EditorFile, { AUTO_SAVE } from "./editorFile"; import { loadFileBrowser } from "./lazyImports"; import openFile from "./openFile"; import openFolder from "./openFolder"; import platform from "./platform"; import runLazily from "./runLazily"; -import saveState from "./saveState"; +import saveState, { deferSaveState } from "./saveState"; import appSettings from "./settings"; import showFileInfo from "./showFileInfo"; @@ -141,22 +142,125 @@ async function closeTabs(files, options = {}) { } } - let complete = true; - for (const file of [...closableFiles]) { - if (save && file.isUnsaved) { - if (!canSaveFile(file)) { - complete = false; - continue; - } - const saved = await file.save(); - if (saved === false || file.hasUnsavedChanges?.() || file.isUnsaved) - return false; + // Files that could not be saved stay open so no changes are lost. + const failed = save ? await saveFiles(closableFiles) : new Set(); + await removeFiles(closableFiles.filter((file) => !failed.has(file))); + return !failed.size; +} + +const SAVE_CONCURRENCY = 4; + +/** + * Local and SAF files are independent, so they can be written in parallel. + * Remote providers (e.g. SFTP) share a connection and must save one by one. + * @param {string} uri + */ +function canSaveInParallel(uri) { + return /^(file|content):/.test(uri); +} + +/** + * Saves every unsaved file in `files`, showing progress while doing so. + * Files with a location are first saved without prompting (local files a few + * at a time, remote files one by one); anything that needs input (new files, + * conflicts, errors) is then saved one at a time with the usual dialogs. + * @param {EditorFile[]} files + * @returns {Promise>} Files that are still unsaved. + */ +async function saveFiles(files) { + const failed = new Set(); + const pending = files.filter((file) => file.isUnsaved); + const parallel = []; + const serial = []; + const interactive = []; + for (const file of pending) { + if (!canSaveFile(file)) failed.add(file); + else if (!file.uri) interactive.push(file); + else if (canSaveInParallel(file.uri)) parallel.push(file); + else serial.push(file); + } + + const total = parallel.length + serial.length; + let done = 0; + const progress = + total > 1 ? loader.create(strings.saving, `0 / ${total}`) : null; + const drain = async (queue) => { + while (queue.length) { + const file = queue.shift(); + if (!(await trySave(file, AUTO_SAVE))) interactive.push(file); + progress?.setMessage(`${++done} / ${total}`); } + }; + try { + await Promise.all( + Array.from({ length: Math.min(SAVE_CONCURRENCY, parallel.length) }, () => + drain(parallel), + ), + ); + await drain(serial); + } finally { + progress?.destroy(); + } - await file.remove(true, { silentPinned: true }); + for (const file of interactive) { + if (!(await trySave(file))) failed.add(file); } - return complete; + if (pending.length > 1) { + const message = failed.size + ? strings["files not saved count"] || "Files not saved: {count}" + : strings["files saved count"] || "Files saved: {count}"; + toast( + message.replace( + "{count}", + String(failed.size || pending.length - failed.size), + ), + ); + } + return failed; +} + +/** + * @param {EditorFile} file + * @param {symbol} [origin] + * @returns {Promise} Whether the file has no unsaved changes left. + */ +async function trySave(file, origin) { + try { + const saved = await file.save(origin); + return saved !== false && !file.hasUnsavedChanges?.() && !file.isUnsaved; + } catch (error) { + helpers.error(error); + return false; + } +} + +/** + * Closes `files` without prompting. Background tabs are closed before the + * active ones so no tab gets activated (and rendered) only to be closed, and + * the tab list and session are updated once at the end instead of per tab. + * @param {EditorFile[]} files + */ +async function removeFiles(files) { + const { activeFile } = editorManager; + const isPaneActive = (file) => + editorManager.getFilePane?.(file)?.activeFile === file; + const rank = (file) => { + if (file === activeFile) return 2; + return isPaneActive(file) ? 1 : 0; + }; + const ordered = [...files].sort((a, b) => rank(a) - rank(b)); + + const removeAll = async () => { + for (const file of ordered) { + await file.remove(true, { silentPinned: true }); + } + }; + await deferSaveState(() => + editorManager.batchFileRemoval + ? editorManager.batchFileRemoval(removeAll) + : removeAll(), + ); } const commands = { @@ -216,18 +320,8 @@ const commands = { strings["save all changes warning"], ); if (!doSave) return; - let complete = true; - for (const file of [...editorManager.files]) { - if (!file.isUnsaved) continue; - if (!canSaveFile(file)) { - complete = false; - continue; - } - const saved = await file.save(); - if (saved === false || file.hasUnsavedChanges?.() || file.isUnsaved) - return false; - } - return complete; + const failed = await saveFiles([...editorManager.files]); + return !failed.size; }, "close-current-tab"() { editorManager.activeFile?.remove(); diff --git a/src/lib/editorManager.js b/src/lib/editorManager.js index d9f63db..2091234 100644 --- a/src/lib/editorManager.js +++ b/src/lib/editorManager.js @@ -141,6 +141,8 @@ async function EditorManager($header, $body) { let timeoutQuicktoolsToggler; let timeoutHeaderToggler; let isScrolling = false; + let fileRemovalBatchDepth = 0; + let fileListSyncPending = false; let lastScrollTop = 0; let lastScrollLeft = 0; let suppressCursorRevealUntil = 0; @@ -3394,6 +3396,7 @@ async function EditorManager($header, $body) { moveActiveFileToNewPane, moveFileToPane, removeFileFromPane, + batchFileRemoval, moveFileByPinnedState, normalizePinnedTabOrder, updatePaneFileOrderFromTabs, @@ -4441,10 +4444,31 @@ async function EditorManager($header, $body) { } } rebuildFileListFromPanes(); - syncOpenFileList(); + if (fileRemovalBatchDepth) fileListSyncPending = true; + else syncOpenFileList(); return { pane, wasPaneActive, nextFile }; } + /** + * Runs `task` (which removes files) while deferring the open file list + * sync to a single pass at the end, instead of one full sync per file. + * @template T + * @param {() => Promise|T} task + * @returns {Promise} + */ + async function batchFileRemoval(task) { + fileRemovalBatchDepth++; + try { + return await task(); + } finally { + fileRemovalBatchDepth--; + if (!fileRemovalBatchDepth && fileListSyncPending) { + fileListSyncPending = false; + syncOpenFileList(); + } + } + } + function updatePaneFileOrderFromTabs($tabList, options = {}) { const pane = $tabList?.__editorPane; if (!pane) return false; diff --git a/src/lib/saveFile.js b/src/lib/saveFile.js index 0f43fea..5ff14b8 100644 --- a/src/lib/saveFile.js +++ b/src/lib/saveFile.js @@ -14,7 +14,9 @@ import EditorFile from "./editorFile"; import openFolder from "./openFolder"; import appSettings from "./settings"; -let saveTimeout; +/** @type {WeakMap} */ +const saveTimeouts = new WeakMap(); +let updateTimeout; const SELECT_FOLDER = "select-folder"; @@ -171,12 +173,14 @@ async function saveFile( } } - if (appSettings.value.formatOnSave) { - editorManager.activeFile.markChanged = false; + // The format command works on the active editor, so only format when the + // file being saved is the one shown (bulk saves cover background tabs). + if (appSettings.value.formatOnSave && editorManager.activeFile === file) { + file.markChanged = false; try { acode.exec("format", false); } finally { - editorManager.activeFile.markChanged = true; + file.markChanged = true; } } @@ -200,15 +204,23 @@ async function saveFile( recents.addFolder(file.location); } - clearTimeout(saveTimeout); - saveTimeout = setTimeout(() => { - if (!isCurrent()) return; - file.isSaving = false; - if (newUrl) recents.addFile(file.uri); + clearTimeout(saveTimeouts.get(file)); + saveTimeouts.set( + file, + setTimeout(() => { + saveTimeouts.delete(file); + if (!isCurrent()) return; + file.isSaving = false; + if (newUrl) recents.addFile(file.uri); + editorManager.emit("save-file", file); + resetText(); + }, editorManager.TIMEOUT_VALUE + 100), + ); + // Coalesce the session update so saving many files persists state once. + clearTimeout(updateTimeout); + updateTimeout = setTimeout(() => { editorManager.onupdate("save-file"); editorManager.emit("update", "save-file"); - editorManager.emit("save-file", file); - resetText(); }, editorManager.TIMEOUT_VALUE + 100); return true; } catch (err) { diff --git a/src/lib/saveState.js b/src/lib/saveState.js index 5d31b37..7437dc2 100644 --- a/src/lib/saveState.js +++ b/src/lib/saveState.js @@ -3,8 +3,36 @@ import config from "./config"; import { addedFolder } from "./openFolder"; import appSettings from "./settings"; -export default () => { +let deferDepth = 0; +let deferredSave = false; + +/** + * Runs `task` while coalescing every session save it triggers into a single + * save once it finishes, so bulk tab operations don't re-serialize all open + * files per tab. + * @template T + * @param {() => Promise|T} task + * @returns {Promise} + */ +export async function deferSaveState(task) { + deferDepth++; + try { + return await task(); + } finally { + deferDepth--; + if (!deferDepth && deferredSave) { + deferredSave = false; + saveState(); + } + } +} + +export default function saveState() { if (!window.editorManager) return; + if (deferDepth) { + deferredSave = true; + return; + } const filesToSave = []; const folders = []; @@ -103,7 +131,7 @@ export default () => { localStorage.files = JSON.stringify(filesToSave); localStorage.folders = JSON.stringify(folders); -}; +} function collapseSelectionForRestore(selection) { if (!selection?.ranges?.length) return selection; diff --git a/tests/unit/saveCommands.test.js b/tests/unit/saveCommands.test.js index 10e0620..5160e38 100644 --- a/tests/unit/saveCommands.test.js +++ b/tests/unit/saveCommands.test.js @@ -10,6 +10,7 @@ function setup(files, capabilities = platform) { }; const toast = vi.fn(), error = vi.fn(); + const progress = { setMessage: vi.fn(), destroy: vi.fn() }; const dependencies = Object.fromEntries( [ "fileSystem", @@ -29,7 +30,6 @@ function setup(files, capabilities = platform) { "./openFile", "./openFolder", "./runLazily", - "./saveState", "./settings", "./showFileInfo", ].map((id) => [id, {}]), @@ -41,11 +41,13 @@ function setup(files, capabilities = platform) { ...dependencies, "dialogs/confirm": async () => true, "dialogs/select": async () => "save", + "dialogs/loader": { create: () => progress }, + "./saveState": { deferSaveState: (task) => task() }, "utils/helpers": { error }, }, { editorManager: manager, strings: {}, toast }, ); - return { ...module, manager, toast, error }; + return { ...module, manager, toast, error, progress }; } function tab(id, type = "docs") { const file = { @@ -108,7 +110,7 @@ it("does not save pending editors or report a cancelled editor save as successfu await f.default["save-as"](true); expect(f.toast).not.toHaveBeenCalled(); }); -it("saves sequentially without clearing flags and stops at cancellation or newer edits", async () => { +it("saves sequentially without clearing flags and keeps going past cancellation or newer edits", async () => { const one = tab("one"), two = tab("two"), code = tab("code", "editor"); @@ -131,12 +133,47 @@ it("saves sequentially without clearing flags and stops at cancellation or newer release(); expect(await saving).toBe(false); expect(two.isUnsaved).toBe(true); - expect(code.save).not.toHaveBeenCalled(); + expect(code.save).toHaveBeenCalledOnce(); + expect(code.isUnsaved).toBe(false); two.save.mockResolvedValueOnce(true); // A newer edit remains dirty after the write. expect(await f.default["save-all-changes"]()).toBe(false); - expect(code.save).not.toHaveBeenCalled(); + expect(two.isUnsaved).toBe(true); expect(await f.default["save-all-changes"]()).toBe(true); - expect(code.isUnsaved).toBe(false); + expect(two.isUnsaved).toBe(false); +}); + +it("saves files with a location concurrently behind a progress dialog", async () => { + const files = ["a", "b", "c", "d", "e", "f"].map((id) => { + const file = tab(id, "editor"); + file.uri = `file:///${id}`; + return file; + }); + const releases = []; + for (const file of files) { + file.save.mockImplementationOnce( + () => + new Promise((resolve) => { + releases.push(() => { + file.isUnsaved = false; + resolve(true); + }); + }), + ); + } + const f = setup(files); + const saving = f.default["save-all-changes"](); + await vi.waitFor(() => expect(releases).toHaveLength(4)); + expect(files[4].save).not.toHaveBeenCalled(); + while (releases.length) { + releases.shift()(); + await Promise.resolve(); + await Promise.resolve(); + } + await vi.waitFor(() => expect(files[5].save).toHaveBeenCalled()); + while (releases.length) releases.shift()(); + expect(await saving).toBe(true); + expect(f.progress.setMessage).toHaveBeenCalledTimes(files.length); + expect(f.progress.destroy).toHaveBeenCalledOnce(); }); it.each([ false, @@ -148,9 +185,8 @@ it.each([ if (outcome === "failure") file.save.mockRejectedValueOnce(Error("disk full")); else file.save.mockResolvedValueOnce(outcome); - const result = f.default["close-all-tabs"](); - if (outcome === "failure") await expect(result).rejects.toThrow("disk full"); - else await result; + expect(await f.default["close-all-tabs"]()).toBe(false); + expect(f.error).toHaveBeenCalledTimes(outcome === "failure" ? 1 : 0); expect(file.remove).not.toHaveBeenCalled(); expect(file.isUnsaved).toBe(true); }); @@ -184,7 +220,7 @@ it.each([ false, true, "failure", -])("still stops after a savable write fails or remains dirty (%s)", async (outcome) => { +])("keeps a failed file open and still saves the rest (%s)", async (outcome) => { for (const command of ["save-all-changes", "close-all-tabs"]) { const unsupported = tab("unsupported", "terminal"), failed = tab("failed"), @@ -193,13 +229,15 @@ it.each([ if (outcome === "failure") failed.save.mockRejectedValueOnce(Error("disk full")); else failed.save.mockResolvedValueOnce(outcome); - const saving = f.default[command](); - if (outcome === "failure") - await expect(saving).rejects.toThrow("disk full"); - else expect(await saving).toBe(false); + expect(await f.default[command]()).toBe(false); + expect(f.error).toHaveBeenCalledTimes(outcome === "failure" ? 1 : 0); expect(failed.remove).not.toHaveBeenCalled(); - expect(later.save).not.toHaveBeenCalled(); - expect(later.remove).not.toHaveBeenCalled(); + expect(failed.isUnsaved).toBe(true); + expect(later.save).toHaveBeenCalledOnce(); + expect(later.isUnsaved).toBe(false); + expect(later.remove).toHaveBeenCalledTimes( + command === "close-all-tabs" ? 1 : 0, + ); } }); @@ -214,6 +252,46 @@ it("keeps pinned tabs untouched by save-and-close and reports complete success f expect(file.remove).toHaveBeenCalledOnce(); }); +it("saves remote files one at a time after local files and reports the result", async () => { + const local = ["a", "b"].map((id) => { + const file = tab(id, "editor"); + file.uri = `file:///${id}`; + return file; + }); + const remote = ["c", "d"].map((id) => { + const file = tab(id, "editor"); + file.uri = `sftp://host/${id}`; + return file; + }); + let active = 0; + let maxRemoteActive = 0; + for (const file of remote) { + file.save.mockImplementationOnce(async () => { + active++; + maxRemoteActive = Math.max(maxRemoteActive, active); + await new Promise((resolve) => setTimeout(resolve, 5)); + active--; + file.isUnsaved = false; + return true; + }); + } + const f = setup([...local, ...remote]); + expect(await f.default["save-all-changes"]()).toBe(true); + expect(maxRemoteActive).toBe(1); + for (const file of local) { + expect(file.save.mock.invocationCallOrder[0]).toBeLessThan( + remote[0].save.mock.invocationCallOrder[0], + ); + } + expect(f.toast).toHaveBeenCalledWith("Files saved: 4"); + + remote[0].isUnsaved = true; + remote[0].save.mockResolvedValue(false); + local[0].isUnsaved = true; + expect(await f.default["save-all-changes"]()).toBe(false); + expect(f.toast).toHaveBeenLastCalledWith("Files not saved: 1"); +}); + it.each([ false, true, From 2591646d93e57837aa56bdfd3ea3b49dda69f354 Mon Sep 17 00:00:00 2001 From: summoner Date: Thu, 12 Nov 2026 16:45:33 +0000 Subject: [PATCH 07/27] Translation: Update hu-hu.json (#3046) Translte new strings fix translation (cherry picked from commit 40209f438c236b6d46f8810069335f44948dcb9e) --- src/lang/hu-hu.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index 882dad3..7c54866 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -9,7 +9,7 @@ "cancel": "Mégse", "change language": "Nyelv módosítása", "choose color": "Válasszon színt", - "clear": "Tisztítás", + "clear": "Törlés", "close app": "Biztosan bezárja az alkalmazást?", "commit message": "Véglegesítési üzenet", "console": "Konzol", @@ -898,9 +898,9 @@ "canvas backend auto": "Automatikus (WebGL2)", "settings-info-canvas-backend": "A GPU API, amellyel a Canvas megjelenítő rajzol. A WebGPU ott, ahol nem érhető el, WebGL2-re vált vissza. Újratöltés után lép érvénybe.", "sticky scroll": "Rögzített görgetés", - "settings-info-sticky-scroll": "Görgetés közben a felső sor körüli függvények, osztályok és blokkok első sorait a képernyő tetejére rögzíti.", + "settings-info-sticky-scroll": "Görgetés közben a felső sor körüli függvények, osztályok és blokkok első sorait a képernyő tetejére lesznek rögzítve.", "sticky scroll max lines": "Rögzített görgetés sorai", - "settings-info-sticky-scroll-max-lines": "A rögzített görgetés által a tetején tartott fejlécsorok maximális száma (1–10).", + "settings-info-sticky-scroll-max-lines": "A rögzített görgetés által a képernyő tetejére rögzített fejlécsorok maximális száma (1–10).", "gutter markers": "Margójelölők", "gutter markers shared": "Egy közös oszlop", "gutter markers columns": "Külön oszlop margónként", @@ -909,13 +909,13 @@ "cursor blink rate": "Kurzor villogási sebessége", "settings-info-cursor-blink-rate": "Egy kurzorvillanás időtartama ezredmásodpercben. A 0 értéknél a kurzor nem villog.", "settings-info-scroll-speed": "A görgetés mértéke egy lendítés vagy az egérkerék elfordításakor.", - "clear all": "Clear all", - "error-permission-revoked": "Acode can no longer access this location. Open the folder again to grant access.", - "error-not-found": "This file or folder no longer exists. It may have been moved, renamed or deleted.", - "error-no-space": "There isn't enough storage space left on this device.", - "error-network": "Couldn't reach the server. Check your connection and try again.", - "files saved count": "Files saved: {count}", - "files not saved count": "Files not saved: {count}", + "clear all": "Összes törlése", + "error-permission-revoked": "Az Acode már nem fér hozzá ehhez a helyhez. Nyissa meg újra a mappát a hozzáférés engedélyezéséhez.", + "error-not-found": "Ez a fájl vagy mappa már nem létezik. Lehet, hogy áthelyezték, átnevezték vagy törölték.", + "error-no-space": "Ezen az eszközön nincs elegendő szabad tárhely.", + "error-network": "Nem sikerült kapcsolódni a kiszolgálóhoz. Ellenőrizze az internetkapcsolatát, majd próbálja meg újra.", + "files saved count": "{count} fájl mentve", + "files not saved count": "{count} fájl nem lett mentve", "faqs load failed": "Unable to load FAQs. Please try again.", "faqs empty": "No FAQs are available yet.", "retry": "Retry" From b2e4e5793cfbf0be99fa67c188f63d66819e9b0d Mon Sep 17 00:00:00 2001 From: bardrop Date: Fri, 13 Nov 2026 05:19:30 +0000 Subject: [PATCH 08/27] fix: allow replace all with an empty replacement (#3048) * fix: allow replace all with an empty replacement Search in files returned early from replaceAll() when the replace field was empty, so there was no way to delete every match. Both the worker and the native replace already handle an empty string, so only the search query is required now. Fixes #3044 * fix: keep empty replacement text for files that are not open openFile ignored supplied text when it was an empty string, so a closed file whose whole content was replaced with "" was reloaded from disk. (cherry picked from commit f3b31dcbb0d9b39c5bb6b276380f29c7a5738941) --- src/lib/openFile.js | 4 +- src/sidebarApps/searchInFiles/index.js | 3 +- tests/unit/openFileCancellation.test.js | 8 +++ tests/unit/searchReplaceAll.test.js | 70 +++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 tests/unit/searchReplaceAll.test.js diff --git a/src/lib/openFile.js b/src/lib/openFile.js index d6866fc..a36caab 100644 --- a/src/lib/openFile.js +++ b/src/lib/openFile.js @@ -192,8 +192,8 @@ export default async function openFile(file, options = {}) { } } - if (text) { - // If file is not opened and has unsaved text + if (text != null) { + // If file is not opened and has unsaved text (may be "" after a replace) createEditor(true, text); return; } diff --git a/src/sidebarApps/searchInFiles/index.js b/src/sidebarApps/searchInFiles/index.js index 5729f1e..336fc3e 100644 --- a/src/sidebarApps/searchInFiles/index.js +++ b/src/sidebarApps/searchInFiles/index.js @@ -930,7 +930,8 @@ async function replaceAll() { const search = $search.value; const replace = $replace.value; const options = getOptions(); - if (!search || !replace) return; + // An empty replacement is valid: it deletes every match. + if (!search) return; const regex = toRegex(search, options); if (!regex) return; diff --git a/tests/unit/openFileCancellation.test.js b/tests/unit/openFileCancellation.test.js index e4316d4..d876d31 100644 --- a/tests/unit/openFileCancellation.test.js +++ b/tests/unit/openFileCancellation.test.js @@ -103,6 +103,14 @@ describe("openFile cancellation", () => { expect(recents.addFile).toHaveBeenCalledWith("target"); }); + it("opens supplied empty text as unsaved instead of reading the file", async () => { + await openFile("target", { render: true, text: "" }); + expect(createEditor).toHaveBeenCalledOnce(); + expect(manager.activeFile.text).toBe(""); + expect(manager.activeFile.isUnsaved).toBe(true); + expect(readFile).not.toHaveBeenCalled(); + }); + it.each([ "pdf", "docx", diff --git a/tests/unit/searchReplaceAll.test.js b/tests/unit/searchReplaceAll.test.js new file mode 100644 index 0000000..fdc77e1 --- /dev/null +++ b/tests/unit/searchReplaceAll.test.js @@ -0,0 +1,70 @@ +import { readFileSync } from "node:fs"; +import vm from "node:vm"; +import { describe, expect, it, vi } from "vitest"; + +const source = readFileSync( + `${process.cwd()}/src/sidebarApps/searchInFiles/index.js`, + "utf8", +); + +function createReplaceAll({ search, replace, native = false }) { + const context = vm.createContext({ + $search: { value: search }, + $replace: { value: replace }, + filesSearched: [{ url: "file:///a.js" }, { url: "file:///b.js" }], + filesReplaced: [], + replacing: false, + activeReplaceTasks: 0, + terminateWorker: vi.fn(), + getOptions: () => ({ regExp: false }), + toRegex: (value) => new RegExp(value, "g"), + supportsNativeSearch: () => native, + sendNativeSearch: vi.fn(), + sendMessage: vi.fn(), + }); + vm.runInContext( + source.slice( + source.indexOf("async function replaceAll()"), + source.indexOf("function sendMessage("), + ), + context, + ); + return context; +} + +describe("search in files replace all", () => { + it("replaces matches with an empty string", async () => { + const context = createReplaceAll({ search: "foo", replace: "" }); + await vm.runInContext("replaceAll()", context); + + expect(context.sendMessage).toHaveBeenCalledTimes(1); + const [action, files, , , replace] = context.sendMessage.mock.calls[0]; + expect(action).toBe("replace-files"); + expect(files).toHaveLength(2); + expect(replace).toBe(""); + expect(context.replacing).toBe(true); + }); + + it("sends an empty replacement to the native search", async () => { + const context = createReplaceAll({ + search: "foo", + replace: "", + native: true, + }); + await vm.runInContext("replaceAll()", context); + + expect(context.sendNativeSearch).toHaveBeenCalledTimes(1); + expect(context.sendNativeSearch.mock.calls[0][0]).toBe("replace"); + expect(context.sendNativeSearch.mock.calls[0][4]).toBe(""); + expect(context.sendMessage).not.toHaveBeenCalled(); + }); + + it("does nothing without a search query", async () => { + const context = createReplaceAll({ search: "", replace: "bar" }); + await vm.runInContext("replaceAll()", context); + + expect(context.sendMessage).not.toHaveBeenCalled(); + expect(context.sendNativeSearch).not.toHaveBeenCalled(); + expect(context.replacing).toBe(false); + }); +}); From 9a5ef12aae890fbda188c5c29ce0be1baf90b71d Mon Sep 17 00:00:00 2001 From: Mittal Singh <111978266+Mittalnew@users.noreply.github.com> Date: Fri, 13 Nov 2026 05:45:02 +0000 Subject: [PATCH 09/27] feat: add hints to search in files search options (#3042) * feat: add hints to search in files search options * test: use a real checkbox input in search option tooltip test --------- Co-authored-by: mittal Co-authored-by: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com> (cherry picked from commit 2827118eadadb1968096674001f2b7d97f89953a) --- src/components/checkbox/index.js | 25 ++++++++++- src/components/tooltip/longPress.js | 3 +- src/lang/ar-ye.json | 2 + src/lang/az-az.json | 2 + src/lang/be-by.json | 2 + src/lang/bn-bd.json | 2 + src/lang/cs-cz.json | 2 + src/lang/de-de.json | 2 + src/lang/en-us.json | 4 +- src/lang/es-sv.json | 2 + src/lang/fr-fr.json | 2 + src/lang/he-il.json | 2 + src/lang/hi-in.json | 2 + src/lang/hu-hu.json | 2 + src/lang/id-id.json | 2 + src/lang/index.d.ts | 2 + src/lang/ir-fa.json | 2 + src/lang/it-it.json | 2 + src/lang/ja-jp.json | 2 + src/lang/ko-kr.json | 2 + src/lang/ln-ln.json | 2 + src/lang/ml-in.json | 2 + src/lang/mm-unicode.json | 2 + src/lang/mm-zawgyi.json | 2 + src/lang/pl-pl.json | 2 + src/lang/pt-br.json | 2 + src/lang/pu-in.json | 2 + src/lang/ru-ru.json | 2 + src/lang/tl-ph.json | 2 + src/lang/tr-tr.json | 2 + src/lang/uk-ua.json | 2 + src/lang/uz-uz.json | 2 + src/lang/vi-vn.json | 2 + src/lang/zh-cn.json | 2 + src/lang/zh-hant.json | 2 + src/lang/zh-tw.json | 2 + src/sidebarApps/searchInFiles/index.js | 5 +++ tests/unit/iconTooltips.test.js | 62 ++++++++++++++++++++++++++ 38 files changed, 162 insertions(+), 3 deletions(-) diff --git a/src/components/checkbox/index.js b/src/components/checkbox/index.js index 17e3e44..967cca1 100644 --- a/src/components/checkbox/index.js +++ b/src/components/checkbox/index.js @@ -37,6 +37,9 @@ export function updateSwitchHandle($handle, checked, animateToggle = true) { * @property {string} [id] * @property {string} [size] * @property {"checkbox"|"radio"} [type] + * @property {string} [title] + * @property {string} [ariaLabel] + * @property {string} [description] */ /** @@ -51,14 +54,30 @@ export function updateSwitchHandle($handle, checked, animateToggle = true) { * @returns {Checkbox & HTMLLabelElement} */ function Checkbox(text, checked, name, id, type, ref, size, isSwitch) { + let title; + let ariaLabel; + let description; if (typeof text === "object") { - ({ text, checked, name, id, type, ref, size, isSwitch } = text); + ({ + text, + checked, + name, + id, + type, + ref, + size, + isSwitch, + title, + ariaLabel, + description, + } = text); } size = size || "1rem"; const $input = ref || Ref(); const $handle = Ref(); + const label = ariaLabel || title; const $checkbox = (