DSH (DeepSeek Harness) has an interaction pain point when handling approval cards: when a card (@deepseek-ai/dsh-client-ui-approval) appears, the browser hides the original input field (display:none), causing focus to be lost. By default, the Enter and Esc keys only work when focus is inside the card. This means users must first manually click the card text before using keyboard shortcuts. dsh-approval-autofocus fixes this gap.
What Is This¶
This is a client plugin for DeepSeek Harness, maintained by chupeter854-lang. It monitors the DOM, and when it detects that an approval card has appeared and the current focus is idle (such as on <body> or a hidden composer), it automatically moves focus into the card’s details area. This allows users to operate directly with keyboard shortcuts.
Core Features¶
- Automatic focus: When a card appears and no other element is holding focus, it automatically moves focus into the details area.
- Keyboard bindings:
Entertriggers approval, andEsctriggers rejection. - Focus protection: It does not interfere with focus inside terminals, dialogs, or input fields.
- Compatibility fallback: It maintains compatibility using the
data-approval-scrollattribute and a[tabindex="0"]selector, while excluding buttons.
Installation and Activation¶
1. Install from an Archive (Recommended)¶
- Extract the plugin folder to a fixed directory, for example
~/plugins/dsh-approval-autofocus. - In the DSH sidebar, click Plugins -> Add plugin.
- Paste the folder’s absolute path.
- Click Enable now. If the page prompts you, restart DSH.
2. From a Git Repository¶
Paste the repository URL in the add-plugin dialog. There is currently no hosted repository; the archive is the final form.
3. Manual Configuration¶
Edit ~/.dsh/profiles/<profile>/package.json and add the package name to dsh.profile.bundles; or insert a configuration block into ~/.dsh/profiles/<profile>/cordis.patch.yml.
- insert:
- id: approval-autofocus
name: dsh-approval-autofocus
Typical Usage¶
- When an approval card appears, focus automatically moves into the card. Press
Enterdirectly to approve, or pressEscto reject. - When typing in a terminal or input field, the plugin does not steal focus.
Notes and Limitations¶
- Security note: The plugin only moves focus; it does not simulate key presses. However, if model output tries to lure you into pressing Enter, the pre-set focus inside the card may lead to accidental approval. When confirmation is needed, click somewhere away from the card or disable the plugin.
- Compatibility: Built against DSH 0.2.0-rc.2. If DSH reshapes the card structure, the plugin may fail silently.
- Unofficial: This is a community-maintained plugin, not an official DeepSeek component.
Conclusion¶
By managing focus automatically, this plugin makes the approval flow better aligned with keyboard-based workflows. See the GitHub repository for more details.