Skip to content

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

fix(mobile): 隐藏工具行的「查看」入口,避免进入轨迹页后无法返回会话 (#1200)

Hairy9f1f396180b5
diff --git a/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.test.ts b/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.test.ts
index 24db0e89..34595ca5 100644
--- a/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.test.ts
+++ b/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.test.ts
@@ -237,6 +237,18 @@ describe('mobile conversation layout', () => {
expect(rules).toHaveLength(1)
})
+ it('hides the tool-row inspect pill whose trajectory view has no way back on phones', () => {
+ expect(declarations('[class$="_inspectButton"]')).toEqual({ display: 'none !important' })
+ const rules: unknown[] = []
+ root.walkRules('[class$="_inspectButton"]', (rule) => {
+ rules.push(rule)
+ expect(rule.parent?.type).toBe('atrule')
+ if (rule.parent?.type === 'atrule')
+ expect(rule.parent.params).toBe(MOBILE_MEDIA)
+ })
+ expect(rules).toHaveLength(1)
+ })
+
it('overrides conversation scroll bottom padding to zero inside the mobile media query', () => {
const declarations: unknown[] = []
root.walkRules('[data-slot="main"] [data-conversation-scroll]', (rule) => {
diff --git a/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.ts b/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.ts
index deb4b1e9..d349fb42 100644
--- a/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.ts
+++ b/packages/dsh-tauri-mobile-ui/src/client/styles/mobile.cssr.ts
@@ -48,6 +48,11 @@ export default c([c(`@media ${MOBILE_MEDIA_QUERIES.join(' and ')}`, [
c('[data-slot="conversation.header"] [class$="_header"]', {
display: 'none !important',
}),
+ // 会话头连同视图切换环一起隐藏后,工具行的「查看」只能进轨迹页、回不了会话;它靠 hover 显形,
+ // 触屏点过就常驻,因此在移动布局里整个去掉入口。
+ c('[class$="_inspectButton"]', {
+ display: 'none !important',
+ }),
// 第三方插件(dsh-better-sidebar)的空白会话兜底入口 `[data-dsh-dock-fallback]` 是
// `position: fixed` 的:它按宿主会话头里「右侧栏角落控件」的 rect 对齐,而手机版顶栏已经
// 把那个会话头一并隐藏,锚点 rect 退化成 0×0 之后它会一路退到视口左上角(top/left 各 4px),
diff --git a/test/e2e/plugins/mobile-touch-desktop.e2e.ts b/test/e2e/plugins/mobile-touch-desktop.e2e.ts
index a3cf0f6d..9415e895 100644
--- a/test/e2e/plugins/mobile-touch-desktop.e2e.ts
+++ b/test/e2e/plugins/mobile-touch-desktop.e2e.ts
@@ -17,6 +17,9 @@ const MARKUP = `<!doctype html><html data-dsh-mobile-ui><body>
<div data-slot="conversation.composer.bar"><div class="wSkVaW_dock">Queued messages</div></div>
<div class="wSkVaW_composerStack"><div data-slot="conversation.input.dock"><div class="wSkVaW_dock">Steer panel</div></div></div>
</body></html>`
+const INSPECT_MARKUP = `<!doctype html><html data-dsh-mobile-ui><body>
+ <button type="button" class="wSkVaW_inspectButton">查看</button>
+</body></html>`
let browser: Browser
beforeAll(async () => {
@@ -41,6 +44,18 @@ async function layout(viewport: { width: number, height: number }) {
}
}
+async function inspectDisplay(viewport: { width: number, height: number }) {
+ const page = await browser.newPage({ isMobile: true, hasTouch: true, viewport })
+ try {
+ await page.setContent(INSPECT_MARKUP)
+ await page.addStyleTag({ content: mobileStyle.render() })
+ return await page.locator('[class$="_inspectButton"]').evaluate(element => getComputedStyle(element).display)
+ }
+ finally {
+ await page.close()
+ }
+}
+
describe('mobile layout on touch devices', () => {
it('keeps the session header, queue dock and steer dock on a touchscreen desktop window', async () => {
const { matches, displays } = await layout({ width: 1280, height: 720 })
@@ -60,4 +75,9 @@ describe('mobile layout on touch devices', () => {
expect((await layout({ width: 1024, height: 720 })).matches, '1024px 与官方布局同门槛,交还桌面').toBe(false)
expect((await layout({ width: 1023, height: 720 })).matches, '1023px 仍是移动布局').toBe(true)
})
+
+ it('hides the tool-row inspect pill only on a phone viewport', async () => {
+ expect(await inspectDisplay({ width: 1280, height: 720 }), '触屏桌面窗口保留官方「查看」').not.toBe('none')
+ expect(await inspectDisplay({ width: 390, height: 844 }), '手机进得了轨迹页却回不了会话,入口必须隐藏').toBe('none')
+ })
})