Window-like controls for every Web UI modal: drag by title bar, eight-way resize, pin against outside clicks, maximize to the full viewport, removable backdrop blur, and per-dialog persistent state.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:lisniuse/dsh-modal-enhancer
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
简体中文 · 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
Escapecontinue 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:
data-dshme-state-key, when a dialog provides an explicit key;aria-label;- text referenced by
aria-labelledby; - 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:
- injects scoped
.dshme-*styles through the Clientstylesbuiltin; - observes
document.bodyand enhances dialogs as React mounts them; - preserves horizontal host layouts such as the Settings navigation/content panel without reparenting React-owned nodes;
- registers the master switch in the
settings.general.itemslot; - 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, andstyles, plus standard browser APIs. - Settings slot:
settings.general.item(scope: root,kind: list). - Persistence: browser
localStorage; no state is sent to a server.
License
Links
More in this category
zhu1090093659/dsh-web-ui#packages/dsh-web-ui-all★ 2622
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 1231
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 1198
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-at-file★ 214
Codex-style `@file` mentions: search workspace files in the composer and attach their contents to prompts.
huiliyi37/dsh-tianshu-tui★ 159
A terminal UI (TUI) for DeepSeek Harness.
Nagi-ovo/dsh-visualize★ 114
In-conversation generative UI: the model renders interactive HTML cards into the chat stream, with streaming preview and sandboxed rendering.