DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
feat(desktop): 顶部「配置」改为菜单,可直接跳转四个配置面板
hairyff799f8add19f
diff --git a/src/layout/components/navbar.tsx b/src/layout/components/navbar.tsxindex 01f96a7b..7d0bbe20 100644--- a/src/layout/components/navbar.tsx+++ b/src/layout/components/navbar.tsx@@ -1,4 +1,5 @@import type { DshPlugin } from '@/types'+import type { ConfigTab } from '@/ui/dialog/config'import {LayoutSideContent,LayoutSideContentLeft,@@ -41,6 +42,8 @@ import { toast } from '@/utils/toast'* - 文件:新建窗口(Tauri 再开一个 webview)/ 新聊天、打开文件夹(经协议调用 dsh 官方* 「新建会话」「添加工作区」,接收方是 dsh-tauri 的 `client/register/navigation.ts`)/* 关闭(隐藏到托盘)/ 退出(完整退出)。两条依赖 iframe 的项在回调缺席时禁用。+ * - 配置:应用 / 档案 / 插件 / 核心,直接打开配置对话框并定位到对应面板+ * (对话框与角标见 `ui/dialog/config.tsx`)。* - 帮助:运行日志 / 检查更新 / 关于 Desktop / 文档(系统浏览器打开官方文档站)。* - 空白拖拽区:Tauri 原生 `data-tauri-drag-region`(顶层文档直接生效),* Windows/Linux 上双击切换最大化,macOS 上交由系统标题栏偏好。@@ -75,6 +78,14 @@ type FileAction = 'new-window' | 'new-chat' | 'open-folder' | 'close' | 'quit'/** 「帮助」菜单的动作 id。 */type HelpAction = 'copy-run-logs' | 'check-update' | 'about' | 'documentation'+/** 「配置」菜单项:直接打开配置对话框并定位到对应面板。 */+const CONFIG_TABS: { id: ConfigTab, labelKey: string }[] = [+ { id: 'application', labelKey: 'config.application' },+ { id: 'profiles', labelKey: 'config.profiles' },+ { id: 'plugins', labelKey: 'config.plugins' },+ { id: 'harness', labelKey: 'config.harness' },+]+/** WKWebView 的 macOS UA 稳定包含 Macintosh,用于切换平台原生窗口 chrome。 */function detectMacOS() {return navigator.userAgent.includes('Macintosh')@@ -255,8 +266,8 @@ export function Navbar({ sidebarCollapsed = false, onToggleSidebar, onNewChat, o}}- function handleOpenConfig() {- void openConfigDialog().catch(() => { })+ function handleOpenConfig(tab?: ConfigTab) {+ void openConfigDialog({ tab }).catch(() => { })}function handleOpenAbout() {@@ -419,14 +430,31 @@ export function Navbar({ sidebarCollapsed = false, onToggleSidebar, onNewChat, o</Dropdown.Menu></Dropdown.Popover></Dropdown>- <Button- className="rounded-lg h-6 text-xs px-1.5"- size="sm"- variant="ghost"- onPress={handleOpenConfig}- >- {t('app.config')}- </Button>+ <Dropdown>+ <Button+ className="rounded-lg h-6 text-xs px-1.5"+ size="sm"+ variant="ghost"+ aria-label={t('app.config')}+ >+ {t('app.config')}+ </Button>+ <Dropdown.Popover className="rounded-md w-5!">+ <Dropdown.Menu>+ {CONFIG_TABS.map(item => (+ <Dropdown.Item+ key={item.id}+ className="rounded-md"+ id={item.id}+ textValue={t(item.labelKey)}+ onAction={() => handleOpenConfig(item.id)}+ >+ <Label>{t(item.labelKey)}</Label>+ </Dropdown.Item>+ ))}+ </Dropdown.Menu>+ </Dropdown.Popover>+ </Dropdown><Dropdown><ButtonclassName="rounded-lg h-6 text-xs px-1.5"diff --git a/src/ui/dialog/config.tsx b/src/ui/dialog/config.tsxindex 408edfc6..e157e546 100644--- a/src/ui/dialog/config.tsx+++ b/src/ui/dialog/config.tsx@@ -16,7 +16,13 @@ import { ConfigDebug } from '@/ui/config/debug'import { ConfigPlugin } from '@/ui/config/plugin'import { ConfigProfile } from '@/ui/config/profile'-export interface ConfigDialogProps extends PropsWithOverlays {}+/** 配置面板标识(左侧导航与顶部「配置」菜单共用同一组值) */+export type ConfigTab = 'application' | 'profiles' | 'plugins' | 'harness'++export interface ConfigDialogProps extends PropsWithOverlays {+ /** 打开时定位到的面板;缺省为「应用」 */+ tab?: ConfigTab+}export function ConfigDialog(props: ConfigDialogProps) {const disclosure = useDisclosure({ props })@@ -29,14 +35,14 @@ export function ConfigDialog(props: ConfigDialogProps) {})const abnormalCount = plugins.filter(p => p.error != null).length- const navs = [+ const navs: { label: string, value: ConfigTab, icon: typeof Cpu }[] = [{ label: t('config.application'), value: 'application', icon: LogoWindows },{ label: t('config.profiles'), value: 'profiles', icon: PersonPencil },{ label: t('config.plugins'), value: 'plugins', icon: Puzzle },{ label: t('config.harness'), value: 'harness', icon: Cpu },]- const [activeTab, setActiveTab] = useState('application')+ const [activeTab, setActiveTab] = useState<ConfigTab>(props.tab ?? 'application')// 服务重启/退出前由 store 触发,命令式收起本对话框(卸载时自动注销)useListener(hooks['config.dialog.hidden'].on, disclosure.cancel)