🎁 福利专区全网大模型免费应用 + 新用户福利 + 注册活动入口,低成本玩转 AI

顶部拖动条穿透 Mo3ter/dsh-top-drag

DeepSeek Harness
Mo3ter42 天前有提交已提供中文文档扫描:未发现敏感能力

让窗口顶部既能拖动又不挡下方按钮点击

28/100
综合分
0
GitHub 星标
—
npm 周下载
—/5
用户评分

数据截至 2026/10/11 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。

安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add Mo3ter/dsh-top-drag
该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)

状态速览

判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态
信任档位:待复验
是什么
dsh 原生插件 · desktop
装得上吗
曾在 dsh 0.2.0-rc.2 下真实安装成功,但当前 dsh 已更新至 0.2.1-rc.5,本站尚未在新版下复验
L4 · 真实安装等级说明 →
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
更新放缓:最近一次提交在 42 天前
档位由哪些信号合成

本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。

验证判据与等级说明 →
社区实装还没有人打卡 · 装过的第一个就是你
安全扫描自动 · 静态分析源码
v2.7.0
🟢 扫描:未发现敏感能力尚无人工评估
展开查看扫描说明与证据 ↓

静态扫描未发现敏感能力:最多只发网络请求、读取自身元数据或只读文件,未发现执行命令、文件写入或敏感信息读取。

