DeepSHPlugins
dsh-approval-hotkeys 项目预览
GITHUB / COMMUNITY PROJECT

dsh-approval-hotkeys

UI 增强TypeScriptMIT

Web UI 面板快捷键:在审批、提问、计划审查等交互面板上,Enter 触发确认操作、Esc 触发取消操作。

3 StarsSiriLee 更新时间 2026-09-10
访问 GitHub 仓库
dsh-approval-hotkeys 项目预览
dsh-approval-hotkeys 界面截图dsh-approval-hotkeys 界面截图dsh-approval-hotkeys 界面截图

项目介绍

中文

Web UI 面板快捷键:在审批、提问、计划审查等交互面板上,Enter 触发确认操作、Esc 触发取消操作。

English

Panel hotkeys for the web UI: Enter presses the confirm action and Esc presses the cancel action on every interaction panel (approval, question, plan review).

项目信息与收录信号

快照 2026-09-11
作者 / 组织
SiriLee
仓库
SiriLee/dsh-approval-hotkeys
GitHub Stars
3
Forks
0
开发语言
TypeScript
许可证
MIT
最近推送
2026-09-10
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

60/ 100
维护活跃
100
文档与实用信息
85
生态关注度
17
安装便捷信号
100
项目声明信号
100

近 1 天仍在更新;README 含完整安装与使用说明;关注度尚低(3)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add dsh-approval-hotkeys

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-approval-hotkeys

npm version npm license

Approval-panel hotkeys for DeepSeek Harness, for every approval source — not just edits.

English | 中文

A deliberately minimal plugin with one generic rule: Enter always presses the confirm button (the primary, right-most action); Esc always presses the cancel button — on every button-bearing interaction panel the harness renders.

PanelEnter → confirmEsc → cancel
Approval ([data-approval-key])Allow onceReject
Question / choice ([data-question-key])Submit / NextDiscard the group
Plan review ([data-plan-review-key])ApproveDecline (or discuss)

The panel anchors are harness-generic, so the hotkeys work on every interaction the GUI shows — edit approvals, permission escalations, tool questions, plan reviews. This is the Claude Code habit: confirm with Enter, refuse with Esc.

Approval panel

Every approval — edits, permission escalations, anything routed through the ApprovalPanel. Enter presses *Allow once*, Esc presses *Reject*.

Approval panel — Enter: Allow once, Esc: Reject

Question / choice panel

Tool questions (ask_user_question). Enter presses *Submit / Next*, Esc presses *Discard the group*.

Question panel — Enter: Submit, Esc: Discard the group

Plan review panel

Enter presses *Approve*, Esc presses *Decline* (or *Discuss* when the panel has no decline action).

Plan review panel — Enter: Approve, Esc: Decline

Install

dsh plugin --profile web add dsh-approval-hotkeys

Restart dsh web — or, since this plugin is pure browser-side, just refresh the page when the host side did not change. No configuration, no settings page.

Supported harness versions: the whole 0.1 line from 0.1.0-rc.6 on, prereleases included — declared as an optional peer on @deepseek-ai/dsh-client-modules with the range ^0.1.0-rc.6 || ^0.1.1-0 || ^0.1.2-0 || ^0.1.3-0 || ^0.1.5-0 (see docs/release.md for why the || union is required).

For contributors: install from a local checkout or a pinned commit — dsh plugin --profile web add /path/to/dsh-approval-hotkeys or dsh plugin --profile web add github:SiriLee/dsh-approval-hotkeys#<sha>. A git install fails on first run until you add an allowBuilds key to the profile's pnpm-workspace.yaml (pnpm blocks git dependencies from running build scripts); after that it runs the plugin's prepare and installs it.

How it works

  • Enter → confirm: clicks the panel's primary button — the last button

of its action row ("Allow once", "Submit/Next", "Approve"). The harness's Button component has no stable data-variant attribute (variants are CSS-Modules hash classes), so the plugin anchors on the layout contract that the confirm action always renders last — which is exactly the primary-colored button.

  • Esc → cancel: clicks the panel's cancel button — Reject (first),

Discard (header), Decline (footer second-last, or Discuss when the panel has no decline action). Without a panel, Esc is left alone (no pause/stop binding — the GUI's own stop button and shortcuts own that).

Guards (what the plugin deliberately does NOT do)

  • Never while typing: keydown inside an input / textarea / select /

contentEditable (the composer owns Enter/Esc there — e.g. Shift+Enter newline, Esc dismisses suggestions).

  • Enter with focus on a button: left to the browser (it activates the

focused button natively) and to the panel itself (the question composer's options submit on Enter) — acting again would double-fire.

  • Never on chords or repeats: Ctrl/Meta/Alt+key combinations and

held-key repeats are left alone.

  • Esc with no panel: left alone — the plugin never stops or pauses the

agent; panels are the only surface it acts on.

Button resolution contract (data-hotkey="none")

Enter/Esc resolve their buttons by position (first / last / header-last / footer-last), not by a stable semantic attribute — the harness's Button component exposes no reliable data-role/data-variant, so position is the only stable signal available to a client plugin that does not own the panel DOM. That makes button order the single coupling point to the harness layout.

To keep that coupling safe when other plugins inject buttons into a panel (utility toggles, decorative controls), this plugin skips any button marked data-hotkey="none" when resolving the confirm/cancel action. Any plugin that adds a non-action button into an interaction panel should mark it:

<button data-hotkey="none">Collapse diff</button>

This is a cooperative, opt-out contract, not a hard guarantee. It reliably covers "a plugin inserts an extra non-action button ahead of the action row" (such as dsh-edit-approval's diff collapse toggle). It does not cover:

  • a plugin that injects a button without the marker (contract ignored), or
  • a plugin that reorders / inserts a genuinely actionable button among the

real confirm/cancel buttons (the semantics changed, not just a decoration added), or

  • a change to the harness's own panel layout.

Those cases need a stable semantic anchor in the harness panel DOM (e.g. data-role="confirm" / data-role="cancel") — a harness-repo change, not a client-plugin fix. File an issue / PR against deepseek-harness if it bites.

Design notes

  • Pure browser (client) plugin: the host half is a no-op stub. All behavior

is a single document keydown listener registered inside one ctx.effect, torn down on unload/HMR.

  • Relies on the stable ApprovalPanel DOM contract: reject renders first,

allow-once last, both disabled after an answer — so a double-answer is impossible and the button-order dependency is the only harness coupling.

  • The panel lookup prefers the current session's pending approval key and

falls back to the first panel in DOM order.

Development

npm install
npm run typecheck   # tsc --noEmit (host + client)
npm test            # vitest (jsdom unit tests for the dispatch logic)
npm run build       # esbuild: lib/index.js + lib/client.js + .d.ts
node scripts/verify-host.mjs

Release

The first publish is manual (npm publish --access public), then the GitHub Actions Trusted Publishing workflow takes over — push a v<semver> tag and CI publishes with provenance. Full steps: docs/release.md.

Security

Pure browser-side plugin: the host half is an empty stub, and all behavior is a document-level keydown listener that clicks existing panel buttons. No network requests, no file access, no credentials.

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目