The DSH Web GUI plugin ecosystem enables developers to extend functionality through session tabs. Git operations typically rely on external terminals or manual file management, and managing code changes directly inside an agent session often requires frequent context switching. The dsh-git-panel plugin provides a visual Git panel integrated directly into the session tab bar, allowing you to view, stage, commit, diff, review history, and manage branches.
Maintained by fengbinmov and released under the MIT License, the plugin is delivered as a profile bundle that contains both host-side and browser-side logic.
Core Features¶
Session Tab Integration¶
The plugin adds a Git tab to the session tab bar, positioned next to the “Chat / Trajectory” tab. The panel contains two sub-views: the Changes view and the History view.
Changes View¶
- Dual-panel layout: The top section shows “Unstaged changes”, and the bottom section shows “Staged changes”. If a file has modifications in both areas, it appears on both sides.
- Drag-and-drop: Drag files or file lines from “Unstaged” to “Staged” to stage them; dragging a group header moves the entire group.
- Line-level actions: Press and drag along the line-number gutter to select multiple lines; a floating action bar appears (Stage / Unstage / Discard). Dragging across code text performs native browser text selection.
- Keyboard shortcut: Pressing Delete discards unstaged changes (without confirmation) or unstages staged changes.
History View¶
- Three-pane layout: Commit list / File list / Patch of the selected file. Dividers are draggable and can be reset via double-click.
- Live synchronization: The divider positions match those in the Changes view, and cross-view dragging can reset dividers.
Branches and Remotes¶
- Toolbar: Displays the current branch, upstream branch, and ahead/behind counts.
- Actions: A dropdown menu supports switching local branches, merge, rebase, and fetch/pull/push.
- Conflict handling: If there are unresolved conflicts or ongoing operations, branch switching or merges are blocked with a reason prompt; an in-progress merge/rebase triggers a warning bar with an Abort button.
Diff Rendering and Optimistic UI¶
- Renderer: Changes and History share the same diff renderer, with monospaced fonts and line-level markers. Clear notices are shown for binary files, truncated patches, and renames.
- Optimistic strategy: Operations are applied to the local view first via predictor functions, then replaced with real Git results. On failure, the UI rolls back and surfaces an error.
Installation and Activation¶
The plugin requires DSH version >= 0.1.5-rc.1 and Node.js version ^22.19.0 or >=24.0.0.
dsh plugin --profile web add @fengbinmov/dsh-git-panel@latest
After installation, restart dsh web to enable it.
Typical Usage¶
- Add the Git tab in the session UI to inspect current repository changes.
- Drag file lines or select lines via the line-number gutter, then use the floating action bar to stage or discard quickly.
- Manage branches and remotes via the toolbar to perform merges or pulls.
Notes and Caveats¶
- All Git actions are triggered from the UI; the plugin does not register tools or modify the system prompt, so the model does not see it.
- The plugin uses an optimistic UI; failed actions roll back automatically and display errors.
- The browser side uses Web Locks to ensure a single SSE event stream across tabs, avoiding connection pool contention.