dsh-sidebar-row-menu 1.9.0 → 1.9.1
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/CHANGELOG.md +18 -0
- package/README.en.md +3 -0
- package/README.md +3 -0
- package/lib/client.js +31 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.9.1 — 2026-11-06
|
|
4
|
+
|
|
5
|
+
### 中文摘要
|
|
6
|
+
|
|
7
|
+
- **「本会话费用明细」默认不再出现在会话正文右键菜单里。** 这类费用 / 用量统计入口
|
|
8
|
+
只有文字、点开是统计面板,和工具条按钮不同类,所以默认不列出。设置 →「行菜单」
|
|
9
|
+
新增「显示费用明细」开关(默认关闭),需要时打开即可恢复;旧配置里没有这个字段时
|
|
10
|
+
也按默认关闭处理,不用清缓存。
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Session cost entries are no longer listed in the conversation-body menu by
|
|
15
|
+
default.** Cost / usage stats entries such as "Session cost" are text-only and open
|
|
16
|
+
a stats panel, so they are now treated differently from toolbar buttons and stay
|
|
17
|
+
hidden. A new "Show cost details" switch under Settings → row menu (off by default)
|
|
18
|
+
brings them back; existing saved settings without the new field also default to
|
|
19
|
+
hidden.
|
|
20
|
+
|
|
3
21
|
## 1.9.0 — 2026-11-06
|
|
4
22
|
|
|
5
23
|
### 中文摘要
|
package/README.en.md
CHANGED
|
@@ -140,6 +140,8 @@ the original button's icon:
|
|
|
140
140
|
- a "More" style overflow trigger is pinned to the last row (can be switched off in
|
|
141
141
|
Settings); buttons the organizer tucked into "More actions" do not show up on their
|
|
142
142
|
own;
|
|
143
|
+
- cost / usage entries such as "Session cost" are hidden by default (they are text-only
|
|
144
|
+
and open a stats panel); turn on "Show cost details" in Settings to list them;
|
|
143
145
|
- selecting an ordinary row is a real click: the menu closes, then a `click` is
|
|
144
146
|
dispatched to the original header button, so "Find", "Toggle bottom panel" and
|
|
145
147
|
friends still open their native popovers;
|
|
@@ -166,6 +168,7 @@ Settings → "Row menu" toggles every new entry:
|
|
|
166
168
|
| Also show in the "…" menu → session | Adds session right-click entries one by one to the native "…" menu: Open with, Delete session, Delete all archived sessions |
|
|
167
169
|
| Enable blank-space context menu | Master switch for the conversation-body right-click menu (blank space, thinking blocks, replies; on by default); when off, that area keeps the browser/host native menu |
|
|
168
170
|
| Pin "More" to the far right | On by default; keeps a "More actions" style overflow trigger as the last row regardless of its current toolbar position |
|
|
171
|
+
| Show cost details | Off by default; also lists session cost / usage entries such as "Session cost" in the conversation-body menu |
|
|
169
172
|
|
|
170
173
|
The "Also show in the "…" menu" switches are all off by default; until one is
|
|
171
174
|
enabled the "…" menu is exactly DSH's own.
|
package/README.md
CHANGED
|
@@ -113,6 +113,8 @@ DSH 0.2.2 把侧栏右键改成数据驱动:工作区菜单由宿主统一渲
|
|
|
113
113
|
都与 DSH 原生右键菜单对齐;
|
|
114
114
|
- 「更多操作」一类的溢出入口固定放在最后一项(可在设置里关掉);被 organizer 收进
|
|
115
115
|
「更多操作」的按钮不会单独出现;
|
|
116
|
+
- 「本会话费用明细」这类费用 / 用量统计入口默认不列进菜单(它们只有文字,点开是统计
|
|
117
|
+
面板),设置里打开「显示费用明细」后才出现;
|
|
116
118
|
- 点普通条目就是点原按钮:先关菜单,再把 `click` 派发给宿主工具条里的那个按钮,所以
|
|
117
119
|
「查找」「展开底部面板」等弹出的仍是原生面板;
|
|
118
120
|
- 有选中文字时让位给浏览器的选区菜单;消息里的输入控件和链接也保留原生菜单;工具卡片、
|
|
@@ -135,6 +137,7 @@ DSH 0.2.2 把侧栏右键改成数据驱动:工作区菜单由宿主统一渲
|
|
|
135
137
|
| 同时放进「…」菜单 → 会话 | 逐项把会话行右键条目加进原生「…」菜单:打开方式、永久删除会话、删除所有已归档会话 |
|
|
136
138
|
| 启用空白处右键菜单 | 会话正文(空白处、思考过程、回复)的右键菜单总开关(默认开启);关闭后该区域恢复浏览器 / 宿主的原生菜单 |
|
|
137
139
|
| 「更多」固定在最右 | 默认开启;把「更多操作」一类的溢出入口固定在菜单最后一项,不受工具条当前顺序影响 |
|
|
140
|
+
| 显示费用明细 | 默认关闭;打开后「本会话费用明细」这类费用 / 用量统计入口也会列进正文右键菜单 |
|
|
138
141
|
|
|
139
142
|
「同时放进「…」菜单」下的开关默认全部关闭,`…` 菜单在未开启时与 DSH 完全一致。
|
|
140
143
|
|
package/lib/client.js
CHANGED
|
@@ -153,6 +153,7 @@ window.__ModuleLoader__.load({
|
|
|
153
153
|
const BLANK_MENU_DEFAULTS = {
|
|
154
154
|
enabled: true,
|
|
155
155
|
keepMoreLast: true,
|
|
156
|
+
showCostMeter: false,
|
|
156
157
|
};
|
|
157
158
|
const BLANK_MENU_KEYS = Object.keys(BLANK_MENU_DEFAULTS);
|
|
158
159
|
/** 「更多操作」类入口的标签;用于按用户要求把它固定在菜单末尾。 */
|
|
@@ -241,12 +242,14 @@ window.__ModuleLoader__.load({
|
|
|
241
242
|
'settings.ellipsis.sessionDelete.hint': '在「…」菜单里永久删除这一个会话及其日志。',
|
|
242
243
|
'settings.ellipsis.sessionDeleteArchived.label': '删除所有已归档会话',
|
|
243
244
|
'settings.ellipsis.sessionDeleteArchived.hint': '在已归档会话的「…」菜单里一次清理全部归档会话。',
|
|
244
|
-
'settings.blankMenuTitle': '
|
|
245
|
-
'settings.blankMenuNote': '
|
|
246
|
-
'settings.blankMenu.enabled.label': '
|
|
247
|
-
'settings.blankMenu.enabled.hint': '
|
|
245
|
+
'settings.blankMenuTitle': '会话正文右键',
|
|
246
|
+
'settings.blankMenuNote': '在会话正文里右键(空白处、思考过程、回复都可以),会按顶部工具条的视觉顺序列出那排按钮;装了 dsh-sidebar-organizer 时跟随它的排序。分组之间自动加分隔线,「打开方式」和「更多操作」按工作区 / 会话菜单的规则收纳。输入框、工具卡片和工具条本身仍走各自的原生菜单。',
|
|
247
|
+
'settings.blankMenu.enabled.label': '启用正文右键菜单',
|
|
248
|
+
'settings.blankMenu.enabled.hint': '在会话正文的空白处、思考过程或回复上右键,弹出与右上角工具条一致的纵向菜单;取不到按钮时不接管原生菜单。',
|
|
248
249
|
'settings.blankMenu.keepMoreLast.label': '「更多」固定在最右',
|
|
249
250
|
'settings.blankMenu.keepMoreLast.hint': '把「更多操作」一类的入口固定在菜单最后一项,不受工具条当前顺序影响。',
|
|
251
|
+
'settings.blankMenu.showCostMeter.label': '显示费用明细',
|
|
252
|
+
'settings.blankMenu.showCostMeter.hint': '把「本会话费用明细」这类统计入口也列进菜单;默认隐藏,需要时再打开。',
|
|
250
253
|
'delete.title': '永久删除会话?',
|
|
251
254
|
'delete.description': '会话「{name}」的日志将从磁盘永久删除,此操作无法撤销。',
|
|
252
255
|
'delete.untitled': '未命名会话',
|
|
@@ -337,12 +340,14 @@ window.__ModuleLoader__.load({
|
|
|
337
340
|
'settings.ellipsis.sessionDelete.hint': 'Permanently delete this session and its log from the "…" menu.',
|
|
338
341
|
'settings.ellipsis.sessionDeleteArchived.label': 'Delete all archived sessions',
|
|
339
342
|
'settings.ellipsis.sessionDeleteArchived.hint': 'Clean up every archived session from an archived row\'s "…" menu.',
|
|
340
|
-
'settings.blankMenuTitle': 'Right-click
|
|
341
|
-
'settings.blankMenuNote': 'Right-click
|
|
342
|
-
'settings.blankMenu.enabled.label': 'Enable
|
|
343
|
-
'settings.blankMenu.enabled.hint': 'Right-click
|
|
343
|
+
'settings.blankMenuTitle': 'Right-click in the conversation body',
|
|
344
|
+
'settings.blankMenuNote': 'Right-click anywhere in the conversation body (blank space, thinking blocks or replies) to list the header toolbar buttons in their visual order. With dsh-sidebar-organizer installed the order follows its layout. Sections are separated by faint rules and "Open with" / "More actions" are collapsed like the workspace / session menus. Inputs, tool cards and the toolbar keep their own native menus.',
|
|
345
|
+
'settings.blankMenu.enabled.label': 'Enable conversation-body context menu',
|
|
346
|
+
'settings.blankMenu.enabled.hint': 'Right-click blank space, thinking blocks or replies in the conversation body to open a vertical menu mirroring the top-right toolbar. When no button can be found the native menu is left alone.',
|
|
344
347
|
'settings.blankMenu.keepMoreLast.label': 'Pin "More" to the far right',
|
|
345
348
|
'settings.blankMenu.keepMoreLast.hint': 'Always put the "More" style entry last, regardless of its current position in the toolbar.',
|
|
349
|
+
'settings.blankMenu.showCostMeter.label': 'Show cost details',
|
|
350
|
+
'settings.blankMenu.showCostMeter.hint': 'Also list session cost/usage entries such as "Session cost". Hidden by default; turn it on when you want them.',
|
|
346
351
|
'delete.title': 'Delete this session permanently?',
|
|
347
352
|
'delete.description': 'The log of "{name}" will be removed from disk. This cannot be undone.',
|
|
348
353
|
'delete.untitled': 'Untitled session',
|
|
@@ -823,7 +828,9 @@ window.__ModuleLoader__.load({
|
|
|
823
828
|
|
|
824
829
|
/** 该项默认开启:只有显式存成 false 才关闭。 */
|
|
825
830
|
function blankOption(key) {
|
|
826
|
-
|
|
831
|
+
const value = blankMenuSettings[key];
|
|
832
|
+
if (typeof value === 'boolean') return value;
|
|
833
|
+
return BLANK_MENU_DEFAULTS[key] !== false;
|
|
827
834
|
}
|
|
828
835
|
|
|
829
836
|
/* ------------------------------------- 打开方式:应用列表与二级开关 */
|
|
@@ -1617,6 +1624,7 @@ window.__ModuleLoader__.load({
|
|
|
1617
1624
|
const BLANK_MENU_ROWS = [
|
|
1618
1625
|
['enabled', 'settings.blankMenu.enabled.label', 'settings.blankMenu.enabled.hint'],
|
|
1619
1626
|
['keepMoreLast', 'settings.blankMenu.keepMoreLast.label', 'settings.blankMenu.keepMoreLast.hint'],
|
|
1627
|
+
['showCostMeter', 'settings.blankMenu.showCostMeter.label', 'settings.blankMenu.showCostMeter.hint'],
|
|
1620
1628
|
];
|
|
1621
1629
|
|
|
1622
1630
|
/**
|
|
@@ -2212,6 +2220,16 @@ window.__ModuleLoader__.load({
|
|
|
2212
2220
|
return candidates.some((candidate) => /更多打开方式|more open/i.test(headerButtonLabel(candidate)));
|
|
2213
2221
|
}
|
|
2214
2222
|
|
|
2223
|
+
/**
|
|
2224
|
+
* 工具条上的「本会话费用明细」一类统计入口(dsh-cost-meter 等)默认不列进菜单;
|
|
2225
|
+
* 这类按钮只有文字没有图标,点开是费用/后台任务面板。
|
|
2226
|
+
*/
|
|
2227
|
+
function isCostMeterButton(button, label) {
|
|
2228
|
+
const className = typeof button?.className === 'string' ? button.className : '';
|
|
2229
|
+
if (/cm-stat|cm-btn/i.test(className)) return true;
|
|
2230
|
+
return /费用明细|费用|cost|usage/i.test(label);
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2215
2233
|
/**
|
|
2216
2234
|
* 收集工具条上的按钮,按屏幕从左到右排序;「更多」按开关压到末尾。
|
|
2217
2235
|
* 只统计真实可见、可点、有标签的节点:隐藏槽位、被 organizer 收进「…」的
|
|
@@ -2257,6 +2275,7 @@ window.__ModuleLoader__.load({
|
|
|
2257
2275
|
more,
|
|
2258
2276
|
menu: more ? findHeaderMenuController(button) : null,
|
|
2259
2277
|
openWith,
|
|
2278
|
+
cost: isCostMeterButton(button, label),
|
|
2260
2279
|
section: slot.section,
|
|
2261
2280
|
left: rect.left,
|
|
2262
2281
|
top: rect.top,
|
|
@@ -2601,6 +2620,7 @@ window.__ModuleLoader__.load({
|
|
|
2601
2620
|
const hostRef = useRef(null);
|
|
2602
2621
|
const [pos, setPos] = useState(null);
|
|
2603
2622
|
const itemsConfig = useItems();
|
|
2623
|
+
const blankMenu = useBlankMenu();
|
|
2604
2624
|
const apps = useApps();
|
|
2605
2625
|
useChildren();
|
|
2606
2626
|
usePinned();
|
|
@@ -2650,6 +2670,8 @@ window.__ModuleLoader__.load({
|
|
|
2650
2670
|
};
|
|
2651
2671
|
let openWithDone = false;
|
|
2652
2672
|
items.forEach((item, index) => {
|
|
2673
|
+
// 费用/用量统计入口默认隐藏,设置里打开「显示费用明细」才出现。
|
|
2674
|
+
if (item.cost && blankMenu.showCostMeter !== true) return;
|
|
2653
2675
|
// 设置里关掉「打开方式」时,空白菜单也不出现这一组,和工作区 / 会话右键一致。
|
|
2654
2676
|
if (item.openWith && itemsConfig.openWith === false) return;
|
|
2655
2677
|
if (item.openWith && ownOpenWith) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-sidebar-row-menu",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Adds open-with and cleanup entries to the DSH sidebar context menus (interleaved on 0.2.2+, self-drawn workspace menu on 0.2.1), plus a conversation-body right-click menu that mirrors the session header toolbar with in-menu open-with and more-actions submenus.",
|
|
6
6
|
"keywords": [
|