dsh-ws-recency 0.35.2 → 0.35.4

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 CHANGED
@@ -223,6 +223,8 @@ DSH 原生的置顶只把会话顶到**它所属工作区分组的第一行**,
223
223
 
224
224
  面板底部有「全部启用」一键恢复。开关状态和别的偏好一起存在本地,重装升级不丢。
225
225
 
226
+ **搜索与回收站这两项需要重启才生效**:侧栏那一行由宿主按注册渲染,中途反复注册/注销会让第二次关闭失效,所以它们只在启动时按当前设置注册一次,页面上的说明会注明「改动需要重启应用后生效」。其余开关当场生效。
227
+
226
228
  ## 已知边界
227
229
 
228
230
  - 依赖宿主 DOM:分组容器带 `_groupSection`、分组头带 `data-row-key="workspace:<id>"`、行带 `data-row-key="session:<id>"`、溢出按钮类名含 `sessionOverflowButton`。宿主改结构就要跟着改。
package/client.js CHANGED
@@ -572,6 +572,7 @@
572
572
  "features.on": "已启用",
573
573
  "features.off": "已关闭",
574
574
  "features.reset": "全部启用",
575
+ "features.restart": "改动需要重启应用后生效。",
575
576
  "features.note": "只关掉你不需要的部分:关掉的入口会从界面上消失,相关的后台逻辑也会停下。",
576
577
  "features.takesEffect": "当前启用 {on} / {all} 项。",
577
578
  "features.sidebar.title": "侧栏会话管理",
@@ -809,6 +810,7 @@
809
810
  "features.on": "On",
810
811
  "features.off": "Off",
811
812
  "features.reset": "Enable all",
813
+ "features.restart": "the change takes effect after a restart.",
812
814
  "features.note": "Turn off only what you do not need: the entry disappears from the interface and its background work stops.",
813
815
  "features.takesEffect": "{on} of {all} features are on.",
814
816
  "features.sidebar.title": "Sidebar session management",
@@ -2192,6 +2194,9 @@
2192
2194
  /** Set by apply(): keeps gated panel registrations in step with the store. */
2193
2195
  var syncPanelsExposed = null;
2194
2196
 
2197
+ /** What was registered at startup, so the page can say "restart to apply". */
2198
+ var panelBootExposed = null;
2199
+
2195
2200
  var confirmBackdrop = null;
2196
2201
  var confirmPrevious = null;
2197
2202
  var confirmKey = null;
@@ -5424,16 +5429,26 @@
5424
5429
  if (props.actions !== undefined) props.actions.resetFeatures();
5425
5430
  };
5426
5431
 
5432
+ /* These two own a sidebar row, and a row is fixed at startup. */
5433
+ var boot = typeof panelBootExposed === "function" ? panelBootExposed() : null;
5434
+ var waitsForRestart = function (id) {
5435
+ if (id !== "search" && id !== "trash") return false;
5436
+ if (boot === null) return false;
5437
+ return boot[id] !== valueOf(id);
5438
+ };
5427
5439
  var rows = FEATURE_IDS.map(function (id) {
5428
5440
  return h(FeatureRow, {
5429
5441
  key: id,
5430
5442
  id: id,
5431
5443
  title: t("features." + id + ".title"),
5432
- description: t("features." + id + ".desc"),
5444
+ description: waitsForRestart(id)
5445
+ ? t("features." + id + ".desc") + " " + t("features.restart")
5446
+ : t("features." + id + ".desc"),
5433
5447
  on: valueOf(id),
5434
5448
  onToggle: toggle,
5435
5449
  });
5436
5450
  });
5451
+
5437
5452
  var onCount = FEATURE_IDS.filter(function (id) { return valueOf(id); }).length;
