Introduction¶
DeepSeek Harness (DSH) by default only displays the session list under a workspace. To view the file structure of a specific workspace, you need to switch to the right sidebar and click the file tree tab. Those two extra clicks can break your flow when switching between multiple workspaces. DSH’s design philosophy is “everything is a plugin,” and there are community plugins that cram the file tree back into the left sidebar (e.g., zcode’s implementation). However, that area is controlled by the official app, and a plugin directly registering a slot would crowd out the official workspace list.
The jipika/dsh-workspace-files plugin described below takes a different approach: instead of touching the official slot, it replaces the entire session list area with a file tree, toggling between two views via hovering over a workspace row and clicking a toggle icon. This method interferes less with official re-rendering and avoids competing over slots.
Plugin Overview¶
This is a client-side plugin maintained by jipika. It adds a “workspace row → file list” toggle to the DSH left sidebar: when you hover your mouse over a workspace title row, a toggle icon appears on the right side of the row; clicking it switches the entire list area from session mode to file mode. Click again or click the back button to slide back to the session list.
The plugin version is 0.6.0, licensed under MIT.
Core Features¶
Two-State Toggle¶
- Hover the mouse over a workspace title row → a toggle icon floats up on the right side of the row (a rounded rectangle + two short horizontal lines, not a folder icon).
- Click the icon → the entire list area switches to file mode: the session list slides out to the left, and the file tree slides in from the right (180ms animation, instant when
prefers-reduced-motion: reduceis set). - A back button (←) sits at the top in file mode; clicking it or the toggle icon on the row again slides back to the session list.
- Active state: in file mode, the button turns to the accent color with a light background block; when inactive, the button is grayed out and only appears when hovering over a workspace row.
- State persistence: expanded workspaces are stored in
localStorage["dsh-workspace-files:open"]and automatically restored after a refresh or restart.
File Tree & Live Updates¶
- The file tree uses the official
remote.workspaceFiles.list(sessionId, parent)to fetch directory contents. - Lazy loading: a request is only made when a directory is expanded; unexpanded directories consume no resources.
- Live updates: in file mode, the “already expanded directories” are silently re-listed every 3 seconds, so new / deleted / renamed files appear in the tree within a maximum of 3 seconds; polling pauses when the tab is not visible and immediately refreshes once when returning to the foreground; a “Refresh” button at the top triggers an immediate re-fetch (only clears the cache for this session).
- Caching strategy:
listDir(sessionId, path, signal, { force })has a 1.2s TTL;forcebypasses the cache.
Context Menu¶
Every row in the tree, as well as empty areas, support right-clicking. The menu uses the official primitives’ Menu, rendered to body, popping up at the mouse coordinates, with support for submenus and destructive action styling.
| Target | Menu Items |
|---|---|
| File row | Preview in right sidebar · Open with default app · Open with ▸ · Reveal in Finder · Open in Terminal (containing directory) · Copy absolute path / relative path / file name · Rename… · Move to Trash |
| Directory row | Open in Finder · Open in Terminal · New File… / New Folder… · Copy absolute path / relative path / name · Rename… · Move to Trash |
| Empty area | Reveal workspace in Finder · Open in Terminal · New File… / New Folder… · Copy workspace absolute path / name |
- Finder / default app / open-with go through the official Remote:
session.openWorkspacePath({path}to open,{path, action:"reveal"}to reveal in Finder,{path, application}for a specific app) +session.workspacePathApplications. - Delete = Move to Trash (recoverable from Finder); name collisions are automatically resolved to
name 2.ext. - Rename is inline editing (Enter to commit / Esc to cancel / blur to commit).
- New creation uses a top input bar (Enter to create, Esc or blur to cancel).
- After a write operation completes, the entire expanded tree is refreshed immediately, and a brief result toast flashes at the top of the tree.
Escapecloses the menu; clicking elsewhere also closes it.
Host Routing & Security Boundaries¶
The official DSH has no file write capability. Delete / rename / create operations are handled by the plugin’s host routes:
GET /dsh-workspace-files/health → { ok, actions, roots, trash }
POST /dsh-workspace-files/fs → { action, path?, dir?, name? }
action = trash | rename | newFile | newDir | openTerminal
Three layers of security boundaries:
- The target must fall under a registered workspace (both sides perform realpath normalization, so symlinks won’t cause misjudgment).
- The root directory / home directory /
~/.Trashitself and the workspace root itself are always rejected. - The name must be a bare filename (no separators, no
.., no NUL, non-empty, ≤255 chars), and if it already exists, it is rejected — never overwritten.
⚠️ Changing host routes requires a full restart of the DSH application (a page refresh is not enough). After restarting, curl -s :19387/dsh-workspace-files/health returning ok confirms it’s active.
Smart Sorting¶
Entries at the same level are sorted by the following rules (directories always come before files):
- Entries starting with
序章 / 楔子 / 引子 / 前言…(prologue/preface) are sorted first;番外 / 终章 / 尾声 / 后记…(epilogue/afterword) are sorted last. 第X章|节|回|卷|话|集|部|篇|幕|场where X is a Chinese numeral or Arabic digit → sorted by chapter number value.- For the same chapter number, compare the writing style first, then the remainder after the chapter number.
- Other regular files are sorted before chapter files, and among themselves use natural numeric ordering.
Under the Hood (Zero Source Patches)¶
- Getting data: directly reads client services
ctx.get("workspaces")/ctx.get("sessions"), usinggetSnapshot/getState/subscribefor multi-channel adaptation. - Finding DOM: does not hardcode CSS Module hash prefixes; uses attribute substring selectors
[class*="_projectRow"]/[class*="_sessionRow"]. - Ownership: infers parent-child relationships using
TreeWalkerin document order: all_sessionRowelements before the next_projectRowbelong to that project. - File tree: an overlay with
absolute inset-0is attached to the parent of the list scroll container, structurally identical to zcode’s dual-view stacking.
Installation & Activation¶
Choose one of two installation methods:
# ① npm (via registry)
dsh plugin --profile <profile> add @jipika/dsh-workspace-files
# ② GitHub (source install, tracks main branch)
dsh plugin --profile <profile> add github:jipika/dsh-workspace-files
After installation, edit ~/.dsh/profiles/<profile>/cordis.patch.yml:
- insert:
- id: workspace-files
name: @jipika/dsh-workspace-files
Note: The desktop profile is exclusively owned by Electron (CLI subcommands will be rejected); you need to manually edit package.json + run pnpm install.
After modifying lib/client.js, a page refresh takes effect (the host process stat-polls the client bundle and computes a rev from content). A full app restart is only needed for “adding/removing the client half / modifying the host half.”
Uninstall: remove the insert line (or add disabled: true) → restart. The button, panel, and hidden state all disappear, and the session list returns to its original state.
Typical Usage¶
- In the DSH left sidebar, locate the workspace list and hover your mouse over a workspace title row.
- A toggle icon appears on the right side of the row. Click it, and the entire list switches to file mode.
- When expanding directories in the file tree, files and directories are displayed according to the smart sorting rules (directories first).
- Right-click a file or directory to perform actions such as preview, open, copy path, rename, create new file/folder, or move to Trash.
- In file mode, a back button is available at the top. Click it or the toggle icon on the row to slide back to the session list.
Use Cases & Caveats¶
Suitable for developers who need to quickly view and manipulate workspace files from the left sidebar, especially in scenarios with frequent multi-workspace switching.
Note: The plugin runs with the current DSH process permissions, and all file operations (delete, rename, create) will actually write to the host filesystem. It is recommended to review the source code and license (MIT) before installation. After modifying host routes, a full restart of the DSH application is required; a page refresh will not take effect.
Conclusion¶
This plugin brings the file tree from the right sidebar back to the left sidebar via a two-state toggle, reducing the cost of two back-and-forth clicks. It also improves the user experience through live updates and smart sorting. For more details, visit the plugin catalog page or the GitHub repository.
- Plugin catalog page: https://www.skillhub.cn/plugins/jipika/dsh-workspace-files
- GitHub repository: https://github.com/jipika/dsh-workspace-files