diff --git a/src-tauri/src/commands/misc.rs b/src-tauri/src/commands/misc.rs index f848fe6bf..b159bd8b2 100644 --- a/src-tauri/src/commands/misc.rs +++ b/src-tauri/src/commands/misc.rs @@ -754,7 +754,7 @@ fn launch_macos_open_app( let output = cmd .output() - .map_err(|e| format!("启动 {} 失败: {e}", app_name))?; + .map_err(|e| format!("启动 {app_name} 失败: {e}"))?; if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr); diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs index df5e47d25..ff81fde2e 100644 --- a/src-tauri/src/commands/mod.rs +++ b/src-tauri/src/commands/mod.rs @@ -12,8 +12,8 @@ mod plugin; mod prompt; mod provider; mod proxy; -mod settings; mod session_manager; +mod settings; pub mod skill; mod stream_check; mod usage; @@ -30,8 +30,8 @@ pub use plugin::*; pub use prompt::*; pub use provider::*; pub use proxy::*; -pub use settings::*; pub use session_manager::*; +pub use settings::*; pub use skill::*; pub use stream_check::*; pub use usage::*; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index de307b856..45d15605b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -20,8 +20,8 @@ mod prompt_files; mod provider; mod provider_defaults; mod proxy; -mod session_manager; mod services; +mod session_manager; mod settings; mod store; mod tray; diff --git a/src-tauri/src/session_manager/providers/claude.rs b/src-tauri/src/session_manager/providers/claude.rs index 48101d3e0..b953c015d 100644 --- a/src-tauri/src/session_manager/providers/claude.rs +++ b/src-tauri/src/session_manager/providers/claude.rs @@ -55,17 +55,12 @@ pub fn load_messages(path: &Path) -> Result, String> { .and_then(Value::as_str) .unwrap_or("unknown") .to_string(); - let content = message - .get("content") - .map(extract_text) - .unwrap_or_default(); + let content = message.get("content").map(extract_text).unwrap_or_default(); if content.trim().is_empty() { continue; } - let ts = value - .get("timestamp") - .and_then(parse_timestamp_to_ms); + let ts = value.get("timestamp").and_then(parse_timestamp_to_ms); messages.push(SessionMessage { role, content, ts }); } @@ -127,10 +122,7 @@ fn parse_session(path: &Path) -> Option { None => continue, }; - let text = message - .get("content") - .map(extract_text) - .unwrap_or_default(); + let text = message.get("content").map(extract_text).unwrap_or_default(); if text.trim().is_empty() { continue; } diff --git a/src-tauri/src/session_manager/providers/codex.rs b/src-tauri/src/session_manager/providers/codex.rs index 4cff72915..6c2b62b58 100644 --- a/src-tauri/src/session_manager/providers/codex.rs +++ b/src-tauri/src/session_manager/providers/codex.rs @@ -2,8 +2,8 @@ use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::{Path, PathBuf}; -use serde_json::Value; use regex::Regex; +use serde_json::Value; use crate::codex_config::get_codex_config_dir; use crate::session_manager::{SessionMessage, SessionMeta}; @@ -60,17 +60,12 @@ pub fn load_messages(path: &Path) -> Result, String> { .and_then(Value::as_str) .unwrap_or("unknown") .to_string(); - let content = payload - .get("content") - .map(extract_text) - .unwrap_or_default(); + let content = payload.get("content").map(extract_text).unwrap_or_default(); if content.trim().is_empty() { continue; } - let ts = value - .get("timestamp") - .and_then(parse_timestamp_to_ms); + let ts = value.get("timestamp").and_then(parse_timestamp_to_ms); messages.push(SessionMessage { role, content, ts }); } @@ -139,10 +134,7 @@ fn parse_session(path: &Path) -> Option { continue; } - let text = payload - .get("content") - .map(extract_text) - .unwrap_or_default(); + let text = payload.get("content").map(extract_text).unwrap_or_default(); if text.trim().is_empty() { continue; } @@ -174,10 +166,9 @@ fn parse_session(path: &Path) -> Option { fn infer_session_id_from_filename(path: &Path) -> Option { let file_name = path.file_name()?.to_string_lossy(); - let re = Regex::new( - r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}", - ) - .ok()?; + let re = + Regex::new(r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}") + .ok()?; re.find(&file_name).map(|mat| mat.as_str().to_string()) } diff --git a/src-tauri/src/session_manager/providers/utils.rs b/src-tauri/src/session_manager/providers/utils.rs index 5e8c43877..76408ea35 100644 --- a/src-tauri/src/session_manager/providers/utils.rs +++ b/src-tauri/src/session_manager/providers/utils.rs @@ -13,7 +13,7 @@ pub fn extract_text(content: &Value) -> String { Value::String(text) => text.to_string(), Value::Array(items) => items .iter() - .filter_map(|item| extract_text_from_item(item)) + .filter_map(extract_text_from_item) .filter(|text| !text.trim().is_empty()) .collect::>() .join("\n"), @@ -68,10 +68,10 @@ pub fn path_basename(value: &str) -> Option { if trimmed.is_empty() { return None; } - let normalized = trimmed.trim_end_matches(|c| c == '/' || c == '\\'); + let normalized = trimmed.trim_end_matches(['/', '\\']); let last = normalized .split(['/', '\\']) - .last() + .next_back() .filter(|segment| !segment.is_empty())?; Some(last.to_string()) } diff --git a/src-tauri/src/session_manager/terminal/mod.rs b/src-tauri/src/session_manager/terminal/mod.rs index 799fa6552..f4d93adda 100644 --- a/src-tauri/src/session_manager/terminal/mod.rs +++ b/src-tauri/src/session_manager/terminal/mod.rs @@ -32,9 +32,8 @@ fn launch_macos_terminal(command: &str, cwd: Option<&str>) -> Result<(), String> let script = format!( r#"tell application "Terminal" activate - do script "{}" -end tell"#, - escaped + do script "{escaped}" +end tell"# ); let status = Command::new("osascript") @@ -59,10 +58,9 @@ fn launch_iterm(command: &str, cwd: Option<&str>) -> Result<(), String> { activate create window with default profile tell current session of current window - write text "{}" + write text "{escaped}" end tell -end tell"#, - escaped +end tell"# ); let status = Command::new("osascript") @@ -88,7 +86,7 @@ fn launch_ghostty(command: &str, cwd: Option<&str>) -> Result<(), String> { // Note: The user's error output didn't show the working dir arg failure, so we assume flag is okay or we stick to compatible ones. // Documentation says --working-directory is supported in CLI. let work_dir_arg = if let Some(dir) = cwd { - format!("--working-directory={}", dir) + format!("--working-directory={dir}") } else { "".to_string() }; @@ -251,7 +249,7 @@ fn build_shell_command(command: &str, cwd: Option<&str>) -> String { fn shell_escape(value: &str) -> String { let escaped = value.replace('\\', "\\\\").replace('"', "\\\""); - format!("\"{}\"", escaped) + format!("\"{escaped}\"") } fn escape_osascript(value: &str) -> String { diff --git a/src/App.tsx b/src/App.tsx index a11487d2f..de9c6881c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -175,7 +175,7 @@ function App() { // 当前应用代理实际使用的供应商 ID(从 active_targets 中获取) const activeProviderId = useMemo(() => { const target = proxyStatus?.active_targets?.find( - (t) => t.app_type === activeApp + (t) => t.app_type === activeApp, ); return target?.provider_id; }, [proxyStatus?.active_targets, activeApp]); @@ -208,7 +208,7 @@ function App() { if (event.appType === activeApp) { await refetch(); } - } + }, ); } catch (error) { console.error("[App] Failed to subscribe provider switch event", error); @@ -242,7 +242,7 @@ function App() { } catch (error) { console.error( "[App] Failed to subscribe universal-provider-synced event", - error + error, ); } }; @@ -270,7 +270,7 @@ function App() { } catch (error) { console.error( "[App] Failed to check environment conflicts on startup:", - error + error, ); } }; @@ -286,7 +286,7 @@ function App() { if (migrated) { toast.success( t("migration.success", { defaultValue: "配置迁移成功" }), - { closeButton: true } + { closeButton: true }, ); } } catch (error) { @@ -302,7 +302,7 @@ function App() { const checkSkillsMigration = async () => { try { const result = await invoke<{ count: number; error?: string } | null>( - "get_skills_migration_result" + "get_skills_migration_result", ); if (result?.error) { toast.error(t("migration.skillsFailed"), { @@ -336,10 +336,10 @@ function App() { // 合并新检测到的冲突 setEnvConflicts((prev) => { const existingKeys = new Set( - prev.map((c) => `${c.varName}:${c.sourcePath}`) + prev.map((c) => `${c.varName}:${c.sourcePath}`), ); const newConflicts = conflicts.filter( - (c) => !existingKeys.has(`${c.varName}:${c.sourcePath}`) + (c) => !existingKeys.has(`${c.varName}:${c.sourcePath}`), ); return [...prev, ...newConflicts]; }); @@ -351,7 +351,7 @@ function App() { } catch (error) { console.error( "[App] Failed to check environment conflicts on app switch:", - error + error, ); } }; @@ -433,7 +433,7 @@ function App() { t("notifications.removeFromConfigSuccess", { defaultValue: "已从配置移除", }), - { closeButton: true } + { closeButton: true }, ); } else { // Delete from database @@ -445,7 +445,7 @@ function App() { // Generate a unique provider key for OpenCode duplication const generateUniqueOpencodeKey = ( originalKey: string, - existingKeys: string[] + existingKeys: string[], ): string => { const baseKey = `${originalKey}-copy`; @@ -487,7 +487,7 @@ function App() { const existingKeys = Object.keys(providers); duplicatedProvider.providerKey = generateUniqueOpencodeKey( provider.id, - existingKeys + existingKeys, ); } @@ -498,7 +498,7 @@ function App() { (p) => p.sortIndex !== undefined && p.sortIndex >= newSortIndex! && - p.id !== provider.id + p.id !== provider.id, ) .map((p) => ({ id: p.id, @@ -514,7 +514,7 @@ function App() { toast.error( t("provider.sortUpdateFailed", { defaultValue: "排序更新失败", - }) + }), ); return; // 如果排序更新失败,不继续添加 } @@ -532,7 +532,7 @@ function App() { toast.success( t("provider.terminalOpened", { defaultValue: "终端已打开", - }) + }), ); } catch (error) { console.error("[App] Failed to open terminal", error); @@ -540,7 +540,7 @@ function App() { toast.error( t("provider.terminalOpenFailed", { defaultValue: "打开终端失败", - }) + (errorMessage ? `: ${errorMessage}` : "") + }) + (errorMessage ? `: ${errorMessage}` : ""), ); } }; @@ -721,7 +721,7 @@ function App() { } catch (error) { console.error( "[App] Failed to re-check conflicts after deletion:", - error + error, ); } }} @@ -755,7 +755,9 @@ function App() { size="icon" onClick={() => setCurrentView( - currentView === "skillsDiscovery" ? "skills" : "providers" + currentView === "skillsDiscovery" + ? "skills" + : "providers", ) } className="mr-2 rounded-lg" @@ -788,7 +790,7 @@ function App() { "text-xl font-semibold transition-colors", isProxyRunning && isCurrentAppTakeoverActive ? "text-emerald-500 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-300" - : "text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300" + : "text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300", )} > CC Switch @@ -934,7 +936,7 @@ function App() { "transition-all duration-300 ease-in-out overflow-hidden", isCurrentAppTakeoverActive ? "opacity-100 max-w-[100px] scale-100" - : "opacity-0 max-w-0 scale-75 pointer-events-none" + : "opacity-0 max-w-0 scale-75 pointer-events-none", )} > @@ -962,7 +964,7 @@ function App() { "transition-all duration-200 ease-in-out overflow-hidden", hasSkillsSupport ? "opacity-100 w-8 scale-100 px-2" - : "opacity-0 w-0 scale-75 pointer-events-none px-0 -ml-1" + : "opacity-0 w-0 scale-75 pointer-events-none px-0 -ml-1", )} title={t("skills.manage")} > diff --git a/src/components/common/AppCountBar.tsx b/src/components/common/AppCountBar.tsx index 3045e68ed..295d8e24c 100644 --- a/src/components/common/AppCountBar.tsx +++ b/src/components/common/AppCountBar.tsx @@ -8,7 +8,10 @@ interface AppCountBarProps { counts: Record; } -export const AppCountBar: React.FC = ({ totalLabel, counts }) => { +export const AppCountBar: React.FC = ({ + totalLabel, + counts, +}) => { return (
diff --git a/src/components/common/AppToggleGroup.tsx b/src/components/common/AppToggleGroup.tsx index 27d77bd7c..0f18f7fc9 100644 --- a/src/components/common/AppToggleGroup.tsx +++ b/src/components/common/AppToggleGroup.tsx @@ -12,7 +12,10 @@ interface AppToggleGroupProps { onToggle: (app: AppId, enabled: boolean) => void; } -export const AppToggleGroup: React.FC = ({ apps, onToggle }) => { +export const AppToggleGroup: React.FC = ({ + apps, + onToggle, +}) => { return (
{APP_IDS.map((app) => { @@ -25,16 +28,17 @@ export const AppToggleGroup: React.FC = ({ apps, onToggle } type="button" onClick={() => onToggle(app, !enabled)} className={`w-7 h-7 rounded-lg flex items-center justify-center transition-all ${ - enabled - ? activeClass - : "opacity-35 hover:opacity-70" + enabled ? activeClass : "opacity-35 hover:opacity-70" }`} > {icon} -

{label}{enabled ? " ✓" : ""}

+

+ {label} + {enabled ? " ✓" : ""} +

); diff --git a/src/components/common/ListItemRow.tsx b/src/components/common/ListItemRow.tsx index 8d0c54fd4..90ec303bd 100644 --- a/src/components/common/ListItemRow.tsx +++ b/src/components/common/ListItemRow.tsx @@ -5,7 +5,10 @@ interface ListItemRowProps { children: React.ReactNode; } -export const ListItemRow: React.FC = ({ isLast, children }) => { +export const ListItemRow: React.FC = ({ + isLast, + children, +}) => { return (
= ({
- {name} + + {name} + {docsUrl && (
{description && ( -

+

{description}

)} diff --git a/src/components/sessions/SessionItem.tsx b/src/components/sessions/SessionItem.tsx index 628474e3c..9a6558f27 100644 --- a/src/components/sessions/SessionItem.tsx +++ b/src/components/sessions/SessionItem.tsx @@ -40,7 +40,7 @@ export function SessionItem({ "w-full text-left rounded-lg px-3 py-2.5 transition-all group", isSelected ? "bg-primary/10 border border-primary/30" - : "hover:bg-muted/60 border border-transparent" + : "hover:bg-muted/60 border border-transparent", )} >
@@ -62,7 +62,7 @@ export function SessionItem({
diff --git a/src/components/sessions/SessionManagerPage.tsx b/src/components/sessions/SessionManagerPage.tsx index c25291c36..2654b8076 100644 --- a/src/components/sessions/SessionManagerPage.tsx +++ b/src/components/sessions/SessionManagerPage.tsx @@ -76,7 +76,7 @@ export function SessionManagerPage() { const messagesEndRef = useRef(null); const messageRefs = useRef>(new Map()); const [activeMessageIndex, setActiveMessageIndex] = useState( - null + null, ); const [tocDialogOpen, setTocDialogOpen] = useState(false); const [isSearchOpen, setIsSearchOpen] = useState(false); @@ -91,7 +91,7 @@ export function SessionManagerPage() { useEffect(() => { const storedTarget = window.localStorage.getItem( - TERMINAL_TARGET_KEY + TERMINAL_TARGET_KEY, ) as TerminalTarget | null; if (storedTarget) { setTerminalTarget(storedTarget); @@ -123,7 +123,7 @@ export function SessionManagerPage() { } const exists = selectedKey ? filteredSessions.some( - (session) => getSessionKey(session) === selectedKey + (session) => getSessionKey(session) === selectedKey, ) : false; if (!exists) { @@ -135,7 +135,7 @@ export function SessionManagerPage() { if (!selectedKey) return null; return ( filteredSessions.find( - (session) => getSessionKey(session) === selectedKey + (session) => getSessionKey(session) === selectedKey, ) || null ); }, [filteredSessions, selectedKey]); @@ -143,7 +143,7 @@ export function SessionManagerPage() { const { data: messages = [], isLoading: isLoadingMessages } = useSessionMessagesQuery( selectedSession?.providerId, - selectedSession?.sourcePath + selectedSession?.sourcePath, ); // 提取用户消息用于目录 @@ -187,7 +187,7 @@ export function SessionManagerPage() { } catch (error) { toast.error( extractErrorMessage(error) || - t("common.error", { defaultValue: "Copy failed" }) + t("common.error", { defaultValue: "Copy failed" }), ); } }; @@ -198,7 +198,7 @@ export function SessionManagerPage() { if (!isMac()) { await handleCopy( selectedSession.resumeCommand, - t("sessionManager.resumeCommandCopied") + t("sessionManager.resumeCommandCopied"), ); return; } @@ -281,7 +281,7 @@ export function SessionManagerPage() { setIsSearchOpen(true); setTimeout( () => searchInputRef.current?.focus(), - 0 + 0, ); }} > @@ -428,7 +428,7 @@ export function SessionManagerPage() { {formatTimestamp( selectedSession.lastActiveAt ?? - selectedSession.createdAt + selectedSession.createdAt, )}
@@ -463,7 +463,7 @@ export function SessionManagerPage() { onClick={() => void handleCopy( selectedSession.projectDir!, - t("sessionManager.projectDirCopied") + t("sessionManager.projectDirCopied"), ) } className="flex items-center gap-1 hover:text-foreground transition-colors" @@ -590,7 +590,7 @@ export function SessionManagerPage() { onClick={() => void handleCopy( selectedSession.resumeCommand!, - t("sessionManager.resumeCommandCopied") + t("sessionManager.resumeCommandCopied"), ) } > @@ -652,7 +652,7 @@ export function SessionManagerPage() { content, t("sessionManager.messageCopied", { defaultValue: "已复制消息内容", - }) + }), ) } /> diff --git a/src/components/sessions/SessionMessageItem.tsx b/src/components/sessions/SessionMessageItem.tsx index 805d50ba6..81d420314 100644 --- a/src/components/sessions/SessionMessageItem.tsx +++ b/src/components/sessions/SessionMessageItem.tsx @@ -37,7 +37,7 @@ export function SessionMessageItem({ : message.role.toLowerCase() === "assistant" ? "bg-blue-500/5 border-blue-500/20 mr-8" : "bg-muted/40 border-border/60", - isActive && "ring-2 ring-primary ring-offset-2" + isActive && "ring-2 ring-primary ring-offset-2", )} > diff --git a/src/components/sessions/SessionToc.tsx b/src/components/sessions/SessionToc.tsx index 650bf5b3f..daefab4d0 100644 --- a/src/components/sessions/SessionToc.tsx +++ b/src/components/sessions/SessionToc.tsx @@ -46,7 +46,7 @@ export function SessionTocSidebar({ className={cn( "w-full text-left px-2 py-1.5 rounded text-xs transition-colors", "hover:bg-muted/80 text-muted-foreground hover:text-foreground", - "flex items-start gap-2" + "flex items-start gap-2", )} > @@ -115,7 +115,7 @@ export function SessionTocDialog({ "w-full text-left px-3 py-2.5 rounded-lg text-sm transition-all", "hover:bg-primary/10 text-foreground", "flex items-start gap-3", - "focus:outline-none focus:ring-2 focus:ring-primary focus:ring-inset" + "focus:outline-none focus:ring-2 focus:ring-primary focus:ring-inset", )} > diff --git a/src/components/sessions/utils.ts b/src/components/sessions/utils.ts index 0cb4aa233..c3d0bb127 100644 --- a/src/components/sessions/utils.ts +++ b/src/components/sessions/utils.ts @@ -34,7 +34,7 @@ export const formatRelativeTime = (value?: number) => { export const getProviderLabel = ( providerId: string, - t: (key: string) => string + t: (key: string) => string, ) => { const key = `apps.${providerId}`; const translated = t(key); diff --git a/src/components/skills/UnifiedSkillsPanel.tsx b/src/components/skills/UnifiedSkillsPanel.tsx index c945299e8..6d6f62ce2 100644 --- a/src/components/skills/UnifiedSkillsPanel.tsx +++ b/src/components/skills/UnifiedSkillsPanel.tsx @@ -63,11 +63,7 @@ const UnifiedSkillsPanel = React.forwardRef< return counts; }, [skills]); - const handleToggleApp = async ( - id: string, - app: AppId, - enabled: boolean, - ) => { + const handleToggleApp = async (id: string, app: AppId, enabled: boolean) => { try { await toggleAppMutation.mutateAsync({ id, app, enabled }); } catch (error) { @@ -257,7 +253,9 @@ const InstalledSkillListItem: React.FC = ({
- {skill.name} + + {skill.name} + {skill.readmeUrl && ( )} - {sourceLabel} + + {sourceLabel} +
{skill.description && ( -

+

{skill.description}

)} diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx index 32cf968d2..b1f11275a 100644 --- a/src/components/ui/scroll-area.tsx +++ b/src/components/ui/scroll-area.tsx @@ -36,7 +36,7 @@ const ScrollBar = React.forwardRef< "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", - className + className, )} {...props} > diff --git a/src/components/ui/tooltip.tsx b/src/components/ui/tooltip.tsx index 6fdf76a17..92a97e46a 100644 --- a/src/components/ui/tooltip.tsx +++ b/src/components/ui/tooltip.tsx @@ -20,7 +20,7 @@ const TooltipContent = React.forwardRef< sideOffset={sideOffset} className={cn( "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", - className + className, )} {...props} /> diff --git a/src/config/appConfig.tsx b/src/config/appConfig.tsx index 9ad1d763d..6ab2b5046 100644 --- a/src/config/appConfig.tsx +++ b/src/config/appConfig.tsx @@ -16,25 +16,40 @@ export const APP_ICON_MAP: Record = { claude: { label: "Claude", icon: , - activeClass: "bg-orange-500/10 ring-1 ring-orange-500/20 hover:bg-orange-500/20 text-orange-600 dark:text-orange-400", - badgeClass: "bg-orange-500/10 text-orange-700 dark:text-orange-300 hover:bg-orange-500/20 border-0 gap-1.5", + activeClass: + "bg-orange-500/10 ring-1 ring-orange-500/20 hover:bg-orange-500/20 text-orange-600 dark:text-orange-400", + badgeClass: + "bg-orange-500/10 text-orange-700 dark:text-orange-300 hover:bg-orange-500/20 border-0 gap-1.5", }, codex: { label: "Codex", icon: , - activeClass: "bg-green-500/10 ring-1 ring-green-500/20 hover:bg-green-500/20 text-green-600 dark:text-green-400", - badgeClass: "bg-green-500/10 text-green-700 dark:text-green-300 hover:bg-green-500/20 border-0 gap-1.5", + activeClass: + "bg-green-500/10 ring-1 ring-green-500/20 hover:bg-green-500/20 text-green-600 dark:text-green-400", + badgeClass: + "bg-green-500/10 text-green-700 dark:text-green-300 hover:bg-green-500/20 border-0 gap-1.5", }, gemini: { label: "Gemini", icon: , - activeClass: "bg-blue-500/10 ring-1 ring-blue-500/20 hover:bg-blue-500/20 text-blue-600 dark:text-blue-400", - badgeClass: "bg-blue-500/10 text-blue-700 dark:text-blue-300 hover:bg-blue-500/20 border-0 gap-1.5", + activeClass: + "bg-blue-500/10 ring-1 ring-blue-500/20 hover:bg-blue-500/20 text-blue-600 dark:text-blue-400", + badgeClass: + "bg-blue-500/10 text-blue-700 dark:text-blue-300 hover:bg-blue-500/20 border-0 gap-1.5", }, opencode: { label: "OpenCode", - icon: , - activeClass: "bg-indigo-500/10 ring-1 ring-indigo-500/20 hover:bg-indigo-500/20 text-indigo-600 dark:text-indigo-400", - badgeClass: "bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 hover:bg-indigo-500/20 border-0 gap-1.5", + icon: ( + + ), + activeClass: + "bg-indigo-500/10 ring-1 ring-indigo-500/20 hover:bg-indigo-500/20 text-indigo-600 dark:text-indigo-400", + badgeClass: + "bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 hover:bg-indigo-500/20 border-0 gap-1.5", }, }; diff --git a/src/hooks/useSessionSearch.ts b/src/hooks/useSessionSearch.ts index e298a9a67..b22437431 100644 --- a/src/hooks/useSessionSearch.ts +++ b/src/hooks/useSessionSearch.ts @@ -117,7 +117,7 @@ export function useSessionSearch({ .filter( (session) => session && - (providerFilter === "all" || session.providerId === providerFilter) + (providerFilter === "all" || session.providerId === providerFilter), ); // 按时间排序 @@ -127,7 +127,7 @@ export function useSessionSearch({ return bTs - aTs; }); }, - [sessions, providerFilter] + [sessions, providerFilter], ); return useMemo(() => ({ search, isIndexing }), [search, isIndexing]); diff --git a/src/lib/api/sessions.ts b/src/lib/api/sessions.ts index 358d9abc1..7233c18bd 100644 --- a/src/lib/api/sessions.ts +++ b/src/lib/api/sessions.ts @@ -8,7 +8,7 @@ export const sessionsApi = { async getMessages( providerId: string, - sourcePath: string + sourcePath: string, ): Promise { return await invoke("get_session_messages", { providerId, sourcePath }); }, diff --git a/src/lib/api/skills.ts b/src/lib/api/skills.ts index f56b8be88..e7a6e34f2 100644 --- a/src/lib/api/skills.ts +++ b/src/lib/api/skills.ts @@ -91,11 +91,7 @@ export const skillsApi = { }, /** 切换 Skill 的应用启用状态 */ - async toggleApp( - id: string, - app: AppId, - enabled: boolean, - ): Promise { + async toggleApp(id: string, app: AppId, enabled: boolean): Promise { return await invoke("toggle_skill_app", { id, app, enabled }); }, @@ -133,10 +129,7 @@ export const skillsApi = { }, /** 卸载技能(兼容旧 API) */ - async uninstall( - directory: string, - app: AppId = "claude", - ): Promise { + async uninstall(directory: string, app: AppId = "claude"): Promise { if (app === "claude") { return await invoke("uninstall_skill", { directory }); }