dsh-sidebar-pins: Codex-Style Sidebar Pinning and Full-Row Context Menu

Introduction

Sidebar management in DeepSeek Harness (DSH) typically requires combining two plugins to achieve basic functionality: one handles the “Pinned/Recent” columns, and the other handles the context menu. This hybrid approach has two issues: first, the columns plugin hides the official session rows and renders its own; second, the menu plugin locates IDs based on official rows, causing the menu to silently fail on pinned rows. dsh-sidebar-pins combines these two features into one. It renders the pinned bar itself while parsing official rows to write the data-dsh-pins-id attribute. Both share the same menu implementation, ensuring full functionality is available on all rows.

Installation

Install the plugin using the DSH CLI.

dsh plugin --profile desktop add github:boyl/dsh-sidebar-pins

For the Web profile, replace desktop with web. You must restart DSH Desktop after installation (the bundle layer only composes at startup). To uninstall, run:

dsh plugin --profile desktop remove dsh-sidebar-pins

Features

The sidebar is divided into “Pinned” and “Recent” columns, each scrolling independently. Pinned sessions do not appear in the Recent list, and newly pinned items are placed at the top.

Session Management

On any session row, a pin icon 📌 appears on hover. Clicking it pins or unpins the session. The icon in the pinned bar is solid brand blue.

Right-clicking, double-clicking, or clicking the ⋯ button at the end of a row pops up a menu containing the following options:

  1. Pin / Unpin: Moves the current session to the pinned bar.
  2. Rename: Calls ctx.sessions.binding(id).session.rename().
  3. Mark as Unread / Read: Marks status; an orange bar appears on the left side of the row.
  4. Archive: Calls ctx.workspaces.archiveSession().
  5. Fork: Calls ctx.sessions.fork() and opens the child session.
  6. Copy: Supports copying the session link, title, or ID to the clipboard.
  7. Open in new window: Opens via the ?session=<id> deep link.
  8. Reveal in file manager: Calls the official POST /open-in-app/open route.

Workspace Management

Workspace rows also support right-click, double-click, or ⋯ menus. Features include:

  1. Pin Workspace: Calls ctx.workspaces.insertBefore() to move the workspace to the top.
  2. Rename: Calls ctx.workspaces.rename().
  3. New Session: Calls ctx.workspaces.startSession().
  4. Copy Path: Copies the path to the clipboard.
  5. Reveal in file manager: Calls the official route.
  6. Delete workspace (with disk): This is a special feature. Since the renderer does not have filesystem permissions, this operation is implemented via the Host route POST /dsh-sidebar-pins/delete-workspace. This route includes strict validation: it only accepts workspaceId and a confirmation name, rejects dangerous paths (such as /, $HOME, etc.), and requires secondary confirmation.

Native Button Takeover

The plugin takes over the official row-end ⋯ button. It intercepts clicks during the capture phase to pop up the full menu. The + new session button on workspace rows retains its native behavior and is unaffected.

Data Storage

All state is stored in the browser’s localStorage under the key dsh-sidebar-pins.v1, with the structure { v, pinned[], unread[], pinnedWorkspaces[] }.

On first launch, the plugin imports data from legacy plugins (such as dsh-codex-pins.v1, dsh-workspace-menu:v1) and deletes the old keys upon successful import.

Notes

  1. Session Deletion Limitations: The plugin does not implement the “Delete Session (including disk records)” feature, as this depends on third-party plugins or modifying core code.
  2. Dependencies: The sidebar layout relies on native DOM elements like role="tree", classes (e.g., sessionRow, groupSection), and the React Fiber structure. If a DSH update causes changes to these underlying structures, the plugin may fail.
  3. Permissions: The plugin runs with the permissions of the current DSH process. You should review the source code and license before installation.

Summary

dsh-sidebar-pins solves the fragmentation of DSH sidebar management through unified rendering and menu logic. It provides a Codex-style pinning experience and a comprehensive context menu covering all rows. For developers who need to frequently manage the order of sessions and workspaces, this is a direct efficiency booster.

Project URL: https://github.com/boyl/dsh-sidebar-pins

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

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

Xiaoye