dsh-selection-toolbar: Dialogue Text Selection Citation and Sidebar Branching

Introduction

When chatting with models in DeepSeek Harness (DSH), there are two common needs: extracting a sentence from past replies to carry over in the next round, or opening a side discussion on a specific conclusion without interrupting the main thread. Manual copy-paste is possible, but the input box easily gets filled with long text, and the model might not clearly see which round the sentence came from. The client plugin dsh-selection-toolbar (maintainer flyhye) targets Web/Desktop UIs. After selecting text, a floating bar appears, supporting “Add to Chat” and “Side Discussion” paths.

What is This

dsh-selection-toolbar is a client plugin for DSH: it displays a toolbar following the selection after text is selected in the conversation transcript. It can write the selection into the input box as numbered citation chips (#1, #2…), and when sent, it expands into the original text with turn tracing. It can also fork the current Session to the right sidebar to continue the conversation independently. The plugin targets Harness 0.2.x Web and Desktop, license MIT (see repo package.json current version 1.3.0).

Community directory page: skillhub.cn/plugins/flyhye/dsh-selection-toolbar. Source code: github.com/flyhye/dsh-selection-toolbar. The directory site is a community ecosystem site with no official affiliation to DeepSeek/Huafang; DSH itself follows the “everything is a plugin” extension model.

Core Features

Below summarizes the behavior already explained in the README, without expanding implementation details.

Selection Toolbar and Citation Chips

  1. A toolbar floats near the selection when the selection changes; if there isn’t enough space above, it automatically flips to below to minimize obstruction of the body text.
  2. Add to Chat: Inserts a short form #N summary... into the composer. Repeated references of the same text reuse the same number; if insertion fails, the number is rolled back to avoid skipping numbers.
  3. Send Expand: What is actually sent to the model is in the form [#N] (Turn T) Original Text, preserving the number and indicating the source turn (turn marker is only included if the selection is within a single turn; cross-turn selections do not have a turn marker to avoid mislabeling).
  4. If a single citation exceeds 1500 characters, it will be truncated with a prompt before writing; the excess part is marked as …[+N].

Side Discussion

When Side Discussion is selected, the plugin forks the current session (including history) to the right sidebar. The main conversation continues unaffected; reopening the same fork reuses the same sidebar tab. It requires that turns have already been completed in the session—if the first reply hasn’t finished, it prompts to try again later. Forked sessions remain in the session list just like native host branches.

Interface and Storage

Copywriting switches with the interface language (CN/EN); styles use host theme tokens, adapting to light/dark themes. The appearance of citation chips is rendered by the host editor; the plugin does not modify styles. Numbering counts and reuse mappings exist in browser localStorage; after switching browsers or clearing site data, numbering restarts from 1 (duplicate numbering may appear in the same session - README notes this does not affect functionality).

Installation and Enablement

Install from GitHub (recommended method in README):

dsh plugin --profile <profile> add github:flyhye/dsh-selection-toolbar

Web example:

dsh plugin --profile web add github:flyhye/dsh-selection-toolbar

Local directory install is suitable for modifying plugin source code: Desktop selects local directory in the plugin page; CLI passes the repository directory to add:

dsh plugin --profile <profile> add <directory_path>

Locally, it lands as a directory junction; changes to files in the repo take effect; only when package.json changes (e.g., version number, dsh.client.inject) does reinstallation need to occur.

It is recommended to browse the repository source code and LICENSE before installing. The plugin runs under current DSH process permissions, consistent with the profile used.

Typical Usage

  1. Open any chat in the installed Web or Desktop client and drag-select a segment of text in the transcript.
  2. After the bar appears, click Add to Chat; the input box will show a #N chip. Supplement your question in the same round and send; on the model side, it sees the complete reference with [#N] and turn explanation.
  3. If you want to conduct a side discussion on the selected content and history, click Side Discussion; the right sidebar opens a forked session, while the main bar input box can still be used for the original thread.
  4. When the reference is long, note the 1500-character limit and truncation prompt; if you need the full text, you can manually shorten the selection before sending or reference multiple times.

The repository docs/assets/demo.gif demonstrates the连贯操作 of selection, chip reference, and sidebar forking.

Use Cases and Notes

Who is it for: Developers who frequently reference past replies to ask questions in DSH; Users who need to precisely insert “a specific sentence from a specific turn” into context but don’t want to clutter the input box with long text; Users who want to open a replica session in the sidebar without narrowing the main conversation.

Design Trade-offs (README Usage Limits):

  • Lightweight design: The original text reference enters the model context with the message; long text will occupy tokens.
  • Tracing depends on data-chat-turn on chat line DOM; cross-turn selections lack turn markers.
  • When the host major version upgrades, internal extension points like shell.overlay, ctx.inputTriggers, ctx.sessions.fork used by the plugin may need adaptation; current description targets 0.2.x.

Conclusion

dsh-selection-toolbar connects “Selection -> Numbered Citation -> Send Expand” and “Session Fork to Right Sidebar” to the default DSH UI, reducing copy-paste and context loss. Installation commands follow the README; for details and demos, see the GitHub repository, and collection information on the SkillHub directory page.

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

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

Xiaoye