diff --git a/apps/desktop/src/renderer/src/components/SettingsModal.tsx b/apps/desktop/src/renderer/src/components/SettingsModal.tsx index 8764bcc..5b6d428 100644 --- a/apps/desktop/src/renderer/src/components/SettingsModal.tsx +++ b/apps/desktop/src/renderer/src/components/SettingsModal.tsx @@ -635,6 +635,7 @@ function PluginsPanel({ onToggle, devBuild, onOpenDir, + onOpenSettings, onNavToggle }: { /** 正在切换中的插件 id(切换期间全部开关禁用,避免并发重建运行时) */ @@ -643,6 +644,8 @@ function PluginsPanel({ /** 开发版构建(第三方装载开关开启);用户版展示关闭提示 */ devBuild: boolean onOpenDir: (path: string) => void + /** 打开插件自己的二级配置页(点击插件行进入;仅已声明设置表单的插件可点) */ + onOpenSettings: (pluginId: string) => void /** 把设置入口固定/移出到设置页一级导航 */ onNavToggle: (pluginId: string, on: boolean) => void }): ReactNode { @@ -725,8 +728,28 @@ function PluginsPanel({ (a, b) => (a.manifest.order ?? 100) - (b.manifest.order ?? 100) || a.manifest.id.localeCompare(b.manifest.id) ) - .map((p) => ( -
+ .map((p) => { + const openSettings = p.hasSettings && p.enabled + return ( +
onOpenSettings(p.manifest.id) : undefined} + onKeyDown={ + openSettings + ? (e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault() + onOpenSettings(p.manifest.id) + } + } + : undefined + } + className={`flex items-center gap-3 rounded-card border border-line px-3 py-2.5 ${ + openSettings ? 'cursor-pointer transition-colors hover:bg-hover' : '' + }`} + >
{p.manifest.name} @@ -739,7 +762,11 @@ function PluginsPanel({ )} {p.error &&
装载失败:{p.error}
}
-
+
e.stopPropagation()} + onKeyDown={(e) => e.stopPropagation()} + >
{p.enabled ? '已启动' : '已关闭'}
-
- ))} +
+ ) + })}
)}
@@ -1434,6 +1462,7 @@ export function SettingsModal({ onToggle={togglePlugin} devBuild={import.meta.env.DEV} onOpenDir={(path) => void window.api.openPath(path)} + onOpenSettings={(pluginId) => setTab(`plugin:${pluginId}`)} onNavToggle={handleSetSettingsNav} /> )}