Introduction¶
In DSH web sessions, git diff often appears as a markdown code block or in the bash tool row. Viewing it only in the chat window makes checking line-by-line, copying the original diff, and writing back line-level comments inefficient. yangzhe1991/dsh-code-review is a DSH Web plugin: when a git diff appears, it provides an “open in new tab” button to open the diff in an independent browser tab for review.
What is it¶
The repository is yangzhe1991/dsh-code-review with an MIT license. It solves a specific workflow: after a git diff appears in the session, view the double-column diff in a separate page, perform syntax highlighting, add inline comments, and write the comments back to the DSH composer in a predefined format.
Core Capabilities¶
Opening and Displaying¶
- Opens
git diffoutput in a separate browser tab as a code review page. - The button can appear on markdown diff code blocks and bash tool rows, including folded lines.
- The review page is opened via a Blob URL, relying on no server routing.
- When streaming output occurs, the button appears only after the content stabilizes for about 1 second to avoid generating a damaged page with partial streaming diffs.
Dual Column Viewing and Highlighting¶
- View the old and new files side-by-side in two columns, each with line numbers.
- Added lines are green, deleted lines are red; blocks added after consecutive deletions are paired line by line.
- Supports inline character-level highlighting.
- Supports basic syntax highlighting covering keywords, strings, comments, and numbers.
- Preserves
@@hunk separators and splits multi-file diffs into file blocks with status badges.
Navigation and Viewing Assistance¶
- File navigation sidebar; click a file to jump.
- Top stats bar displays
+N −M · F filesand provides a copy of the original diff and a collapsible original text. - The page inherits DSH theme colors, maintaining consistency in light/dark modes.
- Full-page natural scrolling, long lines wrap.
- Displays UI in Chinese or English based on the current DSH interface language.
Inline Comments¶
- Can add inline comments at line numbers.
- Comments can be submitted as “Looks Good To Me” or regular comments.
- After submission, comments are written to the DSH composer as
file:line — commentlines.
Installation and Enablement¶
First, install the plugin:
dsh plugin --profile web add @yangzhe1991/dsh-code-review
After installation, the Web GUI needs to be restarted: stop the dsh web process with Ctrl+C and run it again, then refresh the browser tab. dsh plugin will run pnpm add and automatically append the bundle to dsh.profile.bundles.
Local development can also use a linked installation:
dsh plugin --profile web add link:/path/to/@yangzhe1991/dsh-code-review
When using the link: spec, rebuilding and restarting dsh web is required.
Typical Usage¶
-
After a
git diffappears in the session, click the “open in new tab” button on the markdown diff code block or bash tool row to open the independent review page. -
In the review page, view the double-column diff, line numbers, added/deleted colors, character-level highlighting, syntax highlighting, file sidebar, and top stats bar.
-
Hover over any line number and click to add an inline comment; after completing all comments, select “Looks Good To Me” or a normal comment to submit.
-
After submission, comments are formatted as
file:line — commentlines into the DSH composer and can be sent directly to the agent.
Compatibility and Requirements¶
- Compatible with
dsh >= 0.1.2-alpha.4, fully supported from0.1.5;dsh 0.1.0-rc.xis still supported via legacy snapshot path. peerDependenciesrequiresreact ^18.2.0, and@deepseek-ai/dsh-client-runtime,@deepseek-ai/dsh-client-ui-conversation,@deepseek-ai/dsh-client-ui-layout,@deepseek-ai/dsh-client-ui-slotsare all^0.1.0-rc.6.- The plugin runs as a DSH Web plugin; it is recommended to check the repository source code and the MIT license before installation. It runs within the DSH client interface and is treated with the permissions of the current DSH process.
Scenarios¶
Suitable for scenarios in DSH web where you view git diff, perform manual checks, and write back line-level comments to the composer. It adds an open button to the code block or tool row where the diff appears, fitting workflows that require a more complete review view than the chat window.
Links¶
- GitHub:
https://github.com/yangzhe1991/dsh-code-review - Directory page: No confirmed URL was provided in the verified facts, so this article does not give a directory page address.