dsh-re:Add title bar refresh to DeepSeek Harness Desktop Client

Introduction

When developing plugins or modifying the UI in DeepSeek Harness (DSH), you often need to verify whether UI changes take effect. In the browser form, you can refresh via the address bar or developer tools; the desktop version has no address bar and no “Refresh” entry in the menu, so the only option is to restart the entire application. Although conversations and workspaces reside in the host process, repeatedly restarting disrupts the development flow. Below we introduce the community plugin dsh-re (maintainer: lux09947-cmyk, category: client): it adds a “↻ Refresh” button to the right of “Edit” in the desktop title bar, reloading only the current page without restarting the application or dropping sessions.

What Is This

dsh-re is a pure host-side plugin. It does not depend on dsh.client, and the browser half is not involved. It adds a third button, “↻ Refresh”, to the top title bar of the DeepSeek Harness desktop client, in the same style area as “App” and “Edit”. Clicking it is equivalent to reloading the current page; conversations, workspaces, and running sessions remain in the host process and are unaffected. When the title bar menu cannot be obtained (e.g., when running dsh web in a browser, or when the shell menu bar has not yet appeared), it falls back to a floating pill in the top-right corner, offering “↻ Refresh”, “⇕ Move Corner”, and “✕ Hide” (the hidden state is persisted to localStorage).

Core Features

  • Title bar refresh: Prefers to attach into the shadow root’s [role="menubar"] of the shell menu bar [data-windows-menu], becoming a button after “Edit”, with styling consistent with “App / Edit”.
  • Fallback UI: When the menu bar remains unavailable for about 10 seconds, a corner pill is used; a watchdog running every 2 seconds self-heals and re-attaches, without mounting a duplicate button.
  • Self-check interface: After successful mounting, it reports back to POST /api/dsh-re/ui-ping (with where=titlebar|corner and userAgent); GET /api/dsh-re/status is readable without authentication, used to determine whether the button has entered the desktop window.
  • Static resource hot-update: The host exposes GET /api/dsh-re/ui.js, reading from disk on each request with no-store, so for daily changes to lib/ui.js, clicking refresh is sufficient; swapping plugins or changing injection logic requires a full application restart (the injection table is cached at host startup, and clicking refresh cannot pick up a new table).

Installation and Activation

The DSH community plugin directory is independent of DeepSeek / High-Flyer. Before installing, it is recommended to review the GitHub repository source code and the MIT license yourself; the plugin runs with the permissions of the current dsh process.

  1. Run one of the following commands in an environment where the DeepSeek Harness desktop profile is already installed:
# From npm (after publication)
dsh plugin --profile desktop add dsh-re

# Or directly from GitHub
dsh plugin --profile desktop add github:LUX09947-CMYK/dsh-re
  1. Restart the application once after installation (do not just click the refresh button): the initial registration of the webserver/index-inject injection entry must be written into the host cache via this restart.
  2. Afterwards, if you only modify lib/ui.js within the plugin, you can click “↻ Refresh” on the title bar or the pill to see the UI changes.

Engine requirement: dsh.engines.dsh: >=0.2.0-rc.1. The README records the tested environment as DeepSeek Harness desktop 0.2.0-rc.2 (Electron 44).

Typical Usage

  • Daily UI development: modify lib/ui.js → click “↻ Refresh” in the desktop window → confirm whether the behavior on the menu bar or the pill matches expectations.
  • Confirm whether it has been mounted into the title bar: request GET /api/dsh-re/status, no need to guess the window state manually.
  • If the pill has been hidden via “✕”: clear the localStorage key dsh-re-ui:hidden and refresh; the button will appear again.

Uninstallation:

dsh plugin --profile desktop remove dsh-re

Use Cases and Notes

Who it’s for: Developers who primarily develop DSH plugins or debug injected UI under the desktop profile; scenarios where you need to frequently see UI iterations without restarting the entire application.

Platform differences: Only the Windows desktop shell has that title bar menu bar; other platforms or browser forms automatically fall back to the corner pill, and the refresh functionality itself is unaffected.

Security and trust: Like other DSH plugins, the host code registers routes and index injection in the application startup path. Before installing, you should read lib/index.js, lib/ui.js, and cordis.patch.yml to confirm the behavior meets your expectations.

How it works (for troubleshooting): The host lib/index.js pushes an inline script into webserver/index-inject at the beginning of apply(), which loads /api/dsh-re/ui.js on page load; on the desktop, tapIndex() does not take effect, and you cannot use the script-src async loading approach that would break __DSH_BOOT_READY__, so an inline script line is adopted, and within apply() you cannot rely on an object-level inject that would delay execution.

Conclusion

dsh-re addresses the specific gap of “no refresh entry point” on the desktop: a button styled like the native menu, or an equivalent corner pill, returns UI iteration to the rhythm of “modify file → refresh page”. Community directory page: lux09947-cmyk/dsh-re; source code and detailed documentation: GitHub — LUX09947-CMYK/dsh-re.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye