dsh-ws-recency 0.13.0 → 0.13.1

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 +49 -9
  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.0/dsh-ws-recency-0.13.0.tgz
138
+ dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.13.1/dsh-ws-recency-0.13.1.tgz
139
139
  ```
140
140
 
141
141
  装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
package/client.js CHANGED
@@ -132,11 +132,14 @@
132
132
  ".wsr-move-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
133
133
  ".wsr-move-path{font-size:11px;color:var(--dsw-alias-label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
134
134
  ".wsr-move-badge{font-size:11px;color:var(--dsw-alias-label-tertiary)}",
135
- ".wsr-trash-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
136
- ".wsr-footer-action{display:inline-flex;align-items:center;gap:6px;border:none;background:0 0;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;padding:4px 8px;border-radius:6px}",
135
+ ".wsr-trash-row{display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,rgba(255,255,255,.04))}",
136
+ ".wsr-footer-action{display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;border:none;background:0 0;color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit;cursor:pointer;padding:6px 8px;border-radius:8px;text-align:left}",
137
137
  ".wsr-footer-action:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary)}",
138
- ".wsr-footer-label{font-size:12px}",
139
- ".wsr-trash-actions{display:flex;gap:6px;flex:none}",
138
+ ".wsr-footer-label{font-size:inherit;line-height:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
139
+ ".wsr-trash-actions{display:flex;gap:6px;flex:none;align-items:center;white-space:nowrap}",
140
+ ".wsr-btn{border:.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.16));background:0 0;color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit;font-size:12px;line-height:1.6;padding:3px 10px;border-radius:6px;cursor:pointer;white-space:nowrap;flex:none}",
141
+ ".wsr-btn:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}",
142
+ ".wsr-btn-danger{border-color:var(--dsw-alias-state-error-primary,#d9534f);color:var(--dsw-alias-state-error-primary,#d9534f)}",
140
143
  ".wsr-danger{border-color:var(--dsw-alias-state-error-primary,#d9534f);color:var(--dsw-alias-state-error-primary,#d9534f)}",
141
144
  ".wsr-chart{display:flex;flex-direction:column;gap:6px}",
142
145
  ".wsr-chart-title{font-size:11px;color:var(--dsw-alias-label-tertiary)}",
@@ -239,7 +242,7 @@
239
242
  "trash.purge": "彻底删除",
240
243
  "trash.confirmRestore": "恢复到原来的工作区?",
241
244
  "trash.confirmPurge": "彻底删除这份日志?不可恢复。",
242
- "trash.restored": "已恢复,并重新挂回原工作区。若侧栏还没出现,去「补登记游离会话」点一下扫描(或重启应用)刷新列表。",
245
+ "trash.restored": "已恢复,并重新挂回原工作区。若侧栏还没出现,点下面的「刷新界面」(或去「补登记游离会话」点「扫描并刷新」)。",
243
246
  "trash.purged": "已彻底删除。",
244
247
  "trash.working": "处理中…",
245
248
  "trash.failed": "操作失败:",
@@ -318,7 +321,7 @@
318
321
  "trash.purge": "Delete for good",
319
322
  "trash.confirmRestore": "Restore it to its original workspace?",
320
323
  "trash.confirmPurge": "Delete this log for good? This cannot be undone.",
321
- "trash.restored": "Restored and re-attached to its workspace. If the sidebar has not picked it up, run the \"Adopt unlisted sessions\" scan (or restart the app).",
324
+ "trash.restored": "Restored and re-attached to its workspace. If the sidebar has not picked it up, press \"Reload UI\" below (or run \"Scan and reload\").",
322
325
  "trash.purged": "Deleted for good.",
323
326
  "trash.working": "Working\u2026",
324
327
  "trash.failed": "Action failed: ",
@@ -915,6 +918,39 @@
915
918
  return typeof id === "string" && id !== "" ? id : null;
916
919
  }
917
920
 
921
+ /**
922
+ * Match the footer action to its neighbours.
923
+ *
924
+ * The footer slot stacks actions, but each shell entry carries its own
925
+ * sizing; copying the metrics of the first real sibling keeps our row on
926
+ * the same baseline, font size and width instead of centring a smaller one.
927
+ */
928
+ function decorateFooterAction() {
929
+ if (typeof document === "undefined") return;
930
+ var mine = document.querySelector('[data-wsr-footer="true"]');
931
+ if (mine === null || typeof mine.getAttribute !== "function") return;
932
+ var container = mine.parentElement;
933
+ if (container === null || typeof container.querySelectorAll !== "function") return;
934
+ if (typeof window === "undefined" || typeof window.getComputedStyle !== "function") return;
935
+ var candidates = container.querySelectorAll("button");
936
+ var template = null;
937
+ for (var i = 0; i < candidates.length; i += 1) {
938
+ var candidate = candidates[i];
939
+ if (candidate === mine) continue;
940
+ if (typeof candidate.getAttribute === "function" && candidate.getAttribute("data-wsr-footer") !== null) continue;
941
+ template = candidate;
942
+ break;
943
+ }
944
+ if (template === null) return;
945
+ var metrics = ["font-size", "font-family", "font-weight", "line-height", "padding", "gap", "width", "height", "justify-content", "color", "border-radius", "margin"];
946
+ for (var k = 0; k < metrics.length; k += 1) {
947
+ var value = "";
948
+ try { value = window.getComputedStyle(template).getPropertyValue(metrics[k]) || ""; } catch (error) { value = ""; }
949
+ if (value === "" || value === "auto") continue;
950
+ mine.style[metrics[k]] = value;
951
+ }
952
+ }
953
+
918
954
  /** The nearest horizontal flex row above the stats: the whole footer dock. */
919
955
  function composerDockOf(row) {
920
956
  var node = row;
@@ -1043,12 +1079,14 @@
1043
1079
  var settings = settingsOf();
1044
1080
  if (!ready(sessions) || !ready(workspaces)) {
1045
1081
  decorateComposerStats();
1082
+ decorateFooterAction();
1046
1083
  return;
1047
1084
  }
1048
1085
 
1049
1086
  var entries = collect();
1050
1087
  if (entries.length === 0) {
1051
1088
  decorateComposerStats();
1089
+ decorateFooterAction();
1052
1090
  return;
1053
1091
  }
1054
1092
 
@@ -1057,6 +1095,7 @@
1057
1095
  renderPinned(entries, sessions, workspaces, settings);
1058
1096
  if (settings.colors) decorateRows(entries, sessions, data.statuses, settings);
1059
1097
  decorateComposerStats();
1098
+ decorateFooterAction();
1060
1099
  }
1061
1100
 
1062
1101
  function schedule() {
@@ -1737,7 +1776,7 @@
1737
1776
  if (entry.restorable === true) {
1738
1777
  var restore = document.createElement("button");
1739
1778
  restore.type = "button";
1740
- restore.className = "wsr-step";
1779
+ restore.className = "wsr-btn";
1741
1780
  restore.textContent = t("trash.restore");
1742
1781
  restore.addEventListener("click", function () {
1743
1782
  if (typeof window.confirm === "function" && !window.confirm(t("trash.confirmRestore"))) return;
@@ -1753,7 +1792,7 @@
1753
1792
  }
1754
1793
  var purge = document.createElement("button");
1755
1794
  purge.type = "button";
1756
- purge.className = "wsr-step wsr-danger";
1795
+ purge.className = "wsr-btn wsr-btn-danger";
1757
1796
  purge.textContent = t("trash.purge");
1758
1797
  purge.addEventListener("click", function () {
1759
1798
  if (typeof window.confirm === "function" && !window.confirm(t("trash.confirmPurge"))) return;
@@ -1787,6 +1826,7 @@
1787
1826
  return h("button", {
1788
1827
  type: "button",
1789
1828
  className: "wsr-footer-action",
1829
+ "data-wsr-footer": "true",
1790
1830
  title: label,
1791
1831
  "aria-label": label,
1792
1832
  onClick: function () { openTrashPanel(); },
@@ -1841,7 +1881,7 @@
1841
1881
  h("div", { className: "wsr-setDesc" }, message === "" ? t("adopt.description") : message),
1842
1882
  ),
1843
1883
  h("div", { className: "wsr-controls" },
1844
- h("button", { type: "button", className: "wsr-step", onClick: run }, t("adopt.action")),
1884
+ h("button", { type: "button", className: "wsr-btn", onClick: run }, t("adopt.action")),
1845
1885
  ),
1846
1886
  );
1847
1887
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ws-recency",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
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",