dshbase

插件目录 / Knowledge / dsh-modal-enhancer

dsh-modal-enhancer

已验证 · 实测可装 lisniuse

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
—语言
2026-08-15最近推送
跨平台平台

功能简介

Enhance every DeepSeek Harness web modal: draggable title bar, resizable edges, maximize, and removable backdrop blur, with a General-settings toggle.

✅
我们的评价
可用 — 实测通过,早期项目

Enhance every DeepSeek Harness web modal: draggable title bar, resizable edges, maximize, and removable backdrop blur, with a General-settings toggle. 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-modal-enhancer

简体中文 · English

A client-side Cordis plugin that gives every DeepSeek Harness Web GUI modal
window-like controls without changing the Harness source code.

Features

  • Drag — move a dialog by its dedicated top strip.
  • Eight-way resize — resize from all four edges and four corners.
  • Pin / unpin — a pinned dialog ignores clicks outside the window; its close
    button and Escape continue to work.
  • Maximize / restore — fill the viewport with a small outer margin, then
    return to the previous rectangle.
  • Remove backdrop — remove both the dim mask and backdrop blur. The dialog
    receives a light shadow so it remains visually separated from the page.
  • Per-dialog persistence — position, width, height, maximized state, pinned
    state, and backdrop state survive modal remounts and browser restarts.
  • Master switch — enable or disable the enhancer from
    Settings → General → 弹窗增强.

The plugin discovers dialogs through the stable accessibility contract
[role="dialog"][aria-modal="true"]; it does not depend on CSS-module hashes.
This covers Settings, workspace creation, model and agent-preset editors, risk
confirmations, and other Harness dialogs that use the same contract.

Controls

Control Result
Top drag strip Move the dialog
Four edges Change width or height
Four corners Change width and height together
Pushpin Toggle outside-click dismissal
⛶ / ❐ Maximize / restore
◐ / ◌ Remove / restore the visual mask and blur

Resize hit areas extend slightly across the dialog boundary for easier pointer
targeting. While maximized, drag and resize are disabled until the dialog is
restored.

State persistence

Each dialog is identified by the first available value below:

  1. data-dshme-state-key, when a dialog provides an explicit key;
  2. aria-label;
  3. text referenced by aria-labelledby;
  4. the first heading inside the dialog.

State is stored in localStorage under the dshme.dialog-state.v1: prefix.
When restoring geometry on a different display or viewport size, the plugin
clamps the rectangle so that at least part of the dialog remains reachable.

Disabling or unloading the plugin removes injected controls, classes, event
listeners, and inline geometry from mounted dialogs. Saved state remains
available for the next time the enhancer is enabled.

Installation

Git install (recommended, like other dsh plugins)

Install as a dual-plane bundle directly from GitHub:

dsh plugin --profile web add github:lisniuse/dsh-modal-enhancer

The package declares dsh.bundle.patch (mounts cordis.patch.yml) and
dsh.client (platform web), so dsh plugin add reconciles it into the
profile's layer stack automatically. It is pure JavaScript with no build step —
the host half (index.js, a no-op) and the browser half (client.js) load
directly. Restart dsh web after installation.

Dynamic plugin (single-file body)

The complete single-file form is dist/plugin.js. Pass its
entire contents as the code.client body of a dynamic cordis_define plugin.
It is a plain JavaScript function body beginning with return { ... }.

No Harness source modification, pnpm install, Web app rebuild, or server
restart is required. See docs/install.md for the detailed
dynamic-plugin and agent-preset workflows.

After activation, approve the Client Package request if the Harness UI asks for
permission, then open any modal to verify that the toolbar and resize cursors
appear.

How it works

The plugin:

  1. injects scoped .dshme-* styles through the Client styles builtin;
  2. observes document.body and enhances dialogs as React mounts them;
  3. preserves horizontal host layouts such as the Settings navigation/content
    panel without reparenting React-owned nodes;
  4. registers the master switch in the settings.general.item slot;
  5. restores saved state independently for each identified dialog.

The transparent mask remains interactive when its visual backdrop is removed,
so modal behavior and accidental-click protection are preserved.

Project structure

index.js                        Dual-plane host half (no-op; mounts the bundle)
client.js                       Dual-plane browser half (window.__ModuleLoader__)
cordis.patch.yml                Bundle patch layer (inserts the plugin row)
dist/plugin.js                  Generated, single-file (dynamic) plugin body
src/plugin-body.js              Canonical self-contained source
src/enhancer.js                 Readable modular runtime reference
src/settings.js                 Readable settings-row reference
src/styles.css                  Readable stylesheet reference
scripts/build.js                Generates dist/plugin.js
scripts/layout-check.test.js    Layout, resize, pin, and persistence regression
scripts/syntax-check.js         JavaScript syntax smoke gate
docs/install.md                 Detailed installation guide
README.zh.md                    Simplified Chinese documentation

Development

Requires Node.js 18 or newer.

npm run build        # regenerate dist/plugin.js
npm test             # run layout and interaction regressions
npm run test:syntax  # parse every source and generated JS file

Before distributing a change, run all three commands and ensure
dist/plugin.js is committed with its source.

Compatibility

  • Target: DeepSeek Harness web client (platform: 'web').
  • Client capabilities: ctx, React, and styles, plus standard browser APIs.
  • Settings slot: settings.general.item (scope: root, kind: list).
  • Persistence: browser localStorage; no state is sent to a server.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-modal-enhancer」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:lisniuse/dsh-modal-enhancer

Headless(CLI)profile:

dsh plugin --profile headless add github:lisniuse/dsh-modal-enhancer

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Knowledge 里更多

浏览全部 7819 个插件 →