mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 18:15:55 +08:00
fix: 最终审查修复 — 数据安全、功能缺失、状态管理
Rust: - save_paths 添加 Windows PATH 32767 字符上限检查防静默截断 - backup_registry 回退路径统一为 backup_base_dir() 三级链 Store: - 新增 isSaving 并发守卫防止重复保存 - 保存失败详情通过 Promise.allSettled.reason 展示 - isModified 改为与上次保存快照比较(undo/redo 后准确反映状态) - 批删除合并为单条撤销记录(N 次删除 → 1 次 Ctrl+Z 恢复) - 保存失败/备份失败使用 i18n 键(消除硬编码中文) UI: - 拖拽添加改用 webkitGetAsEntry().isDirectory 校验文件夹 - Ctrl+F 快捷键聚焦搜索框 - handleClean 使用 is_valid_path_format(替代不完整的 inline 函数) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useAppStore } from '@/store/app-store';
|
||||
import { TargetType } from '@/core/undo-redo';
|
||||
import { open } from '@tauri-apps/plugin-dialog';
|
||||
import { importFromContent, exportToJson, flattenImportResult } from '@/core/import-export';
|
||||
import { is_valid_path_format } from '@/core/validation';
|
||||
import { useKeyboard } from './use-keyboard';
|
||||
import i18n from '@/i18n';
|
||||
import type { TabId } from '@/store/app-store';
|
||||
@@ -68,7 +69,7 @@ export function useAppActions(activeTab: TabId, dialogs: DialogState) {
|
||||
const handleClean = useCallback(() => {
|
||||
const removed = useAppStore.getState().cleanPaths(
|
||||
getCurrentTarget(),
|
||||
(p) => p.includes('%') || p.includes('\\') || p.includes('/') || /^[a-zA-Z]:[/\\]/.test(p),
|
||||
is_valid_path_format,
|
||||
);
|
||||
if (removed.length > 0) {
|
||||
useAppStore.getState().setStatusMessage(
|
||||
|
||||
Reference in New Issue
Block a user