@cowwo/dsh-icon-custom 0.18.0 → 0.19.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/README.md +2 -0
- package/README.zh.md +11 -1
- package/client/client.js +715 -186
- package/lib/typert.host.js +6 -3
- package/lib/unread.js +18 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,7 +51,9 @@ While a session is **running**, a yellow mark appears in four places: after the
|
|
|
51
51
|
- **The yellow mark IS the official "running"**: the session has a turn in flight and is not parked waiting for you — while it waits, the official row shows the amber "waiting for approval / waiting for answer / plan review" and the yellow goes dark. It tracks the official row's **grey spinner** exactly; the only difference is colour — the official one is deliberately quiet, this one is meant to be seen.
|
|
52
52
|
- **Every fact is official**: each session's `running` from the session list (computed by the host, pushed live). The plugin stores nothing and infers nothing, so a reload is immediately right and a **process restart never leaves a yellow mark stuck on**.
|
|
53
53
|
- **Sub-agents never count**: sub-agent sessions are not rendered in the sidebar at all (the same rule the red dot and the official row follow).
|
|
54
|
+
- **The yellow number is clickable**: it opens the list of **sessions running right now**, grouped by workspace (workspace · session · turn in flight · short id), and clicking a row **jumps to that session** and **locates it in the sidebar** (expands its workspace, scrolls to the row, flashes it once — see the "Locating" section below). It shares ONE floating panel with the red count's "needing you" list — opening either closes the other, since two panels under the same header row would stack. The list shows **no "running for how long"**: the official host only gives `running` as a boolean, with no started-at fact, and this plugin does not invent one. It also **never touches the seen watermark** — running is a live fact, not a queue, so there is no "mark all read". With nothing running the yellow number is not shown at all, so there is no entry point to click.
|
|
54
55
|
- Above 99 it shows `99+`, the same rule as the red count; **the two numbers are always the same size** — when both appear they shrink together to the largest pair that fits, stacked and never overlapping (at a 16px tab icon or a 24px logo two digits are already tight: a big one beside a small one, or two overlapping, would make both unreadable), and a number shown alone keeps the normal size (so the small/medium/large setting applies only while a number is on its own — with both shown, all three sizes draw the same).
|
|
56
|
+
- **Clicking a row also locates it in the sidebar**: the session opens AND, in the browsing list, its workspace expands, the row scrolls into view and flashes once (~1s) so you can see where it went. The official sidebar has this exact flow, but only for **its own search box** — the state behind it is private and no service exposes it (`openSession` only switches the main view) — so this drives the shipped workspace row and "show more" button **the way a click would**. It therefore reads the page structure: a DSH upgrade can break it, and the only symptom is a sidebar that does not move (the session still opens). It has its own switch in **Settings → icon管理**, on by default. Note that the expanded state is remembered by the official sidebar itself, so it will not collapse again on its own, and this feature only ever expands — never collapses — a workspace.
|
|
55
57
|
- The switch is in **Settings → icon管理 → Running marks** and is **on by default**.
|
|
56
58
|
|
|
57
59
|
> Why is the red count top-right and the yellow dot bottom-right instead of simply recolouring the official grey spinner? See [`docs/adr/0010-running-mark-is-a-second-projection.md`](./docs/adr/0010-running-mark-is-a-second-projection.md).
|
package/README.zh.md
CHANGED
|
@@ -65,7 +65,7 @@ SVG 会在浏览器里先栅格化成 512×512 PNG 再上传,ICO 则由后端提
|
|
|
65
65
|
- 数据全部来自官方:`turn/end` 事件经官方 session projection 折叠,加上官方的"等待交互"注册表——**不依赖任何其他插件**。
|
|
66
66
|
- 设置页的**数据来源**可以切到"手动测试",手填数字试看效果。
|
|
67
67
|
- **工作区和会话行上的红点(实验)**:侧栏每个**工作区**那一行的文件夹图标右上角一个小红点(收起的工作区里有多少未读,就看它),每个**有未读的会话**在标题右边跟一个小红点——一眼看出"事情在哪个工作区的哪个会话"。定位走 DSH 自己的 `data-row-key`(工作区、会话都按 **id**,不靠标题文字):标题重复不会串行,**折叠起来的会话不单独画点**——它的行没有渲染,由工作区那一行的点和「待处理」清单代表它。这一项是**贴着页面结构**做的——DSH 大版本升级后**可能失效**,失效时只会变成"不显示",**不影响**红点数字、清单和跳转;设置页里有一个开关可以随时关掉它。
|
|
68
|
-
- **想知道具体是哪个会话?** 侧栏「工作区」标题的**右上角**有一个**红底数字**(没有待处理时是灰色 0,位置不变);点开是待处理会话清单,**按工作区分组**(工作区名 · 会话名 · 在等你/刚结束)
|
|
68
|
+
- **想知道具体是哪个会话?** 侧栏「工作区」标题的**右上角**有一个**红底数字**(没有待处理时是灰色 0,位置不变);点开是待处理会话清单,**按工作区分组**(工作区名 · 会话名 · 在等你/刚结束),点其中一条**直接跳到那个会话**,并**在侧栏定位到它**(自动展开所在工作区、滚到那一行、闪一下;见下面的「定位」一节)。
|
|
69
69
|
|
|
70
70
|
## 进行中黄点
|
|
71
71
|
|
|
@@ -75,11 +75,21 @@ SVG 会在浏览器里先栅格化成 512×512 PNG 再上传,ICO 则由后端提
|
|
|
75
75
|
- **黄点就是官方的「进行中」**:会话有回合正在跑、而且没有停下来等你——你停下等审批 / 回答 / 计划待审的时候,官方那一行显示的是琥珀色标记,黄点也就不亮。它和官方行首那颗**灰色转圈**同进同出,差别只是颜色:官方做得安静,这里做得看得见。
|
|
76
76
|
- **事实全部来自官方**:会话列表里每个会话的 `running`(宿主算好、实时推给浏览器),插件不落盘、不推断。所以刷新页面立刻就是对的,**进程重启也不会留下一个永远亮着的黄点**。
|
|
77
77
|
- **子代理不算**:子代理会话根本不在侧栏里显示,它的运行不会让黄点亮起来(与红点同一条规矩,也和官方那一行一致)。
|
|
78
|
+
- **黄数字点得开**:点它就弹出**进行中的会话**清单,按工作区分组(工作区名 · 会话名 · 正在跑 · 会话短号),点其中一条**直接跳到那个会话**,并**在侧栏定位到它**(同红字清单:展开工作区 + 滚到那一行 + 闪一下,设置里可关)。它和红数字的「待处理」清单**共用同一块浮层**,开一个另一个自动关——两个数字在同一行,同时开就是两层叠在一起。清单里**没有"跑了多久"**:官方只给 `running` 一个布尔,没有"开跑时刻",插件不编造;它也**不碰已读水位线**——进行中是活的事实,不是待办队列,所以没有"全部标记已读"这一项。没有会话在跑时黄数字本来就不显示,也就没有可点的入口。
|
|
78
79
|
- 数字超过 99 显示 `99+`,和红点角标同一条规矩;**两颗数字徽标一样大**:同时出现时它们一起缩到能容下的尺寸、上下排开不重叠(16px 标签页与 24px logo 上两个数字本来就挤,画成一大一小或叠在一起都会读不出来),只有一颗时保持原来的大小(也就是说"红点大小"那三档只在单独出现时生效,两颗同框时三档一样)。
|
|
79
80
|
- 开关在**设置 → icon管理 → 进行中黄点**,**默认打开**。
|
|
80
81
|
|
|
81
82
|
> 为什么红在上、黄在下,而不是干脆把官方那颗灰转圈染黄?见 [`docs/adr/0010-running-mark-is-a-second-projection.md`](./docs/adr/0010-running-mark-is-a-second-projection.md)。
|
|
82
83
|
|
|
84
|
+
## 定位(点清单里的会话之后)
|
|
85
|
+
|
|
86
|
+
点「待处理」或「进行中」清单里的任意一条(见上面两节),除了**打开那个会话**,插件还会在侧栏**把它找出来**:展开它所在的工作区、滚到那一行、并**闪一下**(约 1 秒),免得你切过去之后不知道它在哪。
|
|
87
|
+
|
|
88
|
+
- **官方只开了半个口子**:侧栏自己有一套"展开 + 滚动",但它只服务于侧栏自己的**搜索框**,而且那套状态是它内部的,没有对插件开放的接口(`openSession` 只管切换主画面)。所以这一项是**模拟点击**官方的工作区行与「显示更多」按钮做到的。
|
|
89
|
+
- **因此它贴产品结构**:DSH 大版本升级后可能失效。失效的表现只有一个——**点进去照常打开会话,只是侧栏不动**。它有自己的开关(设置 → icon管理 → 未读红点 那一节里),**默认开**,随时可关。
|
|
90
|
+
- **展开是官方自己记住的**:那个工作区的展开状态由 DSH 存在浏览器里,**不会自己收回去**;不想留着就手动点一下收起。官方自己的搜索跳转也是这个行为。
|
|
91
|
+
- **它不会做过头**:只展开、不收起;目标会话被折叠得很深、一次放不出来时,最多点几次「显示更多」就停手(会话照样已经打开了)。
|
|
92
|
+
|
|
83
93
|
## 应用图标角标(系统图标上的红点)
|
|
84
94
|
|
|
85
95
|
把网页**安装为应用**后,同一个未读数字也会显示在**系统图标**上。设置在**设置 → icon管理 → 未读红点**里的「在系统应用图标上显示红点」,**默认打开**;数字与页内红点**严格同值**(同一份计算,不额外截断),所以两个地方永远一致。
|