提交前确认 / Pre-submit checklist
运行环境 / Environment:DSH Web(浏览器访问)/ DSH Web (browser access)
DSH Web 版本 + 浏览器 / DSH Web version + Browser:DSH 0.1.1-rc.2 + Chrome 151.0.7922.174
插件版本 / Plugin version:v0.17.1
类别 / Category:🐛 Bug(功能异常 / Something is broken)
描述 / Description
现象:在 Files 文件窗口(文件树)中对文件右键,弹出上下文菜单;当菜单出现在屏幕右缘附近时(Files 面板位于窗口右侧,右键树中靠右的行尤其容易触发),把鼠标移到「在应用中打开 >」一行,弹出的二级子菜单整体超出视口右缘——子菜单始终从主菜单的右侧展开,条目(资源管理器 / VS Code / Cursor / Zed / 自定义编辑器)落在屏幕外,无法悬停、无法点击。主菜单本身会被正确钳制在视口内(距右缘 12px),只有二级菜单溢出。
期望行为:二级子菜单应做视口感知:贴近右缘时向左翻转展开(或整体钳制在视口内),保证条目可见可点。
复现步骤:
- DSH Web + dsh-better-sidebar v0.17.1
- 打开 Files 文件窗口(文件树),窗口位于屏幕右侧
- 对文件树中某一行的文件右键(行内容越靠右越容易复现)
- 鼠标移到「在应用中打开 >」项(或点击该项)
- 二级子菜单从主菜单右侧展开,超出屏幕右缘,条目不可见 / 不可点击
截图或日志:

补充信息 / Additional context
- 根因定位:问题出在 DSH 的
Menu 原语(@deepseek-ai/dsh-client-ui-primitives)——子菜单不支持视口感知的翻转/钳制,better-sidebar 只是消费者:
- 子菜单 CSS 固定向右展开:
Menu.module.css 的 .submenu { position: absolute; bottom: -4px; left: calc(100% + 10px); min-width: 163px; z-index: 101; }
- portal 定位只钳制主菜单、不计子菜单宽度、无翻转逻辑:
Menu.tsx 的 place() 里 x = Math.min(Math.max(x, MARGIN), vw - lw - MARGIN)(lw 为主列表宽度)
- 使用方:
src/client/FileTree.tsx 的 openWithEntries() 生成「在应用中打开 >」子菜单行,经 <Menu portal getAnchorRect={右键坐标}> 渲染到 document.body(position: fixed,不会被祖先裁剪,但超出视口即无法点击)
- 相关但不重复:
English TL;DR
The "Open with >" submenu in the file-tree right-click menu always opens to the right of its parent row. When the context menu sits near the viewport's right edge (the Files panel is on the right side of the window), the submenu extends off-screen and its items cannot be hovered or clicked. Root cause is in the DSH Menu primitive (dsh-client-ui-primitives): no viewport-aware submenu flip/clamp (.submenu { left: calc(100% + 10px) }, and the portal place() clamps only the main list). Related but distinct: #412 (open-with no reaction), #334 (the feature PR).
提交前确认 / Pre-submit checklist
运行环境 / Environment:DSH Web(浏览器访问)/ DSH Web (browser access)
DSH Web 版本 + 浏览器 / DSH Web version + Browser:DSH 0.1.1-rc.2 + Chrome 151.0.7922.174
插件版本 / Plugin version:v0.17.1
类别 / Category:🐛 Bug(功能异常 / Something is broken)
描述 / Description
现象:在 Files 文件窗口(文件树)中对文件右键,弹出上下文菜单;当菜单出现在屏幕右缘附近时(Files 面板位于窗口右侧,右键树中靠右的行尤其容易触发),把鼠标移到「在应用中打开 >」一行,弹出的二级子菜单整体超出视口右缘——子菜单始终从主菜单的右侧展开,条目(资源管理器 / VS Code / Cursor / Zed / 自定义编辑器)落在屏幕外,无法悬停、无法点击。主菜单本身会被正确钳制在视口内(距右缘 12px),只有二级菜单溢出。
期望行为:二级子菜单应做视口感知:贴近右缘时向左翻转展开(或整体钳制在视口内),保证条目可见可点。
复现步骤:
截图或日志:

补充信息 / Additional context
Menu原语(@deepseek-ai/dsh-client-ui-primitives)——子菜单不支持视口感知的翻转/钳制,better-sidebar 只是消费者:Menu.module.css的.submenu { position: absolute; bottom: -4px; left: calc(100% + 10px); min-width: 163px; z-index: 101; }Menu.tsx的place()里x = Math.min(Math.max(x, MARGIN), vw - lw - MARGIN)(lw为主列表宽度)src/client/FileTree.tsx的openWithEntries()生成「在应用中打开 >」子菜单行,经<Menu portal getAnchorRect={右键坐标}>渲染到document.body(position: fixed,不会被祖先裁剪,但超出视口即无法点击)open.external路径问题),未提及子菜单溢出English TL;DR
The "Open with >" submenu in the file-tree right-click menu always opens to the right of its parent row. When the context menu sits near the viewport's right edge (the Files panel is on the right side of the window), the submenu extends off-screen and its items cannot be hovered or clicked. Root cause is in the DSH
Menuprimitive (dsh-client-ui-primitives): no viewport-aware submenu flip/clamp (.submenu { left: calc(100% + 10px) }, and the portalplace()clamps only the main list). Related but distinct: #412 (open-with no reaction), #334 (the feature PR).