Skip to content

Releases: wuwaka/dsh-clipboard-menu

dsh-clipboard-menu v0.2.0

Choose a tag to compare

@wuwaka wuwaka released this 11 Sep 08:48

新增

  • 每个菜单项都配了图标 —— 线性风格、跟随主题文字颜色
  • 搜索:选中文字后直接用默认浏览器搜索
    • 菜单右侧标出当前引擎
    • 「搜索引擎…」可切换 百度 / Bing / Google / DuckDuckGo,选择记进 localStorage,一次选定永久生效
    • 首次使用按界面语言猜:中文 → 百度,其他 → Google
    • 浏览器不用配window.open 经桌面端 shell.openExternal 交给操作系统默认浏览器
  • 只读区域(AI 回复 / 文档预览 / 代码块)同样支持搜索

菜单顺序

可编辑:剪切 / 复制 / 粘贴 / 全选 → 分隔线 → 搜索 / 搜索引擎…

工程

  • 修正了 package.json 与仓库描述(此前只写了输入框,漏了只读复制)
  • 新增 CI:node 22/24 × ubuntu/windows,跑 34 项冒烟测试
  • 声明 engines.node >= 22(jsdom 30 与 DSH 自身都要求 22+)

安装

dsh plugin --profile <profile> add github:wuwaka/dsh-clipboard-menu#v0.2.0

Added

  • An icon on every entry — outline style, following the menu's text colour
  • Search: send the selection to your default browser
    • the current engine is shown on the right
    • "Search engine…" switches between Baidu / Bing / Google / DuckDuckGo; the pick is stored in localStorage and sticks
    • before any pick, the guess follows the UI language: Chinese → Baidu, otherwise Google
    • no browser configuration needed: window.open goes through the desktop shell's shell.openExternal to your OS default browser
  • Read-only surfaces (AI replies, document previews, code blocks) get search too

Menu order

Composer: cut / copy / paste / select all → separator → search / search engine…

Engineering

  • Corrected the package.json and repository description, which still only mentioned the composer
  • Added CI: node 22/24 on ubuntu and windows, running 34 smoke assertions
  • Declared engines.node >= 22 (both jsdom 30 and DSH require 22+)

Full changelog: v0.1.1...v0.2.0

dsh-clipboard-menu v0.1.1

Choose a tag to compare

@wuwaka wuwaka released this 11 Sep 08:21

修复

  • 菜单不再被滚动关掉。 此前插件在文档级监听了 scroll,菜单一弹出就被关闭——菜单是固定定位、不随内容移动,而对话区在一轮流式输出时会持续滚动。现已删除该监听;关闭条件保留「菜单外点击 / Esc / 窗口失焦 / 窗口缩放」。

安装

dsh plugin --profile <profile> add github:wuwaka/dsh-clipboard-menu#v0.1.1

Fixes

  • The menu is no longer closed by scrolling. The plugin used to listen for scroll at the document level, which closed the menu the instant it opened: a fixed-position menu does not move with the content, and the conversation scrolls continuously while a turn streams. That listener is gone; closing still happens on an outside mousedown, Esc, window blur and resize.

Install

dsh plugin --profile <profile> add github:wuwaka/dsh-clipboard-menu#v0.1.1

Full changelog: v0.1.0...v0.1.1

dsh-clipboard-menu v0.1.0

Choose a tag to compare

@wuwaka wuwaka released this 11 Sep 08:13

dsh-clipboard-menu v0.1.0

首个版本,为 DeepSeek Harness 补上缺失的右键菜单。

功能

  • 输入框右键菜单:剪切 / 复制 / 粘贴 / 全选;无选区时剪切与复制自动置灰
  • 只读区域复制:在 AI 回复、文档预览、代码块里选中文字后右键,可选「复制」或「复制为纯文本」
  • 粘贴适配编辑器:Lexical(contenteditable)走合成 ClipboardEvent('paste') + DataTransfer;React 受控的 <input> / <textarea> 走原生 value setter + input 事件;xterm 同样走合成 paste
  • 选区保全:剪切/复制前恢复右键那一刻保存的选区(contenteditable 用 Range,输入框用 selectionStart/End
  • 不越界:只接管「可编辑字段」与「有选区的只读内容」,应用与其他插件自己的右键菜单不受影响

生效范围

只在没有原生右键菜单的外壳里生效(DSH Desktop 的 dsh-desktop-* URL 标记与 preload 桥,以及其他 Electron、Tauri 外壳)。普通浏览器保留原生菜单,插件完全不安装监听器。

安装

dsh plugin --profile <profile> add github:wuwaka/dsh-clipboard-menu

测试

21 项 jsdom 断言全部通过(node test/smoke.cjs)。


English

First release. Fills the right-click menu gap in DeepSeek Harness.

Features

  • Composer menu: Cut / Copy / Paste / Select All, with Cut and Copy greyed out when nothing is selected
  • Copy from read-only surfaces: select text in an AI reply, document preview or code block and right-click for Copy or Copy as plain text
  • Editor-aware paste: Lexical (contenteditable) gets a synthetic ClipboardEvent('paste') with a DataTransfer; React-controlled <input> / <textarea> go through the native value setter plus an input event; xterm gets the same synthetic paste
  • Selection preservation: the selection captured at right-click time is restored before cutting or copying (a Range for contenteditable, selectionStart/End for inputs)
  • Stays out of the way: only editable fields and read-only content with a selection are intercepted; context menus the app or other plugins provide are untouched

Scope

Activates only in shells with no native context menu (the DSH Desktop dsh-desktop-* URL markers and preload bridge, plus other Electron and Tauri shells). A plain browser keeps its own menu; the listener is never installed there.

Install

dsh plugin --profile <profile> add github:wuwaka/dsh-clipboard-menu

Test

All 21 jsdom assertions pass (node test/smoke.cjs).