dsh-ws-recency 0.10.3 → 0.10.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 +1 -1
- package/client.js +37 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ dsh plugin --profile <profile> add github:chyxhtc/dsh-ws-recency
|
|
|
110
110
|
或固定版本的预构建包:
|
|
111
111
|
|
|
112
112
|
```powershell
|
|
113
|
-
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.10.
|
|
113
|
+
dsh plugin --profile <profile> add https://github.com/chyxhtc/dsh-ws-recency/releases/download/v0.10.4/dsh-ws-recency-0.10.4.tgz
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
装完把 `dsh-ws-recency` 加进 `~/.hypers-work/profiles/<profile>/package.json` 的 `dsh.profile.bundles`,重启应用。
|
package/client.js
CHANGED
|
@@ -847,6 +847,31 @@
|
|
|
847
847
|
try { return icon.cloneNode(true); } catch (error) { return null; }
|
|
848
848
|
}
|
|
849
849
|
|
|
850
|
+
/** Copy the host pill's own computed metrics onto the clone. */
|
|
851
|
+
function copyPillMetrics(template, wrapper, button) {
|
|
852
|
+
if (template === null || template === undefined || typeof window === "undefined" || typeof window.getComputedStyle !== "function") return;
|
|
853
|
+
var read = function (name) {
|
|
854
|
+
try {
|
|
855
|
+
return window.getComputedStyle(template).getPropertyValue(name) || "";
|
|
856
|
+
} catch (error) {
|
|
857
|
+
return "";
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
var inherited = ["font-size", "font-family", "font-weight", "line-height", "letter-spacing"];
|
|
861
|
+
for (var i = 0; i < inherited.length; i += 1) {
|
|
862
|
+
var value = read(inherited[i]);
|
|
863
|
+
if (value !== "") {
|
|
864
|
+
wrapper.style[inherited[i]] = value;
|
|
865
|
+
button.style[inherited[i]] = value;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
var own = ["padding", "gap", "border-radius", "color"];
|
|
869
|
+
for (var j = 0; j < own.length; j += 1) {
|
|
870
|
+
var metric = read(own[j]);
|
|
871
|
+
if (metric !== "") button.style[own[j]] = metric;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
850
875
|
/**
|
|
851
876
|
* Add one pill at the END of the composer footer that opens the analysis
|
|
852
877
|
* panel for the conversation on screen.
|
|
@@ -871,9 +896,17 @@
|
|
|
871
896
|
|
|
872
897
|
if (existing === null) {
|
|
873
898
|
var template = pillTemplateOf(row);
|
|
899
|
+
/* Wrapped exactly like a host pill (its anchor span) and carrying the
|
|
900
|
+
host's own computed metrics: appended to the footer dock rather than
|
|
901
|
+
into the stats row, this pill would otherwise inherit the dock's font
|
|
902
|
+
size and read larger than its neighbours. */
|
|
903
|
+
var wrapper = document.createElement("span");
|
|
904
|
+
wrapper.setAttribute("data-wsr-composer-analysis", "true");
|
|
905
|
+
var anchorTemplate = template === null ? null : template.parentElement;
|
|
906
|
+
var anchorClass = anchorTemplate !== null && typeof anchorTemplate.className === "string" ? anchorTemplate.className : "";
|
|
907
|
+
if (anchorClass !== "") wrapper.className = anchorClass;
|
|
874
908
|
var button = document.createElement("button");
|
|
875
909
|
button.type = "button";
|
|
876
|
-
button.setAttribute("data-wsr-composer-analysis", "true");
|
|
877
910
|
var base = template !== null && typeof template.className === "string" ? template.className : "";
|
|
878
911
|
button.className = base === "" ? "wsr-pill" : base + " wsr-pill";
|
|
879
912
|
var icon = cloneIconOf(template);
|
|
@@ -889,7 +922,9 @@
|
|
|
889
922
|
var id = currentConversationId();
|
|
890
923
|
if (id !== null) openStatsPanel(id);
|
|
891
924
|
});
|
|
892
|
-
|
|
925
|
+
copyPillMetrics(template, wrapper, button);
|
|
926
|
+
wrapper.appendChild(button);
|
|
927
|
+
composerPill = wrapper;
|
|
893
928
|
} else {
|
|
894
929
|
composerPill = existing;
|
|
895
930
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ws-recency",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.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, and per-session token statistics split by tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "chyxhtc",
|