dsh-ws-recency 0.7.1 → 0.7.3

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.
Files changed (3) hide show
  1. package/README.md +10 -11
  2. package/client.js +13 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-ws-recency
2
2
 
3
- DSH 侧栏的两件事:**工作区分组按最近活跃排序**、**折叠时只显示 N 条会话**。
3
+ DSH 侧栏的三件事:**工作区分组按最近活跃排序**、**过期历史自动折叠**、**运行中/未读/需跟进三色标记**。单独装上就有效,不依赖其它插件。
4
4
 
5
5
  ## 一、分组排序
6
6
 
@@ -8,8 +8,6 @@ DSH 已经把**组内**会话按 `updatedAt` 倒序排好了(排序方式 =
8
8
 
9
9
  做法:从 Client store 读每个工作区自己的会话,取组内最大的 `updatedAt`;空工作区回落到该工作区的 `createdAt`;把结果写成各分组元素的 flex `order`。不碰会话行、不碰原生置顶、不碰归档、不改 store。
10
10
 
11
- 与 `dsh-plugin-busy-workspace` 共存:busy 会在同一批分组元素上写 `data-busy-rank`(紧急度档位),本插件把它作为**主键**,只负责档位**内部**按活跃度排序。没装 busy 时就是纯最近活跃排序。
12
-
13
11
  ## 二、历史折叠
14
12
 
15
13
  会话超过 `foldDays`(默认 **3 天**)没有更新就折叠起来;整个工作区都过期时,它只剩一行工作区标题——需要翻历史时点开就行。
@@ -34,8 +32,8 @@ DSH 已经把**组内**会话按 `updatedAt` 倒序排好了(排序方式 =
34
32
 
35
33
  - 标记存在 Client store 的 `followUps`(随 `dsh.ws-recency.prefs.v1` 持久化),重启后还在;
36
34
  - 琥珀圆点渲染在宿主自己的 `sidebar.session.row.leading` 槽里,**不往行里塞子元素**——塞进去会让后面的行整体下移一格;点圆点即取消标记;
37
- - 标记后该会话**又有新活动**(`updatedAt` 前进)→ 自动视为已跟进,标记消失;
38
- - 不受 20 秒、不受打开时长影响——你标记就一直是琥珀,直到你取消或它又有新活动。
35
+ - **标记只有你手动取消才会消失**:运行中/完成未读期间它只是被更强的状态盖住显示,跑完、读完(没有新未读)之后琥珀自己回来;
36
+ - 不受打开时长、会话是否继续对话影响——继续对话恰恰常常是还欠一次跟进的原因。
39
37
 
40
38
  ## 设置
41
39
 
@@ -52,25 +50,26 @@ DSH 已经把**组内**会话按 `updatedAt` 倒序排好了(排序方式 =
52
50
  - 折叠只能作用于宿主**已经渲染**的行;更早的行仍在宿主自己的「展开其余」之后。
53
51
  - “未分组”桶永远排在真实工作区之后。
54
52
  - 只在按工作区分组(含工作区树顶层)时生效。
53
+ - **可选互操作**:如果你另外装着 `dsh-plugin-busy-workspace`,本插件会尊重它写在分组上的 `data-busy-rank`,把它的紧急度当主键、档位内部再按活跃度排。没装就是纯最近活跃排序——本插件不依赖它。
55
54
 
56
55
  ## 安装
57
56
 
58
- 从 GitHub:
57
+ npm(推荐,升级最简单):
59
58
 
60
59
  ```powershell
61
- dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
60
+ dsh plugin --profile <profile> add dsh-ws-recency
62
61
  ```
63
62
 
64
- 或从 Release 的预构建包(版本固定,不会跟着分支漂):
63
+ 或从 GitHub 直装:
65
64
 
66
65
  ```powershell
67
- dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.7.1/dsh-ws-recency-0.7.1.tgz
66
+ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
68
67
  ```
69
68
 
70
- 发布到 npm 后也可以:
69
+ 或固定版本的预构建包:
71
70
 
72
71
  ```powershell
73
- dsh plugin --profile <profile> add dsh-ws-recency
72
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.7.3/dsh-ws-recency-0.7.3.tgz
74
73
  ```
75
74
 
76
75
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -8,9 +8,10 @@
8
8
  * workspace registry order (creation order). This plugin ranks every group
9
9
  * by the freshest `updatedAt` among its own sessions and writes a flex
10
10
  * `order` onto it. Native pins, archive state and the store are untouched.
11
- * When dsh-plugin-busy-workspace is installed it writes `data-busy-rank`
12
- * (its urgency band) on the same elements; that band is kept as the primary
13
- * key and recency only decides the order inside one band.
11
+ * OPTIONAL interop: when dsh-plugin-busy-workspace happens to be installed
12
+ * it writes `data-busy-rank` (its urgency band) on the same elements; that
13
+ * band is then kept as the primary key and recency only decides the order
14
+ * inside one band. This plugin never depends on it.
14
15
  *
15
16
  * 2. HISTORY FOLD - a session that has not been updated for `foldDays` (default
16
17
  * 3) is folded away, and a workspace whose own freshest session is older than
@@ -512,8 +513,8 @@
512
513
  /**
513
514
  * Color the rows: running (blue), finished-unopened (green), and the manual
514
515
  * "needs follow-up" flag (amber). The flag is the user's own judgement - it
515
- * is never inferred, and it is dropped automatically once the session has
516
- * produced newer activity than the moment it was flagged.
516
+ * is never inferred, and only an explicit clear removes it. Running and
517
+ * unread outrank it on screen; once they pass, amber comes back.
517
518
  */
518
519
  function decorateRows(entries, sessions, statuses, settings) {
519
520
  var flags = settings.followUps;
@@ -528,13 +529,13 @@
528
529
  var status = statusOf(statuses, id);
529
530
  var running = status !== null ? status.running === true : session.running === true;
530
531
  var unread = status !== null ? status.completionUnread === true : session.completed === true;
531
- var flaggedAt = flags[id];
532
- if (typeof flaggedAt === "number" && typeof session.updatedAt === "number" && session.updatedAt > flaggedAt) {
533
- /* The session moved on after the mark: the follow-up happened. */
534
- if (data.actions !== null && typeof data.actions.clearFollowUp === "function") data.actions.clearFollowUp(id);
535
- flaggedAt = undefined;
536
- }
537
- states[id] = running ? "running" : unread ? "unread" : flaggedAt !== undefined ? "followup" : null;
532
+ /* The mark is the user's own judgement and survives everything except
533
+ an explicit clear: running / unread only outrank it on screen, and
534
+ once those pass it comes back. It is never dropped just because the
535
+ conversation moved on - continuing a conversation is often the very
536
+ reason a follow-up is still owed. */
537
+ var flagged = flags[id] !== undefined;
538
+ states[id] = running ? "running" : unread ? "unread" : flagged ? "followup" : null;
538
539
  }
539
540
 
540
541
  for (var i = 0; i < entries.length; i += 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Sidebar session management for DeepSeek Harness: workspace groups sorted by latest activity, stale history folded, manual follow-up marks.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",