From 5be195df1876ce5bab91c626c1de77a51fe5aee5 Mon Sep 17 00:00:00 2001 From: laoyh Date: Thu, 20 Aug 2026 12:13:49 +0800 Subject: [PATCH] fix(mobile): make unavailable sidebar state clear --- README.md | 6 +++++- README_EN.md | 6 +++++- dsh.plugin.json | 2 +- package.json | 2 +- src/client/Sidebar.tsx | 6 ++++-- src/client/service.ts | 2 +- src/client/sidebar.module.css | 6 ++++-- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a12ae4f..11a33d2 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,10 @@ 添加插件截图 +### v0.14.1 + +- 📱 **手机无会话提示**:没有选中会话时,弱化的侧边栏开关保持不可执行,但可通过点按或键盘聚焦显示“选择一个会话以使用侧边栏”;选中会话后,同一开关打开全宽移动抽屉;抽屉宽度包含边框,不再产生 1px 横向溢出。 + ### v0.14.0 > ⚠️ **本版适配 DSH 0.1.0-rc.8**:全部 `@deepseek-ai/*` peer / devDependencies 升至 `^0.1.0-rc.8`(含传递依赖,lockfile 零 rc.7 残留),`cordis` 同步 `^4.0.0-rc.8`,CI 挂载冒烟钉版 `@deepseek-ai/dsh@0.1.0-rc.8`。**rc.7 及更早的 DSH 环境将无法解析本版依赖,请先升级 DSH**。自 v0.13.1 以来的全部更改: @@ -240,7 +244,7 @@ pnpm watch # tsdown --watch - Office 三件套预览(.docx/.xlsx/.pptx)已移至「推荐插件」(Office 预览插件,见设置页「添加插件」弹窗);未安装时此类文件走代码/下载查看兜底 - 浏览器沙箱无登录态/第三方 Cookie 受限,部分站点登录需走弹窗;被 `X-Frame-Options`/`frame-ancestors` 拒绝嵌入的站点(如 arxiv.org)显示原因面板(含「在浏览器中打开」);iframe 内部跳转不进后退栈 - HTML 预览渲染的是已保存文件(不反映未保存草稿) -- 移动端(<768px)无底部面板:进入窄屏时其标签页一次性并入右侧栏(迁移后回桌面仍保留在右侧栏),桌面端的底部面板只在宽视口下可用;移动端底部首展自动开终端不触发 +- 移动端(<768px)无底部面板:进入窄屏时其标签页一次性并入右侧栏(迁移后回桌面仍保留在右侧栏),桌面端的底部面板只在宽视口下可用;移动端底部首展自动开终端不触发。未选中会话时,点按弱化开关会显示选择会话提示;选中会话后开关打开全宽抽屉 ## 🖥️ 平台支持 diff --git a/README_EN.md b/README_EN.md index dbfd797..c406edc 100644 --- a/README_EN.md +++ b/README_EN.md @@ -41,6 +41,10 @@ Add Plugins screenshot +### v0.14.1 + +- 📱 **No-session feedback on phones**: without a selected session, the subdued sidebar toggle remains unavailable but shows “Select a conversation to use the sidebar” on tap or keyboard focus; after selecting a session, the same toggle opens the full-width mobile drawer, whose border-inclusive width no longer introduces one pixel of horizontal overflow. + ### v0.14.0 > ⚠️ **This release adapts to DSH 0.1.0-rc.8**: every `@deepseek-ai/*` peer/devDependency is raised to `^0.1.0-rc.8` (transitives included — zero rc.7 leftovers in the lockfile), `cordis` to `^4.0.0-rc.8`, and the CI mount lane pins `@deepseek-ai/dsh@0.1.0-rc.8`. **DSH environments on rc.7 or earlier can no longer resolve this release's dependencies — upgrade DSH first.** All changes since v0.13.1: @@ -271,7 +275,7 @@ pnpm watch # tsdown --watch - Office-suite preview (.docx/.xlsx/.pptx) moved to the recommended office plugin (see the "Add plugins" modals in settings); without it these files fall through to the code/download fallbacks - Browser sandbox has no login state / third-party cookies are restricted; some sites need popup login; sites that refuse embedding via `X-Frame-Options`/`frame-ancestors` (e.g. arxiv.org) show a reason panel (with "Open in browser"); in-iframe navigation does not enter the back stack - HTML preview renders the saved file (not unsaved drafts) -- No bottom panel on mobile (<768px): on narrow screens its tabs merge into the right sidebar once (after migrating back to desktop they stay in the right sidebar); the desktop bottom panel is only available on wide viewports; auto-open terminal on first bottom-panel expand does not trigger on mobile +- No bottom panel on mobile (<768px): on narrow screens its tabs merge into the right sidebar once (after migrating back to desktop they stay in the right sidebar); the desktop bottom panel is only available on wide viewports; auto-open terminal on first bottom-panel expand does not trigger on mobile. Without a selected session, tapping the subdued toggle shows the select-session message; with a selected session, it opens the full-width drawer ## 🖥️ Platform Support diff --git a/dsh.plugin.json b/dsh.plugin.json index fe47d4d..64f366b 100644 --- a/dsh.plugin.json +++ b/dsh.plugin.json @@ -1,6 +1,6 @@ { "id": "dsh-external/dsh-better-sidebar", - "version": "0.14.0", + "version": "0.14.1", "main": "./lib/index.js", "description": "VSCode 风格右侧侧边栏:文件资源管理器 / 编辑器 / 终端 / Git / 浏览器,按会话隔离。暴露服务供其他插件注册侧边栏页面和文件预览器", "engines": { diff --git a/package.json b/package.json index c372819..a461367 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-better-sidebar", - "version": "0.14.0", + "version": "0.14.1", "description": "DSH web plugin: a VSCode-like right sidebar (explorer / editor / terminal / git / browser), isolated per conversation session. Exposes a service for other plugins to register sidebar tabs and file viewers.", "type": "module", "repository": { diff --git a/src/client/Sidebar.tsx b/src/client/Sidebar.tsx index 887e3a3..546e282 100644 --- a/src/client/Sidebar.tsx +++ b/src/client/Sidebar.tsx @@ -789,18 +789,20 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) { }, [ctx, sessionId, cwd]) if (state === undefined || sessionId === undefined) { + // Keep the unavailable controls focusable: touch users have no hover, so + // focus is the only way the existing Tooltip can explain what is missing. return (
{!narrow && ( - )} - diff --git a/src/client/service.ts b/src/client/service.ts index 13f1934..d932977 100644 --- a/src/client/service.ts +++ b/src/client/service.ts @@ -470,7 +470,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes * The plugin version this service instance reports. Keep in lockstep with * `package.json`'s version — `tests/service.spec.ts` asserts the pair. */ -export const SIDEBAR_SERVICE_VERSION = '0.14.0' +export const SIDEBAR_SERVICE_VERSION = '0.14.1' /** * Monotonic capability list consumers use to gate new API usage (features diff --git a/src/client/sidebar.module.css b/src/client/sidebar.module.css index e53c109..70bd940 100644 --- a/src/client/sidebar.module.css +++ b/src/client/sidebar.module.css @@ -91,17 +91,19 @@ color var(--ds-transition-duration-slow) var(--ds-ease-in-out); } -.toggleButton:hover:not(:disabled) { +.toggleButton:hover:not(:disabled):not([aria-disabled='true']) { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); } -.toggleButton:disabled { +.toggleButton:disabled, +.toggleButton[aria-disabled='true'] { opacity: 0.4; cursor: default; } .panel { + box-sizing: border-box; position: absolute; top: 0; right: 0;