dsh-ws-recency 0.13.4 → 0.13.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/README.md +1 -1
  2. package/client.js +25 -92
  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.4/dsh-ws-recency-0.13.4.tgz
138
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.13.5/dsh-ws-recency-0.13.5.tgz
139
139
  ```
140
140
 
141
141
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -924,89 +924,6 @@
924
924
  return typeof id === "string" && id !== "" ? id : null;
925
925
  }
926
926
 
927
- /** Clone one real footer entry into the slot so the icon box and text line up. */
928
- function decorateFooterAction() {
929
- if (typeof document === "undefined") return;
930
- var mine = document.querySelector('[data-wsr-footer="true"]');
931
- if (mine === null || typeof mine.parentElement === "undefined" || mine.parentElement === null) return;
932
- var container = mine.parentElement;
933
- if (typeof container.querySelectorAll !== "function" || typeof container.insertBefore !== "function") return;
934
- if (container.querySelector("[data-wsr-clone]") !== null || typeof mine.style === "undefined") return;
935
- var template = null;
936
- var buttons = container.querySelectorAll("button");
937
- for (var i = 0; i < buttons.length; i += 1) {
938
- var candidate = buttons[i];
939
- if (candidate === mine) continue;
940
- if (typeof candidate.closest === "function" && candidate.closest("[data-wsr-footer]") !== null) continue;
941
- if (typeof candidate.querySelector !== "function" || candidate.querySelector("svg") === null) continue;
942
- template = candidate;
943
- break;
944
- }
945
- if (template === null || typeof template.cloneNode !== "function") return;
946
- /* The button usually sits inside a row wrapper that owns the width and the
947
- alignment; cloning only the button loses them and the label wraps. */
948
- var rowSource = template.parentElement !== null && template.parentElement !== undefined && template.parentElement !== container
949
- ? template.parentElement
950
- : template;
951
- var clone;
952
- try {
953
- clone = rowSource.cloneNode(true);
954
- } catch (error) {
955
- return;
956
- }
957
- var icon = typeof clone.querySelector === "function" ? clone.querySelector("svg") : null;
958
- var labelClass = "";
959
- if (typeof clone.querySelector === "function") {
960
- var labelTemplate = clone.querySelector("span");
961
- if (labelTemplate !== null && typeof labelTemplate.className === "string") labelClass = labelTemplate.className;
962
- }
963
- /* The wrapper may rely on inline styles from React rather than classes. */
964
- if (typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
965
- var metrics = ["display", "width", "min-width", "align-items", "justify-content", "gap", "padding", "font-size", "font-family", "font-weight", "line-height", "color"];
966
- for (var mi = 0; mi < metrics.length; mi += 1) {
967
- var value = "";
968
- try { value = window.getComputedStyle(rowSource).getPropertyValue(metrics[mi]) || ""; } catch (error) { value = ""; }
969
- if (value !== "" && value !== "auto") clone.style[metrics[mi]] = value;
970
- }
971
- clone.style.whiteSpace = "nowrap";
972
- }
973
- /* Keep the wrapper that holds the icon (it owns the size and baseline) and
974
- drop only the template's text. */
975
- var iconChild = icon;
976
- while (iconChild !== null && iconChild.parentElement !== null && iconChild.parentElement !== undefined && iconChild.parentElement !== clone) {
977
- iconChild = iconChild.parentElement;
978
- }
979
- var kids = Array.prototype.slice.call(clone.children || []);
980
- for (var k = 0; k < kids.length; k += 1) {
981
- if (kids[k] !== iconChild) clone.removeChild(kids[k]);
982
- }
983
- var label = document.createElement("span");
984
- if (labelClass !== "") label.className = labelClass;
985
- label.textContent = t("trash.title");
986
- label.style.whiteSpace = "nowrap";
987
- label.style.overflow = "hidden";
988
- label.style.textOverflow = "ellipsis";
989
- clone.appendChild(label);
990
- clone.setAttribute("data-wsr-clone", "true");
991
- clone.setAttribute("aria-label", t("trash.title"));
992
- clone.addEventListener("click", function (event) {
993
- if (event !== undefined && typeof event.preventDefault === "function") event.preventDefault();
994
- openTrashPanel();
995
- });
996
- /* Keep the template's icon box (it owns the size and the baseline) but put
997
- our own trash glyph inside it. */
998
- var ourSvg = typeof mine.querySelector === "function" ? mine.querySelector("svg") : null;
999
- if (icon !== null && ourSvg !== null && icon.parentElement !== null && icon.parentElement !== undefined) {
1000
- try {
1001
- icon.parentElement.replaceChild(ourSvg, icon);
1002
- } catch (error) {
1003
- /* keep the template icon */
1004
- }
1005
- }
1006
- container.insertBefore(clone, mine);
1007
- mine.style.display = "none";
1008
- }
1009
-
1010
927
  /** The nearest horizontal flex row above the stats: the whole footer dock. */
1011
928
  function composerDockOf(row) {
1012
929
  var node = row;
@@ -1135,14 +1052,12 @@
1135
1052
  var settings = settingsOf();
1136
1053
  if (!ready(sessions) || !ready(workspaces)) {
1137
1054
  decorateComposerStats();
1138
- decorateFooterAction();
1139
1055
  return;
1140
1056
  }
1141
1057
 
1142
1058
  var entries = collect();
1143
1059
  if (entries.length === 0) {
1144
1060
  decorateComposerStats();
1145
- decorateFooterAction();
1146
1061
  return;
1147
1062
  }
1148
1063
 
@@ -1151,7 +1066,6 @@
1151
1066
  renderPinned(entries, sessions, workspaces, settings);
1152
1067
  if (settings.colors) decorateRows(entries, sessions, data.statuses, settings);
1153
1068
  decorateComposerStats();
1154
- decorateFooterAction();
1155
1069
  }
1156
1070
 
1157
1071
  function schedule() {
@@ -1906,17 +1820,36 @@
1906
1820
  return h("button", {
1907
1821
  type: "button",
1908
1822
  className: "wsr-footer-action",
1909
- "data-wsr-footer": "true",
1910
- "data-wide": wide ? "true" : "false",
1911
1823
  title: label,
1912
1824
  "aria-label": label,
1913
1825
  "aria-haspopup": "dialog",
1826
+ style: {
1827
+ boxSizing: "border-box",
1828
+ width: "100%",
1829
+ alignSelf: "stretch",
1830
+ display: "flex",
1831
+ alignItems: "center",
1832
+ justifyContent: "flex-start",
1833
+ gap: "10px",
1834
+ minHeight: "40px",
1835
+ padding: "0 10px",
1836
+ border: "none",
1837
+ background: "transparent",
1838
+ color: "var(--dsw-alias-label-primary)",
1839
+ borderRadius: "10px",
1840
+ font: "inherit",
1841
+ fontSize: "14px",
1842
+ lineHeight: "22px",
1843
+ cursor: "pointer",
1844
+ textAlign: "left",
1845
+ },
1914
1846
  onClick: function () { openTrashPanel(); },
1915
1847
  },
1916
- typeof Icon === "function"
1917
- ? h("span", { className: "wsr-footer-glyph", "aria-hidden": "true" }, h(Icon, { size: wide ? 16 : 18 }))
1918
- : null,
1919
- wide ? h("span", { className: "wsr-footer-label" }, label) : null);
1848
+ h("span", {
1849
+ style: { display: "inline-flex", alignItems: "center", justifyContent: "center", width: "20px", height: "20px", flex: "none" },
1850
+ "aria-hidden": "true",
1851
+ }, typeof Icon === "function" ? h(Icon, { size: 18 }) : null),
1852
+ wide ? h("span", { style: { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, label) : null);
1920
1853
  }
1921
1854
 
1922
1855
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.13.4",
3
+ "version": "0.13.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, per-session token statistics split by tool, and moving a session to another workspace.",
5
5
  "license": "MIT",
6
6
  "author": "chyxhtc",