diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index 0307bd2..1456305 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -136,7 +136,28 @@ export function AppShell() {
}, []);
const handleSave = useCallback(() => {
- useAppStore.getState().savePaths();
+ const state = useAppStore.getState();
+ const sysJoined = state.sysPaths.toArray().join(';');
+ const userJoined = state.userPaths.toArray().join(';');
+ const combined = sysJoined + ';' + userJoined;
+
+ const warnings: string[] = [];
+ if (sysJoined.length > 2048) {
+ warnings.push(`系统 PATH 长度 ${sysJoined.length} 超过建议值 2048`);
+ }
+ if (userJoined.length > 2048) {
+ warnings.push(`用户 PATH 长度 ${userJoined.length} 超过建议值 2048`);
+ }
+ if (combined.length > 8191) {
+ warnings.push(`合并 PATH 长度 ${combined.length} 超过命令行安全限制 8191`);
+ }
+
+ if (warnings.length > 0) {
+ const msg = warnings.join('\n') + '\n\n是否继续保存?';
+ if (!window.confirm(msg)) return;
+ }
+
+ state.savePaths();
}, []);
// ── 键盘快捷键 ──
@@ -248,12 +269,31 @@ export function AppShell() {
/>
- {/* 路径列表 */}
- {activeTab === 'merged' ? (
-
- ) : (
-
- )}
+ {/* 路径列表(支持拖拽文件夹) */}
+
{
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'link';
+ }}
+ onDrop={(e) => {
+ e.preventDefault();
+ if (activeTab === 'merged') return;
+ const files = e.dataTransfer.files;
+ for (let i = 0; i < files.length; i++) {
+ const path = (files[i] as any).path;
+ if (path) {
+ useAppStore.getState().addPath(path, getCurrentTarget());
+ }
+ }
+ }}
+ >
+ {activeTab === 'merged' ? (
+
+ ) : (
+
+ )}
+
diff --git a/src/components/path-list/PathTable.tsx b/src/components/path-list/PathTable.tsx
index 83cd8a5..9876e49 100644
--- a/src/components/path-list/PathTable.tsx
+++ b/src/components/path-list/PathTable.tsx
@@ -1,11 +1,16 @@
-import { useMemo, useCallback } from 'react';
+import { useState, useEffect, useMemo, useCallback } from 'react';
import { useAppStore } from '@/store/app-store';
-import { validatePath } from '@/hooks/use-path-validation';
+import { invoke } from '@tauri-apps/api/core';
interface PathTableProps {
tabId: 'system' | 'user';
}
+interface PathRow {
+ path: string;
+ index: number;
+}
+
export function PathTable({ tabId }: PathTableProps) {
const sysPaths = useAppStore((s) => s.sysPaths);
const userPaths = useAppStore((s) => s.userPaths);
@@ -17,20 +22,94 @@ export function PathTable({ tabId }: PathTableProps) {
const paths = tabId === 'system' ? sysPaths : userPaths;
const isActive = activeTab === tabId;
+ // 本次会话中已验证过的路径缓存(key=path, value=isValid)
+ const [validationCache, setValidationCache] = useState