File browsing and version control in the DSH Web UI often require frequent window switching or reliance on external tools. The dsh-files-git plugin integrates file browsing, search, preview, editing, and Git operations into a centered modal panel, allowing developers to complete daily work without leaving the browser.
This is a DSH client plugin maintained by leanderli. It provides a unified management solution for the workspace directory of the current session, supporting Monaco editor integration, Git status monitoring, branch switching, diff preview, and commit history rollback.
Core Features¶
File Browsing and Preview¶
The plugin provides a lazy-loaded file tree and supports a dual-pane file browser with a draggable divider for adjusting pane width. Workspace-wide search results are displayed as a flat list, and search history is supported. Content preview supports full display of text without truncation (up to 512 KB) and renders Markdown directly. The panel integrates a Monaco editor with language matching based on file type, syntax highlighting, and write-back on save. It also supports uploading local files, referencing a path into the input box, and a quick actions menu.
Git Operations¶
A Git tab on the right side of the panel displays the current branch and ahead/behind status. It supports operations such as pull, push, fetch, and force push, with real-time command output. The branch selector supports grouped management and checkout of local and remote branches. The changes list is grouped by conflicts, staged, and unstaged items, and supports inline diff preview with word-level highlighting. Commit history supports rollback and reset operations. Git status is polled silently every 5 seconds, so external changes will not interrupt the current operation.
Panel Experience¶
The panel is presented as a centered modal and supports suspension (sliding out of the viewport while retaining state) and fullscreen toggling. The settings page allows configuration of the editor theme, default fullscreen behavior, and click behavior. The interface uses a frosted-glass visual style and includes focus trap and scroll lock mechanisms. Dual-entry design: when a session has already been opened, the entry is located in the title bar; when creating a new session, it is located above the input box.
Installation and Activation¶
- Obtain the plugin source code and place it in the plugin directory (example path:
~/.dsh/plugins/). - Register it to the web profile:
dsh plugin --profile web add ~/.dsh/plugins/dsh-files-git
- Restart DSH Web:
dsh web
- Open the panel: find the “Files and Changes” button in the WebUI title bar and click it.
Usage Notes¶
- File operations: Expand directories in the Files tab and click a file to preview or edit it with Monaco. Local file upload and reference insertion into the input box are supported.
- Git operations: Select changed files and then commit, or perform pull/push via the action bar. Click a diff line to expand the comparison view.
- Suspend the panel: Click the “↑” in the header or move the mouse out of the panel; the panel will slide out while retaining its state, and you can recover it by entering again.
Important Considerations¶
- Environment requirements: DSH version 0.1.5 or higher is required, and the system
PATHmust include thegitcommand. - Path dependencies: After installation, do not delete or move the plugin source directory. The profile uses a symbolic link, and loss of the source directory will cause startup failure.
- Security model: RPC communication is limited to loopback addresses, file browsing is strictly constrained within the workspace root directory, and there is no Shell injection risk.
- Language: Git command output is naturally English or mixed output, while panel UI text follows the DSH language setting.
Ecosystem and Resources¶
This plugin follows the MIT license, has zero runtime dependencies, and supports offline installation. For more details, refer to the project directory or the GitHub repository.