Introduction¶
As DeepSeek Harness (DSH) Web chat sessions run longer, the number of DOM nodes in the transcript increases rapidly. Because the upstream implementation does not virtualize chat history, every loaded history page remains in the DOM. In long sessions, dragging the width resize handle or sidebar divider, or scrolling quickly, forces the browser to perform layout and paint on thousands of nodes, causing UI jank.
Purpose and How It Works¶
dsh-chat-offscreen is a client-side plugin designed to address the performance issues described above. It injects a stylesheet and uses the CSS content-visibility property to let the browser skip layout and paint for assistant steps and tool-call lines in offscreen regions. This effectively approximates virtualization with minimal overhead, while contain-intrinsic-size helps keep the scroll range stable. For lines containing wide Markdown tables, the plugin keeps them visible to avoid incorrect width estimation.
Core Features¶
- Skips layout and paint for offscreen regions.
- Provides a low-overhead approximation of virtualization.
- Keeps the scroll range stable.
Installation and Enablement¶
Add the plugin using the official install command:
dsh plugin --profile web add github:publieople/dsh-chat-offscreen
After installation, restart Web mode (dsh web ...) and hard refresh the page in the browser (Ctrl+Shift+R). Because the lib/ directory already contains build artifacts, there is no need to run a build script.
Typical Usage¶
- Open a session with a long history.
- Drag the chat transcript width resize handle or the sidebar divider, or scroll the page quickly.
- In the browser developer tools Elements panel, inspect offscreen assistant step elements; the
content-visibility: autoproperty should be visible.
Notes and Compatibility¶
- Rendering-layer fix: This is a rendering-layer workaround and does not modify messages, session events, or host state.
- Combining usage: It can be used together with the retired
@linxin666/dsh-perfP0 rules. - Browser dependency: This feature relies on the browser’s
content-visibilitycapability (Chrome/Edge 85+, Firefox 125+, Safari 18+). On older engines, the rules remain inactive and the UI behaves the same as before installation. - Risk notice: The plugin runs with the permissions of the current
dshprocess. Before installing, review the source code and license (MIT).
Conclusion¶
This plugin uses CSS techniques to alleviate performance pressure in long sessions at the rendering layer. Once the DSH chat interface supports true virtualization, this plugin can be removed. See the links below for more details and source code.