扫描于 2026/11/3(1 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库

静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。

给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个

功能亮点

  • 顶部拖动窗口
  • 点击穿透下方按钮

README

由 DeepSeek 最新模型翻译生成
dsh-top-drag DSH Desktop 客户端插件(仅 Windows):窗口顶部既能拖动、又不挡点击。 DSH Desktop client plugin (Windows only): keep the top of the window draggable and clickable at once. 这是 DSH Desktop 客户端专用插件 —— 它针对的是桌面端 preload 注入的那条窗口拖动条。 在 DSH Web / 命令行环境里它什么都不做(脚本会先判断平台,然后保持惰性)。 This is a DSH Desktop client plugin: it targets the drag overlay the desktop preload injects. In DSH Web or a CLI harness it stays inert. 中文说明 它修什么问题 DSH Desktop 在 Windows 下是自绘标题栏:窗口顶部 36 像素是一条窗口拖动条,而程序自己的顶部内容(会话标题行、子代理按钮、插件自己画在顶部的工具栏)就压在这条上。
展开完整文档(README 剩余 1 节)
dsh-top-drag

DSH Desktop 客户端插件(仅 Windows):窗口顶部既能拖动、又不挡点击。

DSH Desktop client plugin (Windows only): keep the top of the window draggable and clickable at once.

这是 DSH Desktop 客户端专用插件 —— 它针对的是桌面端 preload 注入的那条窗口拖动条。
在 DSH Web / 命令行环境里它什么都不做(脚本会先判断平台,然后保持惰性)。

This is a DSH Desktop client plugin: it targets the drag overlay the desktop
preload injects. In DSH Web or a CLI harness it stays inert.

中文说明

它修什么问题

DSH Desktop 在 Windows 下是自绘标题栏:窗口顶部 36 像素是一条窗口拖动条,而程序自己的顶部内容(会话标题行、子代理按钮、插件自己画在顶部的工具栏)就压在这条上。拖动条永远是最上层元素,点击先被它吃掉,所以:

- 窗口最上方一片点不到
- 会话标题 / 面包屑、子代理按钮点不到
- 插件(例如记忆系统)在顶部画自己的界面时,按钮同样点不到
- 给这些按钮加 -webkit-app-region: no-drag 也没用 —— 上面还盖着一层

它怎么做

把顶部这一条切成 16 个小格子,每格只看自己那一条竖条:

- 那条里有可点元素(按钮、链接、输入框,以及带 role / tabindex / aria-label 的元素)→ 这一格让位,只留到元素上边缘(点击优先)
- 那条里什么都没有 → 保留整条 36px(拖动优先)

app 的布局一个字都不改,插件也不需要任何配合;以后新装的插件在顶部画界面一样会被自动避让。弹出对话框时整条让位。

开销

按需测量,不轮询:鼠标进入顶部 44px 内、切换主面板、缩放窗口、手动触发 dsh-top-band-rescan 事件,外加 10 秒一次兜底。一次测量约 4 毫秒(一次元素查询 + 纯几何计算)。桌面端原有的蒙层保留作兜底,只有测量带成功跑起来才会隐藏它。

安装

- 插件市场(收录后)一键安装
- 从 GitHub:dsh plugin add github:Mo3ter/dsh-top-drag

调参:lib/index.js 顶部的 COLUMNS / STRIP / SELECTOR / MIN_GAP_MS / SAFETY_TICK_MS。

On Windows, DSH Desktop draws its own title bar: the window's top 36 px is a
window-drag overlay and the session header sits underneath it. The overlay wins
the hit test, so anything the app — or any plugin — draws there (session breadcrumbs, the subagent chip, a plugin's own toolbar) cannot be clicked. This plugin replaces the single overlay with a small measuring band: it yields exactly where UI needs clicks and keeps dragging everywhere else.

Windows only. On any other platform the plugin stays inert.

The problem it fixes

The desktop preload injects

#dsh-desktop-windows-drag-region
position: fixed; top: 0; left: 0; right: calc(caption + 44px)
height: 36px; -webkit-app-region: drag; z-index: 10

and pulls the app's own top content up into that strip (padding-top: 6px on
the sidebar root and the conversation header), so the session header's title row
starts at y = 6 — under the overlay. -webkit-app-region: no-drag on the buttons does not help: the overlay is the topmost element and wins the hit test. The same happens to any plugin that paints a toolbar or panel at the top of the window.

Narrowing the overlay fixes the clicks but makes the window impossible to grab;
shaping it into a fixed handle turns that handle into a click dead zone. Both
are the same mistake — drag area and content sharing one set of pixels.

How it works

1. The layout is left exactly as shipped. No padding is added or removed.
2. The band is split into 16 cells. Each cell looks at its own vertical
slice of the top of the window:
* something clickable in the slice → the cell collapses to just above it
(clicks win),
* nothing there → the cell keeps the full strip (drag wins).
3. 预加载脚本自带的覆盖层仍作为兜底,只有当顶部条报告就绪后才隐藏,因此脚本一旦损坏,会退回到随包发布的行为,而不会丢掉窗口拖动。

「可点击的东西」按真实几何来测量:对 button, a[href], input, select, textarea, summary, label, [role], [tabindex], [aria-label], [contenteditable], [data-dsh-no-drag] 做一次 querySelectorAll,再为每个候选元素取一个 rect。插件无需主动接入,也不涉及任何按界面打的补丁。

开销

测量需要几何信息,所以只在需要时进行——不做任何轮询:

| 触发条件 | 原因 |
| 指针进入顶部 44 px 以内 | 在点击或拖动落下之前,答案已经刷新 |
| 主面板切换 | 插件页面通常自带顶栏 |
| 窗口缩放 | 列的位置会变 |
| window.dispatchEvent(new Event('dsh-top-band-rescan')) | 手动触发,任何按钮或脚本都可以 |
| 每 10 s 一次安全轮询 | 捕捉那些没有指针移动来宣告的变化 |

在长时间运行的会话里,扫描 385 个候选元素约耗时 4 ms(一次查询约 1.5 ms,取 rect 约 2.4 ms)。最初试过逐点做命中测试,代价是每点 245 µs——每次扫描约 37 ms——所以顶部条改为测量 rect,也正因如此才刻意不用 MutationObserver(它在聊天流式输出期间会不断触发)。

安装

* 通过 DSH 插件市场,上架之后即可。
* 从 GitHub:dsh plugin add github:Mo3ter/dsh-top-drag
* 从 npm:dsh plugin add dsh-top-drag
* 从本地检出目录:dsh plugin add file:./dsh-top-drag

宿主层插件需要重启 Harness;DSH Desktop 应用会在下次启动时加载它。

配置

所有配置都在 lib/index.js 顶部:

| 常量 | 含义 |
| COLUMNS | 顶部条的格子数(16) |
| STRIP | 顶部条高度,单位 px(36) |
| PILL_ | 中间列空闲时绘制的小号居中提示手柄 |
| MIN_GAP_MS | 两次扫描之间的最小间隔(700) |
| SAFETY_TICK_MS | 安全轮询间隔(10000) |

注意事项

仅支持 Windows,且针对的是桌面预加载脚本自己的覆盖层 id 和 dsh-desktop-windows-titlebar-layout 这个 body class。如果未来的 DSH Desktop 版本改动了其中任何一个,插件只会静默失效,而不会弄坏任何东西——它不添加内边距,也不隐藏任何它没有测量过的元素。
* 对话框(dialog[open]、[role=dialog]、[aria-modal=true])会压制整条顶部条,所以模态框始终能保住每一次点击。
* 它不添加遥测、不访问网络、也没有客户端 bundle:整个插件就是一个宿主文件,通过 webserver/index-inject 向所服务的 index.html 注入一行 和一行 。

卸载

dsh plugin remove dsh-top-drag,或者从配置档的 cordis.patch.yml 里删掉那一行。配置档之外不会写入任何东西。

许可证

MIT
预览分享卡片长什么样 ↓Mo3ter/dsh-top-drag
分享 · DeepSeek Harness Hub
Mo3ter/dsh-top-drag

让窗口顶部既能拖动又不挡下方按钮点击

这是你的仓库?认领条目

回到顶部