DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(ui): keep turn navigation visible in narrow sidebar
hairyf5edf495c5f19
diff --git a/packages/dsh-tauri-ui/README.md b/packages/dsh-tauri-ui/README.mdindex d4adfc63..4dc71a8e 100644--- a/packages/dsh-tauri-ui/README.md+++ b/packages/dsh-tauri-ui/README.md@@ -6,6 +6,7 @@- 在 `sidebar.settings` 注册设置触发器。- 在 `shell.overlay` 渲染桌面化设置侧边栏。+- 通过稳定的中英文 `aria-label` 选择器修补核心 `轮次导航`(`Turn navigation`),在侧栏缩小/窄栏时仍固定在视口内常驻可见,并保留核心导航项与内部滚动。- 通过 `settings.section` 展示官方设置分区。- 设置打开期间持续隐藏并禁用宿主内容列及异步挂载的 Better Sidebar,关闭时精确恢复原状态。- 提供中英文的返回应用、搜索设置等文案。diff --git a/packages/dsh-tauri-ui/src/client/constants/index.ts b/packages/dsh-tauri-ui/src/client/constants/index.tsindex bac17cff..5a9cd769 100644--- a/packages/dsh-tauri-ui/src/client/constants/index.ts+++ b/packages/dsh-tauri-ui/src/client/constants/index.ts@@ -12,6 +12,11 @@ export const SETTINGS_ONBOARDING_SLOT = 'settings.onboarding'export const SETTINGS_SHELL_SEAT_ID = SETTINGS_UI_PLUGINexport const SETTINGS_SIDEBAR_ID = 'dsh-tauri-ui-settings'export const SETTINGS_STYLE_ID = 'dsh-tauri-ui-settings-styles'+export const TURN_NAVIGATION_STYLE_ID = 'dsh-tauri-ui-turn-navigation-styles'+export const TURN_NAVIGATION_LABEL_ZH = '轮次导航'+export const TURN_NAVIGATION_LABEL_EN = 'Turn navigation'+export const TURN_NAVIGATION_SELECTOR = `:is(nav[aria-label="${TURN_NAVIGATION_LABEL_ZH}"], nav[aria-label="${TURN_NAVIGATION_LABEL_EN}"])`+export const TURN_NAVIGATION_NARROW_SELECTOR = `[data-sidebar-collapsed] ${TURN_NAVIGATION_SELECTOR}`export const SETTINGS_REGISTRANT = SETTINGS_UI_PLUGINexport const SETTINGS_TRIGGER_PRIORITY = -1diff --git a/packages/dsh-tauri-ui/src/client/index.ts b/packages/dsh-tauri-ui/src/client/index.tsindex 0bb13bb7..05f34449 100644--- a/packages/dsh-tauri-ui/src/client/index.ts+++ b/packages/dsh-tauri-ui/src/client/index.ts@@ -40,7 +40,7 @@ import { installSettingsLocale } from './locales'import { installSettingsSections } from './register/sections'import { registerSettingsSidebar } from './register/sidebar'import { registerSettingsTrigger } from './register/trigger'-import { mountSettingsStyles } from './styles'+import { mountSettingsStyles, mountTurnNavigationStyles } from './styles'/** 插件显示名(诊断元数据)。 */export const name = SETTINGS_UI_PLUGIN@@ -79,6 +79,13 @@ export function apply(ctx: ClientContext): void {() => mountSettingsStyles(),'dsh-tauri-ui: settings styles',)+ // The core turn rail is rendered inside a clipped conversation column. Keep+ // its semantic nav visible in the 56px sidebar rail by patching only the+ // stable bilingual aria label; core-owned children and scrolling stay intact.+ ctx.effect(+ () => mountTurnNavigationStyles(),+ 'dsh-tauri-ui: turn navigation styles',+ )installSettingsLocale(ctx)// 设置分区投影:引用清理也走 effect(插件卸载后 slotsRef 复位,避免跨实例残留)。ctx.effect(diff --git a/packages/dsh-tauri-ui/src/client/styles/index.ts b/packages/dsh-tauri-ui/src/client/styles/index.tsindex 53de0a81..08675cdb 100644--- a/packages/dsh-tauri-ui/src/client/styles/index.ts+++ b/packages/dsh-tauri-ui/src/client/styles/index.ts@@ -1,6 +1,10 @@/** Settings UI styles generated as css-render nodes. */import { CssRender } from 'dsh-tauri/client'-import { SETTINGS_STYLE_ID } from '../constants'+import {+ SETTINGS_STYLE_ID,+ TURN_NAVIGATION_NARROW_SELECTOR,+ TURN_NAVIGATION_STYLE_ID,+} from '../constants'const cssr = CssRender()const { c } = cssr@@ -174,6 +178,26 @@ const settingsStyle = c([}),])+const turnNavigationStyle = c([+ // The core rail is inside the conversation column. That column is clipped,+ // and the core height can resolve to 0 when the available composer band is+ // tight. Only apply the viewport anchor while the shell reports a collapsed+ // sidebar; the core's inner scroller and mark geometry remain untouched.+ c(TURN_NAVIGATION_NARROW_SELECTOR, {+ position: 'fixed',+ top: 'max(32px, calc((100dvh - var(--dsh-composer-height, 152px)) / 2))',+ right: 'max(8px, env(safe-area-inset-right, 0px))',+ zIndex: 30,+ width: '28px',+ height: 'min(var(--turn-natural-height, 32px), max(32px, calc(100dvh - var(--dsh-composer-height, 152px) - 32px)), 420px)',+ maxHeight: 'calc(100dvh - 32px)',+ minHeight: '32px',+ visibility: 'visible',+ opacity: 1,+ transform: 'translateY(-50%)',+ }),+])+export function mountSettingsStyles(): () => void {if (typeof document === 'undefined')return () => {}@@ -182,3 +206,12 @@ export function mountSettingsStyles(): () => void {settingsStyle.mount({ id: SETTINGS_STYLE_ID, head: true })return () => settingsStyle.unmount({ id: SETTINGS_STYLE_ID })}++export function mountTurnNavigationStyles(): () => void {+ if (typeof document === 'undefined')+ return () => {}+ if (cssr.find(TURN_NAVIGATION_STYLE_ID) !== null)+ return () => {}+ turnNavigationStyle.mount({ id: TURN_NAVIGATION_STYLE_ID, head: true })+ return () => turnNavigationStyle.unmount({ id: TURN_NAVIGATION_STYLE_ID })+}