Skip to content
dsh.fish
Bundle

dsh-conversation-shortcuts

Add conversation shortcuts including Command+B for the sidebar, Control+Command+N for new sessions, and Command/Ctrl+1–9 navigation.

Source
QChengW
License
MIT
Updated
Updated 6 days ago

Readme

# dsh-conversation-shortcuts

🌏 中文 · [English](./README_EN.md)

为当前 WebUI 增加对话快捷键:

- `Control + Command + N` 新建对话,复用当前工作区的空白对话(没有工作区时进入新建对话视图)。
- `Command + B` 收起或展开侧边栏。
- `⌘/Ctrl + ,` 打开设置。
- `⌘/Ctrl + 1` 到 `⌘/Ctrl + 9` 分别打开左侧会话列表中的第 1 到第 9 个非空对话。

快捷键按当前左侧 DOM 顺序解析,因此会跟随工作区分组、搜索结果和当前可见行;折叠分组中的会话会排在可见行之后,仍可通过后续数字键访问。设置页中的“对话快捷键”页面也会显示这些功能。

注意:Chromium 系浏览器通常把 `⌘1` 到 `⌘9` 保留给标签页切换;如果浏览器先拦截组合键,网页插件无法收到该事件,此时需要使用 `Ctrl1–9` 或改用带 Option 的组合键。

## 安装

**前置条件**:已安装 DSH,并且 `dsh web` 可以正常运行。

从 npm 安装最新版:

```sh
dsh plugin --profile web add dsh-conversation-shortcuts@latest
```

然后硬刷新 WebUI(`Cmd/Ctrl + Shift + R`)。如果修改了插件的 host 配置或 `cordis.patch.yml`,请重启 Web 进程。

### 从源码安装

```sh
git clone https://github.com/QChengW/dsh-conversation-shortcuts.git
pnpm exec dsh plugin --profile web add link:./dsh-conversation-shortcuts
```

修改插件后,重启 Web 进程使 profile patch 和浏览器 bundle 重新加载。

## 发布

本项目同时发布在 GitHub 和 npm:

- GitHub:https://github.com/QChengW/dsh-conversation-shortcuts
- npm:https://www.npmjs.com/package/dsh-conversation-shortcuts

Install

dsh plugin --profile web add github:QChengW/dsh-conversation-shortcuts#045acf1d2372ffefc82af4f24c353199e282a505

Profile: web

Source