Introduction¶
The philosophy of DSH is “Everything is a plugin”. After installing a few extensions, you will notice one thing: the top area of the left sidebar, the “Global Panel” entry zone—Plugins, Automation Tasks, XD Pool, Context Insights, MCP Connectors, WSL, Library—every time a panel is registered, a 36px row is added. With a few plugins, this area itself occupies seven or eight rows, and the workspace/session list below is squeezed into a narrow strip.
One approach is to modify the behavior of ui-sidebar itself, but that means following version updates. The meihuaanying/dsh-panel-fold introduced here (maintainer meihuaanying, MIT, version 0.1.0, requires dsh >=0.2.0-rc.1) takes a smaller path: without modifying a single line of code in ui-sidebar, it uses only one CSS rule to tuck that row of icons into the “More” button that already exists at the bottom of the block, and provides a toggle line that can restore it anytime.
First, it needs to be stated: plugins that directly write client-side behavior run with the current DSH process permissions. Before installing, you should read the source code yourself and confirm the license (this plugin is MIT). Also, it is installed directly from GitHub and has not been published to npm.
Below is an introduction to its actual behavior, installation method, implementation logic, and things to note.
1. What It Solves¶
The visible part of the sidebar panel block, each row is a panel entry. Plugins are collapsed by default; after installation and refresh, the block becomes a ⋯ More, and the workspace list below has about 7 × 36px added.
Collapsing does not mean hiding. All panels are still in the “More” menu; opening them behaves as originally (selectPanel), and the currently selected item is preserved. The plugins row stays put by design—ui-sidebar itself doesn’t allow unpinning it.
Toggles and Persistence¶
- The last line of the “More” menu is “Show Global Panel Icons / Collapse Global Panel Icons (Leave only ‘More’)”. Clicking toggles immediately back and forth, no refresh or restart needed.
- State is stored in
localStorageasdsh-panel-fold:mode, with valuescollapsedorexpanded. Refresh, restart, and plugin reload will all preserve it. - Default is collapsed; installing this plugin itself is your choice.
Reversibility¶
- Temporary: Sidebar “More” → “Show Global Panel Icons”.
- Thorough: Disable or uninstall. The
<style>tag and the class on<html>disappear together, and the sidebar returns to its factory state. - Disable only, don’t uninstall: Append in your own patch layer:
- id: dsh-panel-fold
disabled: true
2. Installation and Enablement¶
The plugin isn’t on npm yet; install directly from GitHub (command comes from README):
dsh plugin --profile <your profile> add github:meihuaanying/dsh-panel-fold
Local checkout is also possible:
dsh plugin --profile <your profile> add /path/to/dsh-panel-fold
Then refresh the web client; the collapse takes effect immediately, and the toggle appears in the sidebar’s “More” menu.
If you previously installed the old version before the rename, delete the old package first, otherwise the profile will have a broken link pointing to the renamed directory:
dsh plugin --profile <profile> remove <old package name>
3. Typical Usage: Why It Works by Default¶
This is the most important point to clarify about the entire plugin. ui-sidebar itself has a “Pin / Unpin Panel” mechanism setPinned. After unpinning, the panel row disappears from the sidebar but remains in the “More” menu——sounds exactly like the desired effect. But you can’t use it: setPinned can only be obtained through the owner props of sidebar.panellist.actions, and that slot is only mounted when the “More” menu is expanded. There are no hooks during the startup phase to apply a pinned state.
The plugin’s approach bypasses this limitation:
- Use
MutationObserveron the web side to observe the DOM, find the panel list<nav>and mark it. Prioritize exact matching byaria-label(全局面板/Global panels, i.e.,ui-sidebar’st("panels.label")); if the text changes, fall back to structural criteria—<nav>containsbutton[aria-haspopup="menu"]and has at least two direct child buttons. - A CSS rule is applied to the class on
<html>:
html.dsh-panel-fold-collapsed nav[data-dsh-panel-fold-nav] > *:not(:last-child) {
display: none !important;
}
The last child element of this `<nav>` is the "More" button, so only it remains.
- The toggle line is registered into the
sidebar.panellist.actionsslot, andui-sidebarrenders it in the “More” menu.
No need to patch ui-sidebar, nor depend on its hashed CSS class names—those names change between versions. The README notes it has been verified on DSH 0.2.1-rc.2 (Desktop profile, Windows): the collapsed state persists after Ctrl+R, and Collapse/Expand can be toggled in place without reloading the page.
4. Code Structure¶
| File | Purpose |
|---|---|
lib/client.js |
Implementation of the entire feature: style injection, <nav> marking, toggle line for “More” menu |
lib/index.js |
Host placeholder, only to hold the line for the bundle patch |
cordis.patch.yml |
Bundle patch inserting the dsh-panel-fold line |
test/manifest.test.mjs |
Validates that manifest, patch, and client entry are consistent |
The README emphasizes that this plugin deliberately takes the minimal approach: it does not add any new entry rows, reuses the “More” button that ui-sidebar already renders at the bottom of the block; it does not touch other parts of the sidebar except the panel block; the client side stays under 7 KB, and the Host side has no code.
There are also these constraints in package.json worth looking at:
engines.dsh:>=0.2.0-rc.1peerDependencies.react:^18.2.0(marked as optional)dsh.client.inject:@deepseek-ai/dsh-client-ui-sidebardsh.client.immediately:true, meaning injection happens immediately after installation
5. Relationship with Similar Plugins¶
There are two other plugins in the same position, both doing sidebar simplification, you can compare them as needed:
ACGsu/dsh-sidebar-panel-fold– The closest one. It adds its own row “Collapse Panels” above the panel list; after collapsing, the whole block becomes a summary row (current panel icon + name), clicking this row opens a popover listing all panels; state is stored in DSH’s Host settings channel instead oflocalStorage. Choose it if you want “one summary row + current panel name”.LoktLin/dsh-sidebar-tidy– Wider scope, hiding the branding row, new session button, panel block, and bottom settings into a “Exit Minimalist Mode” button, and also adds workspace color blocks. Choose it if you want to strip the entire sidebar clean.
The positioning of dsh-panel-fold is the smallest slice: it does not collapse other rows, does not add new UI, does not modify ui-sidebar, and retains one-click restore.
6. Use Cases and Notes¶
Suitable for these situations:
- Installed multiple plugins that register panels, workspace/session list is squeezed by the panel block and hard to use.
- Want existing, persisted preferences instead of manually collapsing every time.
- Don’t want to move other parts of the sidebar, just want to collapse this row of icons.
Things to note:
- The plugin runs with current DSH process permissions, injecting
<style>into the page and modifying class names on<html>. Before installing, readlib/client.jsyourself to confirm the MIT license matches your compliance requirements. - It relies on
ui-sidebar’saria-label(全局面板/Global panels) plus a structural fallback criteria to locate<nav>. If the DOM structure ofui-sidebarchanges beyond its fallback criteria in the future, the marking may fail; this is why the author kept a path that does not rely on class names but on structural features. - The
pluginsrow cannot be collapsed regardless; this is the design ofui-sidebar, and the plugin does not bypass it. - The directory page has a star count of 0, belonging to an early project; the behavior descriptions above all come from the README and have not been independently verified.
Conclusion¶
The value of dsh-panel-fold lies in precision: it does not try to overhaul the sidebar, only answers the specific question “This row of global panels is occupying the space of the session list”, solved with one CSS rule, one MutationObserver, and one toggle line, and guarantees reversibility and persistence. If your problem is exactly this, it is a low-cost choice.
Directory Page: https://www.skillhub.cn/plugins/meihuaanying/dsh-panel-fold
Repository: https://github.com/meihuaanying/dsh-panel-fold