dsh-session-folders: Organizing Sessions in the Left Sidebar

Introduction

DSH natively supports only two levels: “workspace” and “session.” Conversations on different topics within the same workspace can only be listed flat together, making management cumbersome. dsh-session-folders inserts a classification layer above sessions, grouping conversations into folders by topic, and supports collapsing, renaming, color tagging, and archiving.

What Is This

dsh-session-folders is a client-side plugin maintained by chocosuki under the MIT license. It adds a custom categorization layer to the session list in DSH’s left sidebar, organizing sessions within the same workspace into topical groups for easy on-demand collapsing, searching, and archiving.

Core Features

  • Category management: Create, rename, move up, move down, and delete categories; supports collapse/expand.
  • Session categorization: Drag a session onto a category title to assign it; drag onto “Uncategorized” to remove it from the category.
  • Color tagging: Click the “Color” button in the toolbar to enter color mode and assign a color to a session; supports clearing colors.
  • Archiving: Use the “Show Archived” button in the toolbar to open the host’s archive view; archived sessions automatically go into the “Archived” bucket; can be dragged into any category.
  • Data persistence: Category and color metadata are stored in a local JSON file—no uploads, no network calls.

Installation & Activation

It is recommended to install the pre-packaged tgz from Releases:

  1. Go to https://github.com/chocosuki/dsh-session-folders/releases/latest and download dsh-session-folders-0.2.2.tgz.
  2. In DSH’s plugin manager, select “Install from local file/local package” and choose the tgz.
  3. Or run the following in a terminal (requires the node/pnpm bundled with Desktop):
dsh plugin --profile web add <local-path>/dsh-session-folders-0.2.2.tgz --offline --ignore-scripts

After installation, refresh the page (Ctrl+R). If files on the Host side were modified, a Harness restart is required for changes to take effect.

Typical Usage

  1. Expand the left sidebar; “New Category” appears below the workspace. On first run, three preset categories are created: “Homework / Development / General Knowledge.”
  2. Drag a session row onto a category title to assign it; drag onto “Uncategorized” to remove it from that category.
  3. Click “Color” in the toolbar, select a color, then click any session to apply it; press Esc to exit color mode.
  4. Click a category title to collapse/expand; double-click the title to rename; click the “More” button or right-click the title to rename, move up, move down, create new, or delete a category.
  5. Click “Show Archived” in the toolbar to open the host’s “All Conversations (Show Archived)” view; archived sessions automatically go into the “Archived” bucket and can be dragged into any category.
  6. Deleting a category returns its sessions to “Uncategorized”—the sessions themselves are not deleted.

Data Storage & Reset

Category and color data are stored in <DSH_HOME>/storages/dsh-session-folders/state.json (default on Windows: C:\Users\<user>\AppData\Roaming\dsh-desktop\harness\storages\...). Writes use an atomic “temp file + rename” strategy and retain a .bak backup. Browser localStorage serves only as a startup cache and fallback.

To reset to the initial state: disable the plugin (or temporarily comment out the bundle line), delete the state.json file, then refresh the page. Uninstalling the plugin does not delete DSH sessions or workspaces.

Boundaries & Known Limitations

  • Only affects session rows in the native “By Workspace” and “By Workspace Tree” views; categories are not shown in “Single List” or search results.
  • In “By Workspace Tree” mode, only top-level workspaces are categorized; nested sub-workspaces are unaffected.
  • Relies on the host DOM’s role="tree" and data-row-key contract; if the host structure changes significantly, it automatically degrades to “no list modification” without breaking the sidebar.
  • When the sidebar is narrowed to 56px, category rows are not rendered; they automatically restore when expanded.
  • Category rows do not participate in the host’s drag-to-reorder; the host’s “Recent” and “Manual Sort” determine the order within categories.
  • Colors only affect sidebar display, do not change session state, and do not appear in search results; the color entry point is the “Color” button in the toolbar.
  • The “Archived” bucket only appears when the host renders archived sessions; the “Show Archived” toolbar button simulates a click on the host’s view option and may stop working if the host’s wording changes.

Development & Testing

Project directory structure:

session-folders/
  - index.js            Host side: read/write routing for /session-folders (atomic write + .bak)
  - client.js           Browser side: sidebar category engine (single file, no build step)
  - cordis.patch.yml    Bundle layer: insert Loader line
  - locale/             Plugin page title & description (zh / en)
  - icon.svg
  - test/               Offline tests (not included in release)

Test commands:

cd test
pnpm install             # Install jsdom only
node client-dom.test.mjs # Run category engine in a fake DOM: insert, sort, collapse, drag-and-drop, rename, persistence, uninstall restore
node host.test.mjs       # Run RPC over a real HTTP loopback: save, read, backup, reject malformed documents

License: MIT.

Use Cases & Notes

Ideal for developers and users who need to organize sessions by topic within the same workspace, frequently switch contexts, or require visual differentiation between sessions. The plugin runs with the current dsh process privileges. It is recommended to review the source code and license before installing.

Conclusion

dsh-session-folders makes left-sidebar session management clearer and more controllable through a lightweight categorization and color mechanism. For installation and feedback, visit its GitHub repository: https://github.com/chocosuki/dsh-session-folders

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye