Foreword¶
The design philosophy of DeepSeek Harness (DSH) is “anything is a plugin.” In the DSH web interface, the default document preview in the right sidebar renders at native size, does not automatically adapt to the window, and only provides scrolling. This static preview is acceptable for icon-sized resources, but it offers a poor interaction experience when viewing large screenshots, charts, or design drafts. The dsh-sidebar-image-zoom plugin replaces the image renderer in the right sidebar and adds zoom and pan capabilities to these resources.
Plugin Overview¶
- Name: dsh-sidebar-image-zoom
- Maintainer: Meowrium
- Category: Client
- License: MIT
Installation and Enablement¶
The plugin is installed via an official command. After installation, restart dsh web.
dsh plugin --profile web add github:Meowrium/dsh-sidebar-image-zoom
Prerequisites: The DSH version needs to be on the 0.1.5 line (verified with 0.1.5-rc.1). The right sidebar document preview feature extended by this plugin did not exist before then.
After installation, open any image file in the right sidebar (for example, by selecting “New Tab” → “Workspace Files” and choosing an image), and the plugin will be enabled.
Core Features¶
The plugin provides the following interaction and control capabilities:
- Cursor-anchored zooming: When scrolling the mouse wheel, the image zooms around the mouse pointer position, keeping the pixels under the pointer stationary.
- Drag panning: When the image is enlarged beyond the window size, mouse drag panning is supported.
- Double-click switching: Double-clicking the image toggles between “fit to window” and “1:1” original size.
- Multi-mode fitting: Supports three display modes: fit to window, fit to width, and 1:1 original size.
- Keyboard shortcuts: Supports
+/-for step zooming;0to fit to window;1to restore 1:1. - Zoom range: Supports zoom levels from 10% to 1200%.
Typical Usage¶
When previewing large images in the right sidebar:
* Use the mouse wheel to quickly locate details.
* Use + / - keys for fine adjustments.
* Use the 0 key to quickly fit the image to the current window size.
Technical Implementation and Notes¶
- Official extension points: Only uses official extension points for registration; does not involve
monkey-patchingor modifying private DOM attributes. - Uninstall restoration: After uninstalling the plugin, DSH restores the built-in image rendering behavior, because the built-in definition remains registered and its priority is merely overridden by the plugin.
- Resource cleanup: When closing a tab, the plugin releases all listeners, styles, observers, and object URLs, leaving no residue.
- Loading method: The plugin only adds interaction logic; it does not change the image loading method or source.