dsh-skill-tag 0.1.15 → 0.1.16
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/lib/client.js +9 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1149,14 +1149,18 @@ window.__ModuleLoader__.load({
|
|
|
1149
1149
|
|
|
1150
1150
|
/**
|
|
1151
1151
|
* 判断一份菜单是不是宿主的工作区行菜单。
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1152
|
+
* 宿主源码里原本是 [{id:"rename"},{id:"delete",danger:true}] 两项,但项数会变:
|
|
1153
|
+
* 0.2.x 起中间插了「在文件夹显示」,于是 `labels.length !== 2` 把这份菜单整个漏掉,
|
|
1154
|
+
* 「管理标签」入口跟着消失(用户报告的 bug)。
|
|
1155
|
+
* 所以改成语义匹配,不绑项数:首项是「重命名」,且后面存在一项含「删除」。
|
|
1156
|
+
* 会话行菜单首项是「置顶」、且只有「归档」没有「删除」,仍会被排除。
|
|
1154
1157
|
* @param {string[]} labels 各 menuitem 的可见文本
|
|
1155
1158
|
*/
|
|
1156
1159
|
function isWorkspaceMenu(labels) {
|
|
1157
|
-
if (!Array.isArray(labels) || labels.length
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
+
if (!Array.isArray(labels) || labels.length < 2) return false;
|
|
1161
|
+
const first = String(labels[0] ?? "").trim();
|
|
1162
|
+
if (!/^(rename|重命名)$/i.test(first)) return false;
|
|
1163
|
+
return labels.slice(1).some((s) => /(delete|删除)/i.test(String(s ?? "")));
|
|
1160
1164
|
}
|
|
1161
1165
|
|
|
1162
1166
|
/** 「管理标签」菜单项按钮(内联样式模拟宿主菜单项,不依赖 CSS Module 类名) */
|