dsh-widthkeeper: Adding a controllable "width keeper" to the DeepSeek Harness session content column.

Foreword

The width of the DSH session content column is controlled by a built-in 2px vertical handle. This handle is only visible when hovered over the content column. The hit area is only 10px wide and as tall as the content column, making it easy to accidentally trigger. The default width is given by formulas like clamp(680px, column_width * 64%, 920px), changing proportionally with the column width; stabilizing it at a specific pixel value often requires repeated trial and error. After dragging, although the host remembers the pixel preference, there is a lack of a visible, enterable width entry point.

Below is a client-side plugin addressing this issue: yulaiz/dsh-widthkeeper maintained by YuLaiZ. It transforms width control into a visible, enterable, and fixed preference, writes to --dsh-chat-content-width, and hides the native handle in fixed mode.

What is this

dsh-widthkeeper is a Web/Desktop client plugin for DeepSeek Harness, positioned as the “Guardian of the Session Content Column Width”. Maintained by YuLaiZ, categorized as a client plugin, licensed under MIT, current version 0.2.1, requiring DSH >=0.2.0-rc.1.

Its codebase originates from Jinngoo’s dsh-conversation-width 0.1.3. It was renamed, feature-extended, and is independently maintained based on this, with the original author’s copyright statement retained in the repository’s LICENSE.

Core Features

The plugin provides four capabilities, all acting only on the main session; the right sidebar sub-sessions retain the host’s own responsive width, and the plugin does not take over or display controls within them.

  1. Slider: A slider below the input box. Dragging it fixes the width to that value. Range 640–2000px, step 10.

  2. Precise Input: The value button displays the current width. Clicking it expands different behaviors depending on the mode:

    Fixed State   Expands inline edit layer, input precise width. Enter / blur to submit, Esc to cancel
                 Out of 640-2000 will clamp to boundary, empty or non-number reverts to original
                 Option "Use auto width" provided within layer
    Auto State    Fixes to last width
  1. Auto Readout: In auto mode, hovering over the value button displays Auto · 836px (Manually adjusted / Default formula). The readout refreshes with window, session switches, and element replacement.

  2. Settings Page Partition: A new “Content Width” partition is added after the plugin page, providing options to show/hide controls, input width, view the current auto width, and restore defaults with one click. Restoring defaults only clears the plugin’s three preference keys; it does not touch the host’s drag preference. After fixing the width, the controls below the input box can be collapsed, and the width remains in effect.

Installation and Enablement

In the DSH plugin page, click “Add Plugin” to install from GitHub or npm:

github:YuLaiZ/dsh-widthkeeper
@yulaiz/dsh-widthkeeper

The Web and Desktop versions are installed independently; profiles do not communicate with each other:

Client Profile Installation Method
Web (dsh web) ~/.dsh/profiles/web Plugin page “Add Plugin”, click “Enable now” to take effect, no restart required
Desktop (App) ~/.dsh/profiles/desktop Plugin page “Add Plugin”, fully exit and restart DSH after installation (command line install will be rejected)

If other width control plugins are already installed, disable or uninstall them from the profile before installing this plugin—enabling both simultaneously will cause a fight for the same width axis, overwriting each other’s width and handle states.

Typical Usage

The complete workflow for daily use is: Drag slider to set width → Click value button to confirm current width → Enter precise number in the inline edit layer and submit when needed → After deciding, hide controls in the settings page to keep the interface clean. In auto mode, to return to a fixed width, you need to click “Switch back to fixed width” in the settings page; the input box will become usable again.

During development and debugging, the plugin supports soft link installation for immediate code changes:

link:/your_clone_directory

Points to note when changing code in the repository:

  • Only modify src/client.js: Web version takes effect by refreshing the page; Desktop version has no in-app refresh entry, requires fully exiting and restarting DSH.
  • Modify package.json / cordis.patch.yml or reinstall bundle: Web version re-executes dsh web; Desktop version exits and restarts.
  • Do not use the file: prefix: pnpm will put the directory into the .pnpm virtual store as a copy, and changing source code will not propagate to node_modules, causing hot reloading to fail.

How it works

The width axis --dsh-chat-content-width is declared by the session body element itself; setting it from :root is invalid. The plugin uses higher-priority style rules to override it and hides the native handle in fixed mode; the rules remain resident during the plugin’s activation and do not fail when controls appear/disappear or the host remounts. Auto mode removes the rules, completely returning to Harness’s default behavior.

Preferences are stored in browser localStorage:

dsh.widthkeeper.enabled      // Is enabled
dsh.widthkeeper.value        // Fixed width value
dsh.widthkeeper.dockVisible   // Whether controls below input box are visible

The plugin depends on the host’s session body element, width axis, and handle marker. If the host UI is updated and these structures are renamed, the plugin will silently fail (width control has no effect) or misidentify embedded sub-sessions as the main session (applying fixed width to the sidebar). In this case, simply close the plugin in the plugin page and wait for an update. Floating tooltips depend on the host’s Tooltip from @deepseek-ai/dsh-client-ui-primitives. If the host does not provide this component, floating tooltips will not appear, but the controls remain usable.

Suitable Scenarios and Notes

Suitable for DSH users who need to permanently fix the session content column width and rely on precise pixel alignment of the interface, especially those using both the Web and Desktop versions who wish to control both sides consistently.

Points to note during use:

  1. The plugin runs with the current DSH process permissions; the plugin source code and MIT license should be checked before installation.
  2. Confirm that no other width control plugins are enabled before installation.
  3. Host updates may render width control ineffective; the plugin does not lock to specific host versions.

Conclusion

dsh-widthkeeper does a very narrow thing: it changes the DSH session content column width from “hover thin handle + formula default” to a visible slider plus a precisely enterable value button, and collapses the controls after fixing the width. The functionality only covers the main session, but it perfectly fills the gap where the native handle is hard to use and the default width is hard to control.

  • Directory page: https://www.skillhub.cn/plugins/YuLaiZ/dsh-widthkeeper
  • GitHub: https://github.com/YuLaiZ/dsh-widthkeeper
羽毛球分组比赛记分
小程序二维码

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

Xiaoye