Introduction

In DSH workflows, when an AI invokes the write or edit tool to modify files, it usually only shows a successful execution status or a brief summary. To inspect the specific changes, you often need to leave the conversation flow and check the file or manually run git commands. The following introduces the roushanyyzz/dsh-diff-vis plugin, which can display file differences directly in the conversation flow, helping users avoid getting lost when switching between interfaces.

Plugin Positioning

This plugin is maintained by user roushanyyzz and is a client-side plugin. It intercepts write and edit tool calls and directly renders git-style file diffs at the corresponding tool card position in the conversation flow.

Core Features

  • Zero git dependency: The plugin does not call git or external diff tools; it implements line-level diff calculation in pure JavaScript.
  • In-place display: Diffs are rendered directly on the corresponding tool card in the conversation flow, without requiring users to leave the dialog.
  • View switching: Supports two modes: vertical comparison (red for deletions, green for additions, gray for context) and side-by-side comparison (parallel view, with aligned line numbers).
  • Inline highlighting: Changed words are additionally highlighted with a yellow background (preserving shared prefixes and suffixes), so you can immediately see “which word changed.”
  • Preference memory: Your selected view (side-by-side/vertical) is automatically saved to browser localStorage, and subsequent cards follow the same preference by default.
  • Large file protection: When the size exceeds 4M, diff cells automatically fall back to a full replacement view to prevent process freezes.

Installation and Enablement

The installation command is as follows:

dsh plugin --profile web add github:roushanyyzz/dsh-diff-vis

After installation, restart dsh web. From then on, it will be loaded automatically on every startup, without needing to rerun the installation command.

Typical Usage

A card will automatically appear if either of the following conditions is met:

  1. AI invokes the write tool: When writing a file, the diff is displayed. New content is shown in green; if overwriting an existing file, it displays the complete old-to-new diff.
  2. AI invokes the edit tool: When modifying an existing file, it displays precise line deletions/additions and inline changes.

Card operations:

  • Click the top-right corner of the card to switch between vertical comparison and side-by-side comparison views.
  • Click the file name in the card header to open the file directly in the workspace.

Notes

  • Process limitation: Diff records are stored in the process. After the plugin restarts, historical cards display a fallback message, but subsequent modifications are captured normally.
  • Tool support: Currently, only the two file-modifying tools write and edit are supported; file changes generated by commands such as bash/pwsh are not tracked yet.
  • Line count limit: Each card processes at most 80,000 input lines; very large files will display a “file too large” message.

Applicable Scenarios

This plugin is suitable for scenarios such as novel writing, document writing, and collaborative coding, wherever AI repeatedly modifies files and you want to closely track every change. DSH’s philosophy is “everything is a plugin.” The community catalog has no official affiliation with DeepSeek / Huanfang, so it is recommended to review the source code and license before use.

Conclusion

By displaying diffs in place, this plugin simplifies the file review process. For more details, see the GitHub repository.