dsh-sidebar-density: Consolidating DSH Sidebar Density into a Single Overlay

Preface

The geometry of the DeepSeek Harness (DSH) sidebar is hard-coded in the host: session row height, padding, Logo, and plugin button layout are all fixed. On small screens, a single screen cannot hold many sessions, while large screens look empty; there is no entry point to fine-tune font size or Logo. The community plugin dsh-sidebar-density (maintainer pcysanji, category: Client) moves this set of numbers into a floating overlay slider, modifying the sidebar’s own CSS variables and geometry without touching session, send, or model behavior.

What is this

dsh-sidebar-density is a DSH client-side plugin: it provides a “Density” entry (three-line icon) at the far right of the account button row at the bottom of the sidebar. Clicking the overlay allows you to drag the slider, which takes effect immediately. Configuration is written to localStorage under dsh-sidebar-density:settings, persisting across sessions and following the profile. The host side only adds a font enumeration route /sidebar-density/fonts, while the rest of the logic is completed on the client. License MIT; npm package version 1.0.2 (see repository package.json).

Core Features

Adjustable items directly in the overlay

Changes take effect immediately upon dragging; there is no “Save”; closing the overlay collapses it; the “Default” button in the top-right corner only resets the configuration and does not uninstall the plugin.

Control Default Range Effect
Panel Spacing 1px 0–12 Vertical spacing between plugin buttons
Logo and Plugin Spacing 4px 0–40 Gap between the Logo row and the plugin area
Session Row Height 26px 20–40 Height of each row in the session list (originally hard-coded at ~32px)
Plugin Button Row Height 29px 22–44 Height of each button in the plugin area
Font Size Adjustment 0 −3 ~ +4 Offset from the original font size, not absolute pixels
Logo Size 24px 14–40 Width and height of the brand Logo; optional “Select Image” for customization
New Session Height 30px 24–44 Height of the top “New Session” button
Hide New Session Button Off Toggle Hides the button, but sessions can still be created by clicking the top-left Logo
Plugin Buttons in Two Columns Off Toggle Two-column layout in the plugin area, column widths based on text measurement
Two-Column Column Gap 8px 0–24 Extra spacing between the two columns
Font DSH Default System font search Only for sidebar text, presets or local search

Three items requiring asar patch to take effect

The following items in the overlay are labeled “Requires asar patch”. When the patch is not applied, dragging does not report an error, but has no effect.

Control Default Range Effect
Top Bar Height 28px 20–48 Height of the “App / Edit” title bar
Top Bar Font Size 12px 9–16 Font size of title bar menu text
Remove Sidebar Width Limit On Toggle Relaxes width upper/lower limits from 264–420 to 120–900

The accompanying patch script is tools/patch-density.cjs in the dsh-enhance-tools repository (performs fixed-length literal replacement and in-place integrity hash modification, requires node --check after modification). The patch only modifies the locally installed app.asar; it needs to be reapplied after a major DSH version upgrade. The top bar height of approximately 20px is the native button safe lower limit; anything smaller will be clipped. The patch allows adjustment starting from 24px by default.

Implementation Boundaries (Plugin README)

  • Selectors use structural and semantic hooks (e.g., data-sidebar-scrollport, role="treeitem", nav[aria-label]) to avoid class names with hashes.
  • The overlay color scheme is derived from the host theme tokens --dsw-*, adapting to light and dark modes.
  • Examples of overridden variables: --dsh-sidebar-inline-padding, --dsh-sidebar-row-padding, [role="treeitem"] row height, plugin area nav row height and column count, brand row and new session button, --dsh-caption-*, etc.

Installation and Activation

DSH needs to be restarted after installation. Commands are based on the README:

# Install from repository
dsh plugin add pcysanji/dsh-sidebar-density

# Or from npm
dsh plugin add dsh-sidebar-density

Typical Usage

  1. Move the mouse to the row of the account button at the bottom of the sidebar and click the “Density” icon on the far right; the overlay expands upward along the right edge of the sidebar.
  2. Drag the slider as needed; when top bar height, top bar font size, or relaxing sidebar width limits are needed, first apply the accompanying patch-density.cjs to app.asar, then adjust in the same overlay.
  3. When there are many sidebar plugins, you can enable “Plugin Buttons in Two Columns” and adjust the “Two-Column Column Gap” to save vertical space in a narrow sidebar.
  4. Session body font size is not within this plugin and should be adjusted in DSH “Settings → General Settings → Font Size”.

Suitable Scenarios and Notes

Suitable for: Users who manage a large number of sessions and plugins in DSH long-term and need to compress or relax sidebar density according to screen size; advanced users willing to apply asar patches to their local DSH to unlock top bar and sidebar width limits.

Boundaries and Limitations (Original README):

  • When window width is below 1024px, the official layout collapses the sidebar into a 56px icon bar, and this plugin does not take over that section.
  • Right panel width, session semantics, and function toggles are not changed.
  • Two-column column width is tested based on the text of each item; when the sidebar is too narrow, the longest item may show an ellipsis, but the rest of the items are unaffected.
  • The three asar-related items depend on the patch; the patch may become invalid after upgrading DSH.

Security and Permissions: The plugin runs on the client side with the current DSH process, capable of reading and modifying localStorage and requesting the local font list; before installation, you should view the source code and MIT license at the GitHub repository to ensure consistency with your acceptance of patching app.asar.

The DSH ecosystem advocates “Everything is a plugin”; the SkillHub directory page is a community site and has no official affiliation with DeepSeek / Hypothesis.

Conclusion

dsh-sidebar-density changes sidebar density from hard-coded constants to adjustable sliders, and optionally enables two-column plugin areas and custom logos; most capabilities are ready to use upon installation. Top bar and sidebar width limits require the accompanying asar patch. For documentation and issues, see GitHub; for directory index, see SkillHub Plugin Page.

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

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

Xiaoye