dsh-side-memo 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -16
- package/README.zh-CN.md +20 -16
- package/README.zh-TW.md +20 -16
- package/client.js +4484 -3974
- package/index.js +10 -2
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
A lightweight, toggleable **right-side notes panel** for [DeepSeek Harness](https://deepseek.com/harness). Jot memos while you chat — text, inline images, and labels — copy them with one click, star favorites to keep them pinned at the top, and move everything in or out as an Excel workbook.
|
|
10
10
|
|
|
11
11
|
[](LICENSE)
|
|
12
|
-

|
|
13
|
+
[](https://www.npmjs.com/package/dsh-side-memo)
|
|
13
14
|
[](https://github.com/r48n34/dsh-side-memo/actions/workflows/ci.yml)
|
|
14
15
|

|
|
15
16
|

|
|
@@ -18,22 +19,22 @@ A lightweight, toggleable **right-side notes panel** for [DeepSeek Harness](http
|
|
|
18
19
|
|
|
19
20
|
## Install
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
`dsh-side-memo` is [published on npm](https://www.npmjs.com/package/dsh-side-memo). Install it through your DSH profile:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
dsh plugin --profile web add
|
|
25
|
+
dsh plugin --profile web add dsh-side-memo
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
The same plugin can also be installed straight from this repository — use the GitHub form when you need a commit that is not on npm yet, or when npm is unreachable:
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
dsh plugin --profile web add dsh-side-memo
|
|
31
|
+
dsh plugin --profile web add github:r48n34/dsh-side-memo
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
If your DSH runs the Desktop profile, use the profile name shown in **Settings → Plugins** (for the Desktop app this is usually `desktop`):
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
|
-
dsh plugin --profile desktop add
|
|
37
|
+
dsh plugin --profile desktop add dsh-side-memo
|
|
37
38
|
```
|
|
38
39
|
|
|
39
40
|
After installing, the **Side Memo** icon is already available in the Session header — at the header's right edge, including before any Session exists (the first screen) and on the new-Session welcome screen. Open it from there, from the Session header's right-side utilities, or from the right sidebar's add/guide control. If the icon does not appear, restart DSH once so the new plugin bundle is loaded.
|
|
@@ -46,6 +47,7 @@ To remove it, use **Settings → Plugins** in DSH (or the equivalent `dsh plugin
|
|
|
46
47
|
- **Drag into chat:** Drag a memo from the list onto the chat box to paste its text into the message you are writing.
|
|
47
48
|
- **Stay organized:** Search notes, add labels, filter or group by label, and pin favorites.
|
|
48
49
|
- **Add images:** Paste or drag images into notes, or use the image button.
|
|
50
|
+
- **Resize images:** Select an inline image for a Photoshop-style transform box, then drag a handle, nudge with the arrow keys, or reset it to its original size.
|
|
49
51
|
- **Copy and transfer:** Copy notes in one click; import or export notes as Excel workbooks.
|
|
50
52
|
- **Save locally:** Notes and images stay in your browser and are available across Sessions.
|
|
51
53
|
|
|
@@ -53,11 +55,11 @@ To remove it, use **Settings → Plugins** in DSH (or the equivalent `dsh plugin
|
|
|
53
55
|
|
|
54
56
|
1. Click the **Side Memo** icon at the right of the conversation header to open or close the panel.
|
|
55
57
|
2. Click **New** and start writing. Changes save automatically; you can also create a note from the editor.
|
|
56
|
-
3. Add labels below the title, or paste, drag in, or insert an image. Use the star to pin a favorite and the copy icon to copy a note.
|
|
58
|
+
3. Add labels below the title, or paste, drag in, or insert an image. Click an image to select it: a brand-colored outline, eight resize handles and a `W × H` size badge appear. Drag a handle to resize — corners and edges keep the aspect ratio, `Shift`-drag distorts freely and `Alt`-drag resizes from the center — press the arrow keys to step by 8 px (`Shift`+arrow changes one axis only), and double-click the image or click the overlay's reset button to restore its original size. Press `Escape` or click elsewhere in the editor to deselect it. Use the star to pin a favorite and the copy icon to copy a note.
|
|
57
59
|
4. Search or use the label filters and **Group by label** to find notes. Use the toolbar's import/export icons to transfer notes as `.xlsx` files.
|
|
58
60
|
5. While writing a message, drag a memo from the list onto the chat box; its text is inserted at the caret in your draft, and the memo's images stay in the panel.
|
|
59
61
|
|
|
60
|
-
Imports add new notes without overwriting existing ones. Images remain local and are not included in Excel exports.
|
|
62
|
+
Imports add new notes without overwriting existing ones. Images remain local and are not included in Excel exports. An image's chosen display size is saved with the memo, so it survives reloads; resizing only changes how the stored image is shown, not the stored image itself.
|
|
61
63
|
|
|
62
64
|
## Compatibility
|
|
63
65
|
|
|
@@ -65,7 +67,7 @@ Imports add new notes without overwriting existing ones. Images remain local and
|
|
|
65
67
|
- Web GUI and Desktop (Electron/Chromium). The client half relies on standard browser APIs: `localStorage`, IndexedDB, Clipboard, File API, `Blob`/`URL`, Canvas, and `DecompressionStream('deflate-raw')` for reading compressed `.xlsx` files.
|
|
66
68
|
- Uses the shipped right-sidebar plugin API (`@deepseek-ai/dsh-client-ui-sidebar-right`); the panel is a normal right-sidebar tab, so a Session is required to host it. Before any Session exists the same notes UI is rendered by the plugin itself in the frame-level overlay layer (`shell.overlay`). In the pre-Session and new-Session phases the toggle mounts through the resident header's `conversation.header.leading` seat and positions itself at the header's right edge from the live header/panel-toggle geometry.
|
|
67
69
|
- Uses the conversation client's composer insertion API (`inputActions`) to paste a dragged memo into the chat draft as a single undoable edit.
|
|
68
|
-
-
|
|
70
|
+
- TypeScript sources live under `src/`; `client.js` and `index.js` are the compiled browser and Host modules committed to the repository, so installing or running the plugin never needs a build step.
|
|
69
71
|
|
|
70
72
|
## Permissions & privacy
|
|
71
73
|
|
|
@@ -83,29 +85,31 @@ Imports add new notes without overwriting existing ones. Images remain local and
|
|
|
83
85
|
- Text is plain text (no Markdown or rich-text formatting); images are the only rich content. Images are downscaled before storage and are not exported to Excel — the `Images` column only holds a count.
|
|
84
86
|
- Image support needs IndexedDB and Canvas. If the browser blocks IndexedDB, the text memos keep working and image insertion is disabled.
|
|
85
87
|
- Excel import reads the first worksheet only; formulas import as their cached values, and rich-text cell formatting is ignored.
|
|
86
|
-
- Limits: 300 memos, 120-character titles, 8,000-character bodies, 12 labels per memo (24 characters each), 20 images per memo (source images up to 24 MB, downscaled to at most 1,400 px at quality 0.82 before storage), 8 MB `.xlsx` imports (up to 32 MB expanded across at most 64 entries), and a 60 MB total image budget for the browser.
|
|
88
|
+
- Limits: 300 memos, 120-character titles, 8,000-character bodies, 12 labels per memo (24 characters each), 20 images per memo (source images up to 24 MB, downscaled to at most 1,400 px at quality 0.82 before storage; display sizes 24–1,400 px), 8 MB `.xlsx` imports (up to 32 MB expanded across at most 64 entries), and a 60 MB total image budget for the browser.
|
|
87
89
|
- Labels are flat tags — no nesting, per-label colors, or separate tag manager — and each label is stored per memo, so renaming one means editing every memo that carries it.
|
|
88
90
|
- Favorites are pinned within the memo list; there is no separate favorites-only view yet.
|
|
89
91
|
|
|
90
92
|
## Development
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
TypeScript sources live under `src/` and compile to the committed `client.js` / `index.js` with the TypeScript compiler only (no bundler):
|
|
93
95
|
|
|
94
96
|
| File | Role |
|
|
95
97
|
|---|---|
|
|
96
98
|
| `package.json` | Bundle/client manifest (`dsh.bundle` patch and `dsh.client` browser module) |
|
|
97
99
|
| `cordis.patch.yml` | Inserts the `dsh-side-memo` Loader row |
|
|
98
|
-
| `index.js` | Host half (no-op `apply`) |
|
|
99
|
-
| `client.js` | Notes panel, tab type, always-available header toggle, pre-Session drawer, localStorage + IndexedDB store, inline-image editor, label tags/filter/grouping, editor top-bar new-memo button, drag-memo-to-composer paste, `.xlsx` import/export |
|
|
100
|
+
| `index.js` | Host half (no-op `apply`; generated from `src/host/index.ts`) |
|
|
101
|
+
| `client.js` | Notes panel, tab type, always-available header toggle, pre-Session drawer, localStorage + IndexedDB store, inline-image editor with the resize/transform overlay, label tags/filter/grouping, editor top-bar new-memo button, drag-memo-to-composer paste, `.xlsx` import/export (generated from `src/client/`) |
|
|
102
|
+
| `src/` | TypeScript sources for both halves |
|
|
103
|
+
| `tsconfig.json`, `scripts/build.mjs` | Type-check configuration and the `yarn build` script |
|
|
100
104
|
| `locale/en.json`, `locale/zh.json` | Plugin Manager title and description |
|
|
101
105
|
| `icon.svg` | Plugin artwork |
|
|
102
106
|
|
|
103
|
-
Load it into a profile with the DSH Plugin Manager (`install_bundle` on this directory) or install it with the commands in [Install](#install). Package contents are limited to the files
|
|
107
|
+
Load it into a profile with the DSH Plugin Manager (`install_bundle` on this directory) or install it with the commands in [Install](#install). Package contents are limited to the published files — `index.js`, `client.js`, the locale files, `icon.svg`, `package.json` and `cordis.patch.yml`. The TypeScript sources, build script and config never ship, and the published tarball only adds the three READMEs and the LICENSE.
|
|
104
108
|
|
|
105
109
|
### Tests
|
|
106
110
|
|
|
107
|
-
- Unit tests: `
|
|
108
|
-
- Browser e2e (optional, dev-only; not part of `
|
|
111
|
+
- Unit tests: `yarn test` runs `node --test` on Node.js **>=22** after rebuilding the artifacts (`pretest`). Run `yarn install` once for the build toolchain — `typescript` and `@types/react` are the only dev dependencies and the published package has none — then the suite exercises the real helpers in the compiled `client.js`.
|
|
112
|
+
- Browser e2e (optional, dev-only; not part of `yarn test`): see [`test/e2e/README.md`](test/e2e/README.md) for the isolated-profile harness and its suites.
|
|
109
113
|
- CI runs the unit suite on every push and pull request: [`.github/workflows/ci.yml`](.github/workflows/ci.yml).
|
|
110
114
|
|
|
111
115
|
## License
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
一个轻量、可开关的 **右侧便签面板**,为 [DeepSeek Harness](https://deepseek.com/harness) 打造。聊天时随手记下内容——文字、内嵌图片和标签——一键复制,收藏常用便签让它始终置顶,还能把所有便签整体导入或导出为 Excel 工作簿。
|
|
10
10
|
|
|
11
11
|
[](LICENSE)
|
|
12
|
-

|
|
13
|
+
[](https://www.npmjs.com/package/dsh-side-memo)
|
|
13
14
|
[](https://github.com/r48n34/dsh-side-memo/actions/workflows/ci.yml)
|
|
14
15
|

|
|
15
16
|

|
|
@@ -18,22 +19,22 @@
|
|
|
18
19
|
|
|
19
20
|
## 安装
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
`dsh-side-memo` 已[发布到 npm](https://www.npmjs.com/package/dsh-side-memo)。通过你的 DSH 配置(profile)安装:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
dsh plugin --profile web add
|
|
25
|
+
dsh plugin --profile web add dsh-side-memo
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
也可以直接从本仓库安装——当需要的提交尚未发布到 npm,或无法访问 npm 时,使用 GitHub 形式:
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
dsh plugin --profile web add dsh-side-memo
|
|
31
|
+
dsh plugin --profile web add github:r48n34/dsh-side-memo
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
如果你的 DSH 运行的是 Desktop 配置(profile),请使用 **设置 → 插件** 中显示的配置名(Desktop 应用通常是 `desktop`):
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
|
-
dsh plugin --profile desktop add
|
|
37
|
+
dsh plugin --profile desktop add dsh-side-memo
|
|
37
38
|
```
|
|
38
39
|
|
|
39
40
|
安装后,**侧边便签** 图标就已经在会话标题栏上——位于标题栏右端,包括还没有任何会话时(首屏)以及新会话欢迎页。可以从这里打开它,也可以从会话标题栏右侧的功能区,或右侧边栏的添加/引导控件打开。如果没有看到图标,请重启一次 DSH,让新的插件包完成加载。
|
|
@@ -45,6 +46,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
45
46
|
- **便签面板** —— 通过标题栏开关打开;有会话时显示在右侧边栏,没有会话时显示浮动抽屉。
|
|
46
47
|
- **编辑与收藏** —— 自动保存便签;收藏置顶,其余按更新时间排序。编辑器可直接新建便签,并复用空白草稿;删除需二次确认。
|
|
47
48
|
- **内嵌图片** —— 粘贴、插入或拖放图片;图片缩小后保存在本地,可在编辑器中移除。
|
|
49
|
+
- **调整图片大小** —— 点选内嵌图片会出现 Photoshop 式变换框,可拖动手柄、用方向键微调,或一键还原原始大小。
|
|
48
50
|
- **标签与搜索** —— 搜索标题、正文和标签;可按多个标签同时筛选或按标签分组。每条便签最多 12 个标签,每个最多 24 个字符,重复标签不区分大小写。
|
|
49
51
|
- **快速复制** —— 复制正文,正文为空时复制标题;只有图片的便签复制第一张图片。
|
|
50
52
|
- **拖入聊天框** —— 把列表中的便签直接拖到聊天输入框上,正文会粘贴到正在编辑的消息里。
|
|
@@ -54,7 +56,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
54
56
|
## 使用方法
|
|
55
57
|
|
|
56
58
|
1. 点击标题栏右端的 **侧边便签** 图标。没有会话时打开浮动抽屉,可按 `Esc` 或点击关闭按钮收起;建立会话后便签会移至右侧边栏。
|
|
57
|
-
2. 点击 **新建**,输入标题和正文,编辑会自动保存。编辑器顶栏也可直接新建便签。粘贴、拖放图片或使用图片按钮添加图片;悬停图片并点击 **×**
|
|
59
|
+
2. 点击 **新建**,输入标题和正文,编辑会自动保存。编辑器顶栏也可直接新建便签。粘贴、拖放图片或使用图片按钮添加图片;悬停图片并点击 **×** 可移除。点击图片即可选中:会出现品牌色边框、8 个缩放手柄和 `W × H` 尺寸标记;拖动手柄缩放(角和边默认保持宽高比,按住 `Shift` 自由变形,按住 `Alt` 从中心缩放),按方向键每次调整 8 px(`Shift`+方向键只调整单轴),双击图片或点击浮层上的还原按钮可恢复原始大小。按 `Esc` 或点击编辑器其他位置即可取消选择。
|
|
58
60
|
3. 在 **添加标签…** 中输入标签,按 `Enter`、输入 `,` 或点击别处提交;点击标签的 **×** 可移除。列表支持搜索、标签筛选和分组;多选标签时仅显示包含全部所选标签的便签,**全部标签** 可清除筛选。
|
|
59
61
|
4. 点击便签编辑,用星标收藏或复制图标复制。工具栏可导出全部便签到 `side-memo-YYYY-MM-DD.xlsx`,或追加导入首个工作表;标题和正文均为空的行会跳过,文件上限为 8 MB。
|
|
60
62
|
5. 写消息时可以直接把便签从列表拖到聊天输入框:正文会插入到当前光标位置,便签中的图片不会随文字一起粘贴。
|
|
@@ -66,7 +68,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
66
68
|
- Web GUI 与 Desktop(Electron/Chromium)。客户端部分只依赖标准浏览器 API:`localStorage`、IndexedDB、Clipboard、File API、`Blob`/`URL`、Canvas,以及用于读取压缩 `.xlsx` 文件的 `DecompressionStream('deflate-raw')`。
|
|
67
69
|
- 使用内置的右侧边栏插件 API(`@deepseek-ai/dsh-client-ui-sidebar-right`);面板是标准的右侧边栏标签页,因此需要一个会话来承载它。在任何会话出现之前,同一套便签界面由插件自己在框架级覆盖层(`shell.overlay`)中渲染。在会话建立前和新会话阶段,开关通过常驻标题栏的 `conversation.header.leading` 位置挂载,并根据实时的标题栏/面板开关几何信息把自己定位到标题栏右端。
|
|
68
70
|
- 使用会话客户端的输入框插入 API(`inputActions`)把拖入的便签作为一次可撤销的编辑写入聊天草稿。
|
|
69
|
-
-
|
|
71
|
+
- TypeScript 源码位于 `src/`;`client.js` 与 `index.js` 是由源码编译并提交到仓库的浏览器/宿主模块,因此安装或运行插件都不需要构建步骤。
|
|
70
72
|
|
|
71
73
|
## 权限与隐私
|
|
72
74
|
|
|
@@ -81,32 +83,34 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
81
83
|
- 仅支持浏览器本地存储:不支持跨设备或跨浏览器同步。
|
|
82
84
|
- 没有会话时,便签会在插件自带的浮动抽屉中打开(右侧边栏本身是会话级的);抽屉和右侧边栏标签页是同一套便签的不同宿主。
|
|
83
85
|
- 拖入聊天框需要已建立会话且输入框可编辑;只会粘贴便签的纯文本,图片和标签不会随文字一起粘贴。
|
|
84
|
-
- 文本是纯文本(不支持 Markdown 或富文本格式);图片是唯一的富内容。图片在保存前会被缩小,也不会导出到 Excel——`Images`
|
|
86
|
+
- 文本是纯文本(不支持 Markdown 或富文本格式);图片是唯一的富内容。图片在保存前会被缩小,也不会导出到 Excel——`Images` 列只记录数量。所选显示尺寸随便签保存,刷新后仍会保留;它只改变图片的显示方式,不会重新编码或替换已保存的图片。
|
|
85
87
|
- 图片功能依赖 IndexedDB 和 Canvas。如果浏览器禁用了 IndexedDB,文字便签仍可正常使用,但插入图片会被禁用。
|
|
86
88
|
- Excel 导入只读取第一个工作表;公式按其缓存值导入,富文本单元格格式会被忽略。
|
|
87
|
-
- 上限:300 条便签、标题 120 字符、正文 8,000 字符、每条便签 12 个标签(每个 24 字符)、每条便签 20 张图片(单张源图片不超过 24 MB,保存前会缩小到最长边 1,400 像素、质量 0.82
|
|
89
|
+
- 上限:300 条便签、标题 120 字符、正文 8,000 字符、每条便签 12 个标签(每个 24 字符)、每条便签 20 张图片(单张源图片不超过 24 MB,保存前会缩小到最长边 1,400 像素、质量 0.82,显示尺寸限制在 24–1,400 像素)、`.xlsx` 文件 8 MB(解压后总量不超过 32 MB,压缩包内最多 64 个条目),以及浏览器图片总量 60 MB。
|
|
88
90
|
- 标签是扁平标签——不支持层级、按标签着色或独立的标签管理器——而且每个标签都按便签单独存储,所以重命名一个标签意味着要编辑所有带有它的便签。
|
|
89
91
|
- 收藏只是固定在便签列表内;目前还没有单独的“仅收藏”视图。
|
|
90
92
|
|
|
91
93
|
## 开发
|
|
92
94
|
|
|
93
|
-
|
|
95
|
+
TypeScript 源码位于 `src/`,仅用 TypeScript 编译器(不含打包器)编译为提交在仓库中的 `client.js` 与 `index.js`:
|
|
94
96
|
|
|
95
97
|
| 文件 | 作用 |
|
|
96
98
|
|---|---|
|
|
97
99
|
| `package.json` | Bundle/客户端清单(`dsh.bundle` 补丁与 `dsh.client` 浏览器模块) |
|
|
98
100
|
| `cordis.patch.yml` | 插入 `dsh-side-memo` 的 Loader 行 |
|
|
99
|
-
| `index.js` | 宿主部分(空的 `apply
|
|
100
|
-
| `client.js` | 便签面板、标签页类型、始终可用的标题栏开关、会话前抽屉、localStorage + IndexedDB
|
|
101
|
+
| `index.js` | 宿主部分(空的 `apply`;由 `src/host/index.ts` 生成) |
|
|
102
|
+
| `client.js` | 便签面板、标签页类型、始终可用的标题栏开关、会话前抽屉、localStorage + IndexedDB 存储、内嵌图片编辑器(含缩放/变换浮层)、标签筛选/分组、编辑器顶栏新建按钮、拖入聊天框粘贴、`.xlsx` 导入/导出(由 `src/client/` 生成) |
|
|
103
|
+
| `src/` | 两部分的 TypeScript 源码 |
|
|
104
|
+
| `tsconfig.json`、`scripts/build.mjs` | 类型检查配置与 `yarn build` 脚本 |
|
|
101
105
|
| `locale/en.json`、`locale/zh.json` | 插件管理器的标题和描述 |
|
|
102
106
|
| `icon.svg` | 插件图标 |
|
|
103
107
|
|
|
104
|
-
可以用 DSH 插件管理器(对本目录调用 `install_bundle`)把它加载到某个配置中,或用 [安装](#安装)
|
|
108
|
+
可以用 DSH 插件管理器(对本目录调用 `install_bundle`)把它加载到某个配置中,或用 [安装](#安装) 中的命令安装。包内容仅限上表列出的运行时文件——源码与构建脚本不会进入发布包,npm tarball 只是在这些运行时资源之外附带三个 README 和 LICENSE。
|
|
105
109
|
|
|
106
110
|
### 测试
|
|
107
111
|
|
|
108
|
-
- 单元测试:`
|
|
109
|
-
- 浏览器端到端测试(可选,仅开发使用,不包含在 `
|
|
112
|
+
- 单元测试:`yarn test` 会先重新构建(`pretest`),再用 Node.js 内置的 `node --test` 运行(需要 Node.js **>=22**)。首次运行请执行一次 `yarn install` 安装构建工具链——开发依赖仅有 `typescript` 与 `@types/react`,发布的包本身没有依赖——测试会直接调用编译后的 `client.js` 中的真实辅助函数。
|
|
113
|
+
- 浏览器端到端测试(可选,仅开发使用,不包含在 `yarn test` 中):参见 [`test/e2e/README.md`](test/e2e/README.md),了解隔离配置下的测试环境与运行方式。
|
|
110
114
|
- CI 在每次 push 和 pull request 时运行单元测试:[`.github/workflows/ci.yml`](.github/workflows/ci.yml)。
|
|
111
115
|
|
|
112
116
|
## 许可证
|
package/README.zh-TW.md
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
一個輕量、可開關的 **右側便箋面板**,為 [DeepSeek Harness](https://deepseek.com/harness) 打造。聊天時隨手記下內容——文字、內嵌圖片與標籤——一鍵複製,收藏常用便箋讓它始終置頂,還能把所有便箋整批匯入或匯出為 Excel 活頁簿。
|
|
10
10
|
|
|
11
11
|
[](LICENSE)
|
|
12
|
-

|
|
13
|
+
[](https://www.npmjs.com/package/dsh-side-memo)
|
|
13
14
|
[](https://github.com/r48n34/dsh-side-memo/actions/workflows/ci.yml)
|
|
14
15
|

|
|
15
16
|

|
|
@@ -18,22 +19,22 @@
|
|
|
18
19
|
|
|
19
20
|
## 安裝
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
`dsh-side-memo` 已[發佈到 npm](https://www.npmjs.com/package/dsh-side-memo)。透過你的 DSH 設定檔(profile)安裝:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
dsh plugin --profile web add
|
|
25
|
+
dsh plugin --profile web add dsh-side-memo
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
也可以直接從這個儲存庫安裝——當需要的提交尚未發佈到 npm,或無法連線到 npm 時,使用 GitHub 形式:
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
dsh plugin --profile web add dsh-side-memo
|
|
31
|
+
dsh plugin --profile web add github:r48n34/dsh-side-memo
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
如果你的 DSH 執行的是 Desktop 設定檔(profile),請使用 **設定 → 外掛**(Settings → Plugins)中顯示的設定檔名稱(Desktop 應用程式通常是 `desktop`):
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
|
-
dsh plugin --profile desktop add
|
|
37
|
+
dsh plugin --profile desktop add dsh-side-memo
|
|
37
38
|
```
|
|
38
39
|
|
|
39
40
|
安裝後,**側邊便箋** 圖示已經出現在工作階段標題列上——位於標題列最右側,包括尚未建立任何工作階段時(首屏)以及新工作階段歡迎畫面。你可以從那裡開啟它,也可以從工作階段標題列右側的功能區,或右側邊欄的加入/引導控制項開啟。如果沒看到圖示,請重新啟動 DSH 一次,讓新的外掛套件完成載入。
|
|
@@ -45,6 +46,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
45
46
|
- **便箋面板** —— 透過標題列開關開啟;尚無工作階段時使用浮動抽屜,建立後改用右側邊欄分頁。
|
|
46
47
|
- **編輯與收藏** —— 便箋自動儲存;收藏置頂,其餘依更新時間排序。可在編輯器直接新增便箋,空白草稿會被沿用;刪除需按兩次確認。
|
|
47
48
|
- **圖片與複製** —— 可貼上、插入或拖放圖片,圖片會縮小並儲存在本機。複製時使用內文,內文為空時使用標題;只有圖片的便箋會複製第一張圖片。
|
|
49
|
+
- **調整圖片大小** —— 點選內嵌圖片會出現 Photoshop 式變形框,可拖曳控點、用方向鍵微調,或一鍵還原原始大小。
|
|
48
50
|
- **拖入聊天框** —— 把清單中的便箋直接拖到聊天輸入框上,內文會貼到正在編輯的訊息裡。
|
|
49
51
|
- **標籤與搜尋** —— 搜尋標題、內文和標籤;每則最多 12 個標籤、每個最多 24 字元,重複標籤不分大小寫。可篩選同時符合多個標籤的便箋,或依標籤分組。
|
|
50
52
|
- **Excel 匯入 / 匯出** —— 匯出所有便箋為 `.xlsx`,或附加匯入新便箋,不覆寫現有內容。圖片不會匯出,`Images` 欄僅記錄數量。
|
|
@@ -54,7 +56,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
54
56
|
|
|
55
57
|
1. 點標題列最右側的 **側邊便箋** 圖示。尚無工作階段時會開啟浮動抽屜,可按 `Esc` 或關閉按鈕關閉;建立工作階段後會切換至右側邊欄。
|
|
56
58
|
2. 點 **新增**,輸入標題與內文;編輯會自動儲存。編輯器頂端的 **新增** 可直接建立下一則便箋。
|
|
57
|
-
- 貼上、用圖片按鈕插入或拖放圖片;移到圖片上點 **×**
|
|
59
|
+
- 貼上、用圖片按鈕插入或拖放圖片;移到圖片上點 **×** 可移除。點選圖片即可選取:會出現品牌色外框、8 個縮放控點和 `W × H` 尺寸標記;拖曳控點縮放(邊角預設保持長寬比,按住 `Shift` 自由變形,按住 `Alt` 以中心縮放),按方向鍵每次調整 8 px(`Shift`+方向鍵只調整單軸),雙擊圖片或點擊覆蓋層上的還原按鈕可恢復原始大小。按 `Esc` 或點擊編輯器其他位置即可取消選取。
|
|
58
60
|
- 在 **新增標籤…** 輸入標籤,按 `Enter`、輸入逗號或點到別處即可新增;點標籤上的 **×** 可移除。
|
|
59
61
|
3. 點便箋編輯,用星號收藏或複製圖示複製。使用搜尋、標籤篩選或 **依標籤分組** 整理清單;**全部標籤** 可清除篩選。
|
|
60
62
|
4. 用工具列匯入 / 匯出圖示處理 Excel。匯入只讀取第一個工作表、略過標題與內文皆空白的資料列,檔案上限為 8 MB。
|
|
@@ -67,7 +69,7 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
67
69
|
- Web GUI 與 Desktop(Electron/Chromium)。用戶端部分只依賴標準瀏覽器 API:`localStorage`、IndexedDB、Clipboard、File API、`Blob`/`URL`、Canvas,以及用來讀取壓縮 `.xlsx` 檔的 `DecompressionStream('deflate-raw')`。
|
|
68
70
|
- 使用內建的右側邊欄外掛 API(`@deepseek-ai/dsh-client-ui-sidebar-right`);面板是標準的右側邊欄分頁,因此需要一個工作階段來承載它。在任何工作階段出現之前,同一套便箋介面由外掛本身在框架層覆蓋層(`shell.overlay`)中繪製。在工作階段建立前與新工作階段階段,開關會透過常駐標題列的 `conversation.header.leading` 位置掛載,並依即時的標題列/面板開關幾何資訊,把自己定位在標題列最右側。
|
|
69
71
|
- 使用工作階段用戶端的輸入框插入 API(`inputActions`)把拖入的便箋以單次可復原的編輯寫入聊天草稿。
|
|
70
|
-
-
|
|
72
|
+
- TypeScript 原始碼位於 `src/`;`client.js` 與 `index.js` 是由原始碼編譯並提交到儲存庫的瀏覽器/Host 模組,因此安裝或執行外掛都不需要建置步驟。
|
|
71
73
|
|
|
72
74
|
## 權限與隱私
|
|
73
75
|
|
|
@@ -82,32 +84,34 @@ dsh plugin --profile desktop add github:r48n34/dsh-side-memo
|
|
|
82
84
|
- 僅限瀏覽器本機儲存:無法跨裝置或跨瀏覽器同步。
|
|
83
85
|
- 沒有工作階段時,便箋會在外掛自帶的浮動抽屜中開啟(右側邊欄本身是工作階段範圍的);抽屜與右側邊欄分頁是同一套便箋的兩種不同宿主。
|
|
84
86
|
- 拖入聊天框需要已建立工作階段且輸入框可編輯;只會貼上便箋的純文字,圖片與標籤不會隨文字一起貼上。
|
|
85
|
-
- 文字為純文字(不支援 Markdown 或富文字格式);圖片是唯一的豐富內容。圖片在儲存前會先縮小,也不會匯出到 Excel——`Images`
|
|
87
|
+
- 文字為純文字(不支援 Markdown 或富文字格式);圖片是唯一的豐富內容。圖片在儲存前會先縮小,也不會匯出到 Excel——`Images` 欄只記錄數量。所選顯示尺寸會隨便箋儲存,重新載入後仍會保留;它只改變圖片的顯示方式,不會重新編碼或取代已儲存的圖片。
|
|
86
88
|
- 圖片功能需要 IndexedDB 與 Canvas。若瀏覽器封鎖 IndexedDB,文字便箋仍可正常運作,但插入圖片會被停用。
|
|
87
89
|
- Excel 匯入只讀取第一個工作表;公式會以其快取值匯入,儲存格中的富文字格式會被忽略。
|
|
88
|
-
- 上限:300 則便箋、標題 120 個字元、內文 8,000 個字元、每則便箋 12 個標籤(每個 24 個字元)、每則便箋 20 張圖片(單張來源圖片不超過 24 MB,儲存前會縮小到最長邊 1,400 像素、品質 0.82
|
|
90
|
+
- 上限:300 則便箋、標題 120 個字元、內文 8,000 個字元、每則便箋 12 個標籤(每個 24 個字元)、每則便箋 20 張圖片(單張來源圖片不超過 24 MB,儲存前會縮小到最長邊 1,400 像素、品質 0.82,顯示尺寸限制在 24–1,400 像素)、`.xlsx` 檔 8 MB(解壓後總量不超過 32 MB,壓縮檔內最多 64 個項目),以及瀏覽器圖片總量 60 MB。
|
|
89
91
|
- 標籤是扁平標籤——不支援階層、個別標籤顏色或獨立的標籤管理員——而且每個標籤都以個別便箋為單位儲存,所以重新命名一個標籤必須編輯所有帶有它的便箋。
|
|
90
92
|
- 收藏只固定在便箋清單內;目前尚未提供只顯示收藏的檢視。
|
|
91
93
|
|
|
92
94
|
## 開發
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
TypeScript 原始碼位於 `src/`,僅用 TypeScript 編譯器(不含打包器)編譯成提交在儲存庫中的 `client.js` 與 `index.js`:
|
|
95
97
|
|
|
96
98
|
| 檔案 | 用途 |
|
|
97
99
|
|---|---|
|
|
98
100
|
| `package.json` | Bundle/用戶端資訊清單(`dsh.bundle` 修補與 `dsh.client` 瀏覽器模組) |
|
|
99
101
|
| `cordis.patch.yml` | 插入 `dsh-side-memo` 的 Loader 列 |
|
|
100
|
-
| `index.js` | Host 端(空的 `apply
|
|
101
|
-
| `client.js` | 便箋面板、分頁類型、隨時可用的標題列開關、工作階段前抽屜、localStorage + IndexedDB
|
|
102
|
+
| `index.js` | Host 端(空的 `apply`;由 `src/host/index.ts` 產生) |
|
|
103
|
+
| `client.js` | 便箋面板、分頁類型、隨時可用的標題列開關、工作階段前抽屜、localStorage + IndexedDB 儲存、內嵌圖片編輯器(含縮放/變形覆蓋層)、標籤篩選/分組、編輯器頂端列新增便箋按鈕、拖入聊天框貼上、`.xlsx` 匯入/匯出(由 `src/client/` 產生) |
|
|
104
|
+
| `src/` | 兩部分的 TypeScript 原始碼 |
|
|
105
|
+
| `tsconfig.json`、`scripts/build.mjs` | 型別檢查設定與 `yarn build` 腳本 |
|
|
102
106
|
| `locale/en.json`、`locale/zh.json` | 外掛管理員的標題與說明 |
|
|
103
107
|
| `icon.svg` | 外掛圖示 |
|
|
104
108
|
|
|
105
|
-
可以用 DSH 外掛管理員(對此目錄呼叫 `install_bundle`)把它載入某個設定檔,或使用 [安裝](#安裝)
|
|
109
|
+
可以用 DSH 外掛管理員(對此目錄呼叫 `install_bundle`)把它載入某個設定檔,或使用 [安裝](#安裝) 中的指令安裝。套件內容僅限上表所列的執行時檔案——原始碼與建置腳本不會進入發布套件,npm tarball 只是在這些執行時資源之外附帶三個 README 與 LICENSE。
|
|
106
110
|
|
|
107
111
|
### 測試
|
|
108
112
|
|
|
109
|
-
- 單元測試:`
|
|
110
|
-
- 瀏覽器端對端測試(選用,僅供開發使用,不包含在 `
|
|
113
|
+
- 單元測試:`yarn test` 會先重新建置(`pretest`),再使用 Node.js 內建的 `node --test` 執行(需要 Node.js **>=22**)。第一次執行請先 `yarn install` 安裝建置工具鏈——開發相依套件只有 `typescript` 與 `@types/react`,發布的套件本身沒有相依套件——測試會直接呼叫編譯後的 `client.js` 中的真實輔助函式。
|
|
114
|
+
- 瀏覽器端對端測試(選用,僅供開發使用,不包含在 `yarn test` 中):參見 [`test/e2e/README.md`](test/e2e/README.md),了解隔離設定檔下的測試環境與執行方式。
|
|
111
115
|
- CI 會在每次 push 和 pull request 時執行單元測試:[`.github/workflows/ci.yml`](.github/workflows/ci.yml)。
|
|
112
116
|
|
|
113
117
|
## 授權條款
|