Introduction¶
In DSH Web, when iterating on requirements with the model, there are frequent moments of pointing out specific sentences. The current approach usually involves copying a quote, pasting it into the input box, manually adding the > prefix, and typing a few explanations. If the quote line is wrong or the prefix is missing, the model can’t read the context; as the conversation gets long, referencing an early message relies on copying the whole block.
The plugin introduced below automates this process: select text, write an annotation, and it attaches as a chip to the input box, sent with the next message. The model receives a standardized quote block, while the UI shows a compact capsule.
What is it¶
dsh-inline-comment is a DSH Web client plugin maintained by proto-commons, used to create annotations based on selection within a session. It exists solely on the client side, without a Host-side service, tool, or prompt, and does not change the session format.
It solves the problem of turning “referencing a sentence + explaining why it needs to change” from a manual paste into a single selection action, ensuring the text structure sent is stable and the UI doesn’t scatter large quote blocks.
Installation and Enablement¶
This is intended for environments with an existing DSH profile (with Web client). The install command comes from the README:
plugin_manager install_bundle
target: /path/to/dsh-inline-comment
target points to the absolute path of the local checkout, for example ~/protocom/dsh-inline-comment. After installation, the Web window needs to be reloaded; a full DSH restart is only required if the client bundle revision hasn’t refreshed.
Usage Flow¶
- Drag-select any text in the session (messages, replies, tool outputs), release, and an
Annotatecapsule appears next to the selection. - Click the capsule, write the annotation in the card, and submit by pressing
Enter(or⌘/Ctrl+Enter). The quote is fixed in the card; the chip remains after the message is sent.Shift+Entercreates a new line,Esccancels. - The chip is appended to the end of the input box, with the cursor following it.
Backspacedeletes the whole chip. Hovering or clicking the chip allows reviewing the quote and annotation. - After sending, the text received by the model is:
> the selected sentence (up to 320 characters)
>
> Annotation: why it needs to change
Configuration¶
| Setting | Default | Location |
|---|---|---|
| Submit Shortcut | Enter to submit, Shift+Enter for new line |
Settings → General → Comment shortcut |
| Alternative | ⌘/Ctrl+Enter to submit, Enter for new line |
Same row |
| Quote Limit | 320 characters | MAX_QUOTE in client.js |
| Comment Limit | 4000 characters | MAX_COMMENT in client.js |
Shortcut preferences are stored in browser localStorage["dsh.inline-comment.submit-mode"] (enter or mod) and take effect immediately upon switching.
Implementation¶
The plugin mounts at several extension points on the client:
| UI Element | Extension Point |
|---|---|
| Floating capsule, edit card, preview card | shell.overlay |
Composer bridge (inputActions, useInput) |
conversation.input.overlay |
| Real reference chip | Session-level slash/input-insert-reference + inputTriggers source |
| Chip on sent messages | uiConversation.userText rule + conversation.user.text.node |
| Shortcut row | settings.general.item |
The process of appending annotations to the end of the draft is: calculate the draft end detect offset (a quote chip counts as one character, a command chip counts as claim.token), then insert via the same path as the @file selector. The chip’s ref stores the quote and annotation in base64url JSON, allowing the draft to be saved, previewed, and restored after reload. When sending, the plugin serializer expands the chip into a quote block; during rendering, the user-text rule re-recognizes it as a capsule.
Regarding the project structure, client.js handles UI, chip source, sent message rules, and the settings row; index.js is a Host-side no-op; cordis.patch.yml is the bundle insertion line. Since the profile installs this directory as a link, editing client.js has no build step; check syntax with node --check client.js, then reload the Web window. If changes don’t take effect, restart DSH to rebuild the client bundle. The preview image in the README is a design mock, not a real session screenshot; actual rendering follows the host theme.
Scenarios and Notes¶
This is suitable for developers who need to frequently point out specific sentence issues in long DSH Web sessions, wanting annotations to move with messages without polluting the bubbles. The plugin is a pure client-side implementation, does not rely on extra runtime, UI text switches between zh/en based on client locale, and requires zero configuration.
Points to note: the plugin is based on the DSH desktop client build included with 0.2.1-rc.5 and only takes effect on the client. The chip reuses the composer’s reference-chip shell (appearance: file) and hides the file icon using scoped CSS rules; if the host modifies that DOM, the chip falls back to the file icon, but functionality still works. Recognition of sent messages is text-level: any handwritten > quote + > annotation: ... block is rendered as a chip, which is intentional and consistent with the recognition method of @file. Another limitation is: if the draft still contains an annotation chip when the plugin is uninstalled, that draft cannot be sent; the chip must be deleted first. The quote is truncated to 320 characters before entering the chip, and the annotation to 4000 characters.
The plugin runs with the permissions of the current DSH process. It is recommended to check the source code and MIT license (client.js, index.js, cordis.patch.yml, etc.) before installing. It is a third-party plugin in the community directory and has no official affiliation with DeepSeek / Huafan.
Summary¶
dsh-inline-comment compresses quote annotations in a session into a single selection action. Chips remain consistent across the input box, sent messages, and hover preview. The model still receives readable quote blocks. The directory page is at https://www.skillhub.cn/plugins/proto-commons/dsh-inline-comment, and the source code is at https://github.com/proto-commons/dsh-inline-comment.