Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(dsh-tauri-ui): 侧边栏 logo 居中与折叠入口去重,并修 0.1.7 会话当前态

hairyfaa2e3c72d81c
diff --git a/packages/dsh-tauri-ui/src/client/components/trigger.tsx b/packages/dsh-tauri-ui/src/client/components/trigger.tsx
index 6aab5968..6684a2f2 100644
--- a/packages/dsh-tauri-ui/src/client/components/trigger.tsx
+++ b/packages/dsh-tauri-ui/src/client/components/trigger.tsx
@@ -1,4 +1,3 @@
-import type { SessionId } from 'dsh-tauri/client'
import type { ReactElement } from 'react'
import type { SettingsTriggerProps } from './trigger.types'
import { SlotOutlet } from '@deepseek-ai/dsh-client-ui-renderer'
@@ -13,17 +12,29 @@ import { useMountStyle } from '../hooks/use-mount-style'
import { store } from '../store'
import settingsTriggerStyle from './trigger.cssr'
+interface RetainedSessionLike {
+ retainedBy?: Readonly<Record<string, number | undefined>>
+}
+
+// 0.1.7 起列表快照不再带 current,「当前会话」改由主视图持有的 reference 表达。
+function isMainViewRetained(session: RetainedSessionLike): boolean {
+ return (session.retainedBy?.mainView ?? 0) > 0
+}
+
export function SettingsTrigger({ wide, useSessions }: SettingsTriggerProps): ReactElement {
const { open } = useStore(store.settings)
const { onboarding } = useStore(store.sections)
useMountStyle(settingsTriggerStyle, SETTINGS_TRIGGER_STYLE_ID)
const [completed, setCompleted] = useState<string[]>([])
- const onboardingActive = useSessions(
- state =>
- state.phase === 'ready'
- && (state.current === undefined || state.byId[state.current]?.blank === true),
- )
+ const onboardingActive = useSessions((state) => {
+ if (state.phase !== 'ready')
+ return false
+ if (state.current !== undefined)
+ return state.byId[state.current]?.blank === true
+ const main = Object.values(state.byId).find(session => isMainViewRetained(session))
+ return main === undefined || main.blank === true
+ })
useEffect(() => {
if (!onboardingActive)
diff --git a/packages/dsh-tauri-ui/src/client/styles/global.cssr.ts b/packages/dsh-tauri-ui/src/client/styles/global.cssr.ts
index df260730..506f8355 100644
--- a/packages/dsh-tauri-ui/src/client/styles/global.cssr.ts
+++ b/packages/dsh-tauri-ui/src/client/styles/global.cssr.ts
@@ -54,13 +54,17 @@ export default c([
color: 'var(--dsw-alias-label-primary) !important',
justifyContent: 'center !important',
}, [
+ // 「右侧按钮」= 官方侧边栏自带的折叠 toggle。桌面壳 navbar 已有自己的
+ // `dsh-navbar-sidebar-toggle`(`dsh://sidebar:toggle` → `ctx.layout.toggleSidebar`),
+ // 官方这枚是重复入口;隐藏后 logo 独占整行。
c('[class$="toggle"], [class*="toggle "]', {
- justifyContent: 'center !important',
+ display: 'none !important',
}),
// 官方品牌按钮的类名是 `clsx(brand, wide)`,类属性以 `_wide` 结尾,
- // 仅靠 `[class$="brand"]` 匹配不到;两种形态都列上才能各代都隐藏。
+ // 仅靠 `[class$="brand"]` 匹配不到;两种形态都列上。
+ // 品牌按钮带 `flex: 1` 铺满整行,所以「logo 居中」要落在它自己身上,而不是行容器。
c('[class$="brand"], [class*="brand "]', {
- display: 'none !important',
+ justifyContent: 'center !important',
}),
]),
// 折叠轨道回到官方左对齐:上一条 `!important` 会盖掉官方 `.collapsed .logoRow`。
diff --git a/test/plugin-uninstall.test.ts b/test/plugin-uninstall.test.ts
index f92ec7b6..6b6e8ba1 100644
--- a/test/plugin-uninstall.test.ts
+++ b/test/plugin-uninstall.test.ts
@@ -39,7 +39,10 @@ describe('configPlugin preset chip', () => {
it('guards the chip on recommended (preset, non-internal)', () => {
const source = readFileSync(new URL('../src/ui/config/plugin.tsx', import.meta.url), 'utf8')
- expect(source).toContain('!plugin.internal && plugin.recommended')
+ // 守卫拆成两处:内置插件在列表层就被过滤掉(不再进可管理清单),
+ // 预设 chip 本身只按 `recommended` 渲染。
+ expect(source, '内置插件不进可管理列表').toContain('!plugin.internal')
+ expect(source, '预设 chip 仅对 recommended 渲染').toContain('cond={plugin.recommended}')
})
})