5438
5453
  return h("section", { className: "wsr-plugin-features", "data-wsr-features": OUR_PACKAGE },
5439
5454
  h("div", { className: "wsr-features-head" },
@@ -6122,88 +6137,60 @@
6122
6137
 
6123
6138
 
6124
6139
  /*
6125
- * Search and trash each own a sidebar row. Hiding the glyph is not enough:
6126
- * the row's label and its panel page are registered too, so the switch has to
6127
- * dispose the whole injection and build it again when it comes back.
6140
+ * Search and trash each own a sidebar row. The host derives the row from the
6141
+ * registration, so a row cannot be hidden by drawing less; and re-registering
6142
+ * mid-session left the row behind on the next switch. So: register once, at
6143
+ * startup, for whatever the stored settings asked for, and tell the user that a
6144
+ * change here needs a restart. Everything else takes effect immediately.
6128
6145
  */
6129
- var gated = {};
6130
- function bindPanels(feature, build) {
6131
- gated[feature] = { build: build, dispose: null };
6132
- syncPanels(data.settings);
6133
- }
6146
+ var panelBoot = null;
6134
6147
  function syncPanels(settings) {
6135
- Object.keys(gated).forEach(function (feature) {
6136
- var entry = gated[feature];
6137
- var want = featureOn(settings, feature);
6138
- if (want && entry.dispose === null) {
6139
- try {
6140
- entry.dispose = entry.build();
6141
- } catch (error) {
6142
- console.warn("[dsh-ws-recency] could not register " + feature + ":", error);
6143
- }
6144
- return;
6145
- }
6146
- if (!want && entry.dispose !== null) {
6147
- try {
6148
- entry.dispose();
6149
- } catch (error) {
6150
- /* already gone */
6151
- }
6152
- entry.dispose = null;
6153
- }
6154
- });
6148
+ if (panelBoot !== null) return;
6149
+ panelBoot = {};
6150
+ FEATURE_IDS.forEach(function (feature) { panelBoot[feature] = featureOn(settings, feature); });
6151
+ if (panelBoot.search) {
6152
+ ctx.slots.inject("sidebar.panellist", function () {
6153
+ return ctx.slots.register({
6154
+ name: "sidebar.panellist",
6155
+ id: "ws-recency-search",
6156
+ order: 19,
6157
+ store: prefs,
6158
+ locale: NS,
6159
+ label: function () { return t("search.title"); },
6160
+ }, SearchPanelIcon);
6161
+ });
6162
+ ctx.slots.inject("main", function () {
6163
+ return ctx.slots.register({
6164
+ name: "main",
6165
+ key: "ws-recency-search",
6166
+ store: prefs,
6167
+ locale: NS,
6168
+ }, SearchPanelPage);
6169
+ });
6170
+ }
6171
+ if (panelBoot.trash) {
6172
+ ctx.slots.inject("sidebar.panellist", function () {
6173
+ return ctx.slots.register({
6174
+ name: "sidebar.panellist",
6175
+ id: "ws-recency-trash",
6176
+ order: 20,
6177
+ store: prefs,
6178
+ locale: NS,
6179
+ label: function () { return t("trash.title"); },
6180
+ }, TrashPanelIcon);
6181
+ });
6182
+ ctx.slots.inject("main", function () {
6183
+ return ctx.slots.register({
6184
+ name: "main",
6185
+ key: "ws-recency-trash",
6186
+ store: prefs,
6187
+ locale: NS,
6188
+ }, TrashPanelPage);
6189
+ });
6190
+ }
6155
6191
  }
6156
6192
  syncPanelsExposed = syncPanels;
6157
-
6158
- bindPanels("search", function () {
6159
- var icon = ctx.slots.inject("sidebar.panellist", function () {
6160
- return ctx.slots.register({
6161
- name: "sidebar.panellist",
6162
- id: "ws-recency-search",
6163
- order: 19,
6164
- store: prefs,
6165
- locale: NS,
6166
- label: function () { return t("search.title"); },
6167
- }, SearchPanelIcon);
6168
- });
6169
- var page = ctx.slots.inject("main", function () {
6170
- return ctx.slots.register({
6171
- name: "main",
6172
- key: "ws-recency-search",
6173
- store: prefs,
6174
- locale: NS,
6175
- }, SearchPanelPage);
6176
- });
6177
- return function () {
6178
- if (typeof icon === "function") icon();
6179
- if (typeof page === "function") page();
6180
- };
6181
- });
6182
-
6183
- bindPanels("trash", function () {
6184
- var icon = ctx.slots.inject("sidebar.panellist", function () {
6185
- return ctx.slots.register({
6186
- name: "sidebar.panellist",
6187
- id: "ws-recency-trash",
6188
- order: 20,
6189
- store: prefs,
6190
- locale: NS,
6191
- label: function () { return t("trash.title"); },
6192
- }, TrashPanelIcon);
6193
- });
6194
- var page = ctx.slots.inject("main", function () {
6195
- return ctx.slots.register({
6196
- name: "main",
6197
- key: "ws-recency-trash",
6198
- store: prefs,
6199
- locale: NS,
6200
- }, TrashPanelPage);
6201
- });
6202
- return function () {
6203
- if (typeof icon === "function") icon();
6204
- if (typeof page === "function") page();
6205
- };
6206
- });
6193
+ panelBootExposed = function () { return panelBoot; };
6207
6194
  ctx.effect(function () {
6208
6195
  return function () { shutdown(); };
6209
6196
  }, "dsh-ws-recency: list observer");
@@ -6226,6 +6213,13 @@
6226
6213
 
6227
6214
  /* Test hook: the jump and the highlighting are pure DOM helpers. */
6228
6215
  /* The statistics panel no longer has a menu row; tests open it here. */
6216
+ /* What the sidebar bound at startup: the page reads it to say "restart". */
6217
+ exports.__features = {
6218
+ boot: function () {
6219
+ return typeof panelBootExposed === "function" ? panelBootExposed() : null;
6220
+ },
6221
+ };
6222
+
6229
6223
  exports.__stats = { open: openStatsPanel, close: closeStatsPanel };
6230
6224
 
6231
6225
  exports.__search = {
package/index.js CHANGED
@@ -32,7 +32,7 @@ import { dirname, join } from "node:path";
32
32
  export const name = "ws-recency";
33
33
 
34
34
  /** Version marker reported by the health route. */
35
- export const HOST_VERSION = "0.35.2";
35
+ export const HOST_VERSION = "0.35.4";
36
36
 
37
37
  /**
38
38
  * Exact routes the client half calls. Registered on the bare web server, so they
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
4
4
  "description": "Sidebar session management for DeepSeek Harness: workspace groups sorted by latest activity, stale history folded, a global pinned section, follow-up marks, session delete into a recoverable trash, archived sessions managed from that same trash panel, per-session token statistics with an argument/result split and an option to count tool arguments as the agent's writing, moving a session to another workspace, and a literal content search that jumps to the turn a word was said in.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",