@cowwo/dsh-icon-custom 0.9.1 → 0.9.2
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.zh.md +2 -2
- package/client/client.js +11 -7
- package/package.json +1 -1
package/README.zh.md
CHANGED
|
@@ -58,12 +58,12 @@ SVG 会在浏览器里先栅格化成 512×512 PNG 再上传,ICO 则由后端提
|
|
|
58
58
|
规则:
|
|
59
59
|
|
|
60
60
|
- 数字 = **几个会话**在等你(不是几件事);同一个会话只占一格。
|
|
61
|
-
-
|
|
61
|
+
- 只有子代理会话不计。**你正开着的那个会话也算**——窗口可能被最小化、页面可能切到后台,这里无从判断你在不在看,所以不做这个区分;要清掉它,切走再切回来即可。
|
|
62
62
|
- **已读记在每个浏览器自己身上**(localStorage):打开过 = 处理过,刷新/重启不会"复活";装插件之前的历史结束也不算。
|
|
63
63
|
- 数据全部来自官方:`turn/end` 事件经官方 session projection 折叠,加上官方的"等待交互"注册表——**不依赖任何其他插件**。
|
|
64
64
|
- 设置页的**数据来源**可以切到"手动测试",手填数字试看效果。
|
|
65
65
|
- **工作区和会话行上的红点(实验)**:侧栏每个**工作区**那一行的文件夹图标右上角一个小红点,每个**有未读的会话**在标题右边跟一个小红点——一眼看出"事情在哪个工作区的哪个会话"。这一项是**贴着页面结构**做的——DSH 大版本升级后**可能失效**,失效时只会变成"不显示",**不影响**红点数字、清单和跳转;设置页里有一个开关可以随时关掉它。
|
|
66
|
-
- **想知道具体是哪个会话?**
|
|
66
|
+
- **想知道具体是哪个会话?** 侧栏「工作区」标题的**右上角**有一个**红底数字**(没有待处理时是灰色 0,位置不变);点开是待处理会话清单,**按工作区分组**(工作区名 · 会话名 · 在等你/刚结束),点其中一条**直接跳到那个会话**。
|
|
67
67
|
|
|
68
68
|
## 支持的格式
|
|
69
69
|
|
package/client/client.js
CHANGED
|
@@ -62,7 +62,7 @@ window.__ModuleLoader__.load({
|
|
|
62
62
|
unreadPanelOther: "其他",
|
|
63
63
|
workspaceDotLabel: "在工作区和会话行上显示红点(实验)",
|
|
64
64
|
workspaceDotHint: "在侧栏工作区那一行的文件夹图标上点一个小红点。这一项是贴着页面结构做的,DSH 升级后可能失效;失效时只会变成\"不显示\",不会影响红点数字、清单、跳转这些功能,随时可以关掉它。",
|
|
65
|
-
badgeTestHint: "真实未读 = 有会话发生了上面勾选的情况、而且你还没看过它(打开该会话即视为已读)
|
|
65
|
+
badgeTestHint: "真实未读 = 有会话发生了上面勾选的情况、而且你还没看过它(打开该会话即视为已读)。你正开着的会话也算——窗口可能被最小化、页面可能切到后台,这里无从判断你在不在看,所以不做这个区分。只有子代理不计。手动模式:自己填数字试看效果。刷新页面后回到真实未读。"
|
|
66
66
|
};
|
|
67
67
|
const en = {
|
|
68
68
|
nav: "Favicon",
|
|
@@ -117,7 +117,7 @@ window.__ModuleLoader__.load({
|
|
|
117
117
|
unreadPanelOther: "Other",
|
|
118
118
|
workspaceDotLabel: "Dots on workspace and session rows (experimental)",
|
|
119
119
|
workspaceDotHint: "Adds a small red dot to the folder icon of each workspace row. This one reads the page structure, so a DSH upgrade may break it; when it does it simply stops showing, never affecting the counts, the list, or navigation. Turn it off any time.",
|
|
120
|
-
badgeTestHint: "Real unread = a session ended for one of the checked reasons and you have not looked at it yet (opening a session marks it read). The session you are viewing and sub-agents never count. Manual = type a number to preview. Resets to Real on reload."
|
|
120
|
+
badgeTestHint: "Real unread = a session ended for one of the checked reasons and you have not looked at it yet (opening a session marks it read). The session you are viewing counts too — the window may be minimised or the page in the background, so this half cannot tell whether you are looking, and does not pretend to. Only sub-agents never count. Manual = type a number to preview. Resets to Real on reload."
|
|
121
121
|
};
|
|
122
122
|
//#endregion
|
|
123
123
|
|
|
@@ -329,8 +329,15 @@ window.__ModuleLoader__.load({
|
|
|
329
329
|
/**
|
|
330
330
|
* How many sessions deserve the badge right now: endings whose reason is
|
|
331
331
|
* enabled and that this browser has not seen since, plus sessions waiting
|
|
332
|
-
* for you (when that source is enabled).
|
|
333
|
-
*
|
|
332
|
+
* for you (when that source is enabled). Only sub-agent sessions never count.
|
|
333
|
+
*
|
|
334
|
+
* The session you are LOOKING AT counts too. It used to be excluded, on the
|
|
335
|
+
* theory that "you have it open, so you have seen it" — but that premise is
|
|
336
|
+
* not knowable from here: the window may be minimised, the tab may be in the
|
|
337
|
+
* background, the page may be on another desktop. The browser half cannot
|
|
338
|
+
* tell "watching" from "left open", and a rule that cannot tell two cases
|
|
339
|
+
* apart should not pretend to: a session counts from the moment it ends until
|
|
340
|
+
* it is opened again. Leaving and re-entering it is what clears the entry.
|
|
334
341
|
* @param list - the session list snapshot (may be absent).
|
|
335
342
|
* @param pending - the pending-interaction map (may be absent).
|
|
336
343
|
* @param config - the unread rule to apply.
|
|
@@ -344,7 +351,6 @@ window.__ModuleLoader__.load({
|
|
|
344
351
|
/** { id, title, waiting, kind, at } — newest first, "in wait" ahead of "ended". */
|
|
345
352
|
const hits = [];
|
|
346
353
|
const ids = new Set();
|
|
347
|
-
const current = currentSessionId(list);
|
|
348
354
|
const byId = list !== null && typeof list === "object" && list.byId !== null && typeof list.byId === "object" ? list.byId : {};
|
|
349
355
|
const titleOf = (id, entry) => (entry !== null && typeof entry === "object" && typeof entry.displayTitle === "string" && entry.displayTitle !== "" ? entry.displayTitle : id);
|
|
350
356
|
// Which workspace the session lives in. The sidebar's own workspace rows are
|
|
@@ -363,7 +369,6 @@ window.__ModuleLoader__.load({
|
|
|
363
369
|
const entry = byId[id];
|
|
364
370
|
if (entry === null || typeof entry !== "object") continue;
|
|
365
371
|
if (entry.origin === "subagent") continue;
|
|
366
|
-
if (id === current) continue;
|
|
367
372
|
const values = entry.projectionValues;
|
|
368
373
|
const value = values !== null && typeof values === "object" ? values[LAST_TURN_END_KEY] : undefined;
|
|
369
374
|
if (value === null || typeof value !== "object") continue;
|
|
@@ -380,7 +385,6 @@ window.__ModuleLoader__.load({
|
|
|
380
385
|
if (config === null || typeof config !== "object" || config.pending !== false) {
|
|
381
386
|
if (pending !== null && pending !== undefined && typeof pending.forEach === "function") {
|
|
382
387
|
pending.forEach((value, id) => {
|
|
383
|
-
if (id === current) return;
|
|
384
388
|
const kind = value !== null && typeof value === "object" && typeof value.kind === "string" ? value.kind : "";
|
|
385
389
|
if (ids.has(id)) {
|
|
386
390
|
// Already unread by its last turn: it is waiting too, which wins.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowwo/dsh-icon-custom",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "自定义浏览器标签页图标:在设置页上传 SVG/PNG/ICO,立即生效并持久保存,自动适配安卓/iOS/平板 PWA 图标。· Custom browser tab favicon: upload SVG/PNG/ICO from the settings page, applies instantly and persists, auto-sizes PWA icons for Android/iOS/tablets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|