dsh-ws-recency 0.35.4 → 0.35.5

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/client.js +77 -61
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -2091,7 +2091,6 @@
2091
2091
  if (typeof props.t === "function") data.t = props.t;
2092
2092
  /* With the sidebar half off, drop our paint and stop the timer. */
2093
2093
  var sidebarOn = featureOn(data.settings, "sidebar");
2094
- if (typeof syncPanelsExposed === "function") syncPanelsExposed(data.settings);
2095
2094
  react.useEffect(function () {
2096
2095
  if (sidebarOn) {
2097
2096
  schedule();
@@ -2191,11 +2190,32 @@
2191
2190
  * never take the window's focus away.
2192
2191
  * ------------------------------------------------------------------- */
2193
2192
 
2194
- /** Set by apply(): keeps gated panel registrations in step with the store. */
2195
- var syncPanelsExposed = null;
2193
+ /** What the sidebar bound at startup, so the page can say "restart to apply". */
2194
+ var panelBoot = null;
2196
2195
 
2197
- /** What was registered at startup, so the page can say "restart to apply". */
2198
- var panelBootExposed = null;
2196
+ /** The stored switches, read before the store instance exists. */
2197
+ function readStoredFeatures() {
2198
+ if (typeof localStorage === "undefined") return null;
2199
+ try {
2200
+ var raw = localStorage.getItem("dsh.ws-recency.prefs.v1");
2201
+ if (raw === null || raw === undefined) {
2202
+ /* A scoped key carries a suffix; find it by prefix. */
2203
+ for (var i = 0; i < localStorage.length; i += 1) {
2204
+ var key = localStorage.key(i);
2205
+ if (typeof key === "string" && key.indexOf("dsh.ws-recency.prefs.v1") === 0) {
2206
+ raw = localStorage.getItem(key);
2207
+ break;
2208
+ }
2209
+ }
2210
+ }
2211
+ if (raw === null || raw === undefined) return null;
2212
+ var parsed = JSON.parse(raw);
2213
+ var bag = parsed !== null && parsed !== undefined ? parsed.features : null;
2214
+ return bag !== null && bag !== undefined && typeof bag === "object" ? bag : null;
2215
+ } catch (error) {
2216
+ return null;
2217
+ }
2218
+ }
2199
2219
 
2200
2220
  var confirmBackdrop = null;
2201
2221
  var confirmPrevious = null;
@@ -5430,7 +5450,7 @@
5430
5450
  };
5431
5451
 
5432
5452
  /* These two own a sidebar row, and a row is fixed at startup. */
5433
- var boot = typeof panelBootExposed === "function" ? panelBootExposed() : null;
5453
+ var boot = panelBoot;
5434
5454
  var waitsForRestart = function (id) {
5435
5455
  if (id !== "search" && id !== "trash") return false;
5436
5456
  if (boot === null) return false;
@@ -6137,60 +6157,57 @@
6137
6157
 
6138
6158
 
6139
6159
  /*
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.
6160
+ * Search and trash own a sidebar row, and a row is decided by the host at
6161
+ * registration time. So they are registered here, from the settings read out of
6162
+ * storage: registering them later, from a render, left the trash row without its
6163
+ * panel page. A switch for one of these two therefore applies on the next start,
6164
+ * and the plugin page says exactly that.
6145
6165
  */
6146
- var panelBoot = null;
6147
- function syncPanels(settings) {
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
- }
6166
+ var bootFeatures = readStoredFeatures();
6167
+ panelBoot = {
6168
+ search: featureOn({ features: bootFeatures || {} }, "search"),
6169
+ trash: featureOn({ features: bootFeatures || {} }, "trash"),
6170
+ };
6171
+ if (panelBoot.search) {
6172
+ ctx.slots.inject("sidebar.panellist", function () {
6173
+ return ctx.slots.register({
6174
+ name: "sidebar.panellist",
6175
+ id: "ws-recency-search",
6176
+ order: 19,
6177
+ store: prefs,
6178
+ locale: NS,
6179
+ label: function () { return t("search.title"); },
6180
+ }, SearchPanelIcon);
6181
+ });
6182
+ ctx.slots.inject("main", function () {
6183
+ return ctx.slots.register({
6184
+ name: "main",
6185
+ key: "ws-recency-search",
6186
+ store: prefs,
6187
+ locale: NS,
6188
+ }, SearchPanelPage);
6189
+ });
6190
+ }
6191
+ if (panelBoot.trash) {
6192
+ ctx.slots.inject("sidebar.panellist", function () {
6193
+ return ctx.slots.register({
6194
+ name: "sidebar.panellist",
6195
+ id: "ws-recency-trash",
6196
+ order: 20,
6197
+ store: prefs,
6198
+ locale: NS,
6199
+ label: function () { return t("trash.title"); },
6200
+ }, TrashPanelIcon);
6201
+ });
6202
+ ctx.slots.inject("main", function () {
6203
+ return ctx.slots.register({
6204
+ name: "main",
6205
+ key: "ws-recency-trash",
6206
+ store: prefs,
6207
+ locale: NS,
6208
+ }, TrashPanelPage);
6209
+ });
6191
6210
  }
6192
- syncPanelsExposed = syncPanels;
6193
- panelBootExposed = function () { return panelBoot; };
6194
6211
  ctx.effect(function () {
6195
6212
  return function () { shutdown(); };
6196
6213
  }, "dsh-ws-recency: list observer");
@@ -6215,9 +6232,8 @@
6215
6232
  /* The statistics panel no longer has a menu row; tests open it here. */
6216
6233
  /* What the sidebar bound at startup: the page reads it to say "restart". */
6217
6234
  exports.__features = {
6218
- boot: function () {
6219
- return typeof panelBootExposed === "function" ? panelBootExposed() : null;
6220
- },
6235
+ boot: function () { return panelBoot; },
6236
+ readStored: readStoredFeatures,
6221
6237
  };
6222
6238
 
6223
6239
  exports.__stats = { open: openStatsPanel, close: closeStatsPanel };
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.4";
35
+ export const HOST_VERSION = "0.35.5";
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.4",
3
+ "version": "0.35.5",
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",