dsh-ws-recency 0.13.2 → 0.13.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 +1 -1
  2. package/client.js +20 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -135,7 +135,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
135
135
  或固定版本的预构建包:
136
136
 
137
137
  ```powershell
138
- dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.13.2/dsh-ws-recency-0.13.2.tgz
138
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.13.3/dsh-ws-recency-0.13.3.tgz
139
139
  ```
140
140
 
141
141
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -955,8 +955,16 @@
955
955
  var labelTemplate = clone.querySelector("span");
956
956
  if (labelTemplate !== null && typeof labelTemplate.className === "string") labelClass = labelTemplate.className;
957
957
  }
958
- while (clone.firstChild !== null) clone.removeChild(clone.firstChild);
959
- if (icon !== null) clone.appendChild(icon);
958
+ /* Keep the wrapper that holds the icon (it owns the size and baseline) and
959
+ drop only the template's text. */
960
+ var iconChild = icon;
961
+ while (iconChild !== null && iconChild.parentElement !== null && iconChild.parentElement !== undefined && iconChild.parentElement !== clone) {
962
+ iconChild = iconChild.parentElement;
963
+ }
964
+ var kids = Array.prototype.slice.call(clone.children || []);
965
+ for (var k = 0; k < kids.length; k += 1) {
966
+ if (kids[k] !== iconChild) clone.removeChild(kids[k]);
967
+ }
960
968
  var label = document.createElement("span");
961
969
  if (labelClass !== "") label.className = labelClass;
962
970
  label.textContent = t("trash.title");
@@ -967,6 +975,16 @@
967
975
  if (event !== undefined && typeof event.preventDefault === "function") event.preventDefault();
968
976
  openTrashPanel();
969
977
  });
978
+ /* Keep the template's icon box (it owns the size and the baseline) but put
979
+ our own trash glyph inside it. */
980
+ var ourSvg = typeof mine.querySelector === "function" ? mine.querySelector("svg") : null;
981
+ if (icon !== null && ourSvg !== null && icon.parentElement !== null && icon.parentElement !== undefined) {
982
+ try {
983
+ icon.parentElement.replaceChild(ourSvg, icon);
984
+ } catch (error) {
985
+ /* keep the template icon */
986
+ }
987
+ }
970
988
  container.insertBefore(clone, mine);
971
989
  mine.style.display = "none";
972
990
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
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, per-session token statistics split by tool, and moving a session to another workspace.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",