dsh-dpharness 0.6.5 → 0.6.7
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/lib/changelog.js +18 -0
- package/lib/client.js +171 -83
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/changelog.js
CHANGED
|
@@ -37,6 +37,24 @@ export function npmLatestUrl(pkg) {
|
|
|
37
37
|
* (用户要看的是行为变化,不是我们的 commit 分类)。
|
|
38
38
|
*/
|
|
39
39
|
export const CHANGELOG = [
|
|
40
|
+
{
|
|
41
|
+
version: "0.6.7",
|
|
42
|
+
date: "2026-10-23",
|
|
43
|
+
title: "「我的插件」每行的操作不再错位",
|
|
44
|
+
items: [
|
|
45
|
+
"「升级」按钮原来比同一行的其它按钮矮半格,头顶还多一条分隔线;现在与同行按钮同高对齐。",
|
|
46
|
+
"「卸载」不再单独掉到下一行最左:动作整组右对齐,窗口变窄时整组一起换行,不会散开。",
|
|
47
|
+
"点「升级」后的确认提示固定占两行,不再把整行挤变形;失败可直接在行内重试。",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
version: "0.6.6",
|
|
52
|
+
date: "2026-10-21",
|
|
53
|
+
title: "侧栏安装按钮与其它按钮同尺寸",
|
|
54
|
+
items: [
|
|
55
|
+
"右侧「今日推荐」卡里的安装按钮原来被拉满整行,看起来比下面的「复制命令 / 分享」大一号;现在按半行宽,三个按钮同宽同高。",
|
|
56
|
+
],
|
|
57
|
+
},
|
|
40
58
|
{
|
|
41
59
|
version: "0.6.5",
|
|
42
60
|
date: "2026-10-21",
|
package/lib/client.js
CHANGED
|
@@ -202,7 +202,23 @@ window.__ModuleLoader__.load({
|
|
|
202
202
|
/* 「更新」视图的行:第一行 = 谁 + 版本 + 操作;第二行 = 这是什么 + 包名 */
|
|
203
203
|
".dph_updItem{display:flex;flex-direction:column;gap:5px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);padding:8px 10px;flex:none}",
|
|
204
204
|
".dph_updOn{border-color:var(--dsw-alias-state-error-primary)}",
|
|
205
|
-
|
|
205
|
+
/* 行分两段:左信息、右动作。
|
|
206
|
+
2026-10-22 修错位:原来所有元素(名称/标签/版本/状态/6 个按钮)平铺在
|
|
207
|
+
一条 flex 行里,靠 `.dph_spacer{flex:1}` 顶住右端 —— 一旦这行放不下,
|
|
208
|
+
换行是按**单个元素**发生的,于是最后一个按钮(卸载)被单独甩到下一行最左。
|
|
209
|
+
现在把动作整组做成**一个** flex 项:放不下就整组换行,并因 margin-left:auto
|
|
210
|
+
保持右对齐,不会再出现"孤零零一个按钮掉到左边"。 */
|
|
211
|
+
".dph_upd{display:flex;align-items:center;gap:6px 10px;flex-wrap:wrap}",
|
|
212
|
+
".dph_updInfo{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}",
|
|
213
|
+
".dph_updActs{flex:none;max-width:100%;margin-left:auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}",
|
|
214
|
+
/* 破坏性动作(卸载)与可逆动作(保留/禁用)之间留一道分界,降低误触 */
|
|
215
|
+
".dph_actDanger{display:inline-flex;align-items:center;gap:8px;padding-left:10px;border-left:1px solid var(--dsw-alias-border-l2)}",
|
|
216
|
+
/* InstallRow 的「内联」变体:它本体是块(自带 padding-top:10px + 上边框),
|
|
217
|
+
直接塞进单行会让按钮比同排矮半格、头顶多一条横线 —— 用户截图里
|
|
218
|
+
「升级」比邻居低 5~6px 就是这条 padding 造成的。内联时把外壳清零。 */
|
|
219
|
+
".dph_instInline{margin-top:0;padding-top:0;border-top:0}",
|
|
220
|
+
/* 块级状态(进度/已装完/失败)落在行卡片里时,不要再叠一道内边框 */
|
|
221
|
+
".dph_updItem>.dph_instRow{margin-top:0;padding-top:0;border-top:0}",
|
|
206
222
|
".dph_updSub{font-size:11px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}",
|
|
207
223
|
".dph_updName{font-size:12px;font-weight:600;color:var(--dsw-alias-label-primary)}",
|
|
208
224
|
".dph_updVer{font-size:12px;color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums}",
|
|
@@ -267,7 +283,10 @@ window.__ModuleLoader__.load({
|
|
|
267
283
|
".dph_cmdbarCol{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:6px}",
|
|
268
284
|
".dph_cmdbarCol .dph_cmdbarCode{white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.5}",
|
|
269
285
|
/* 侧栏里的安装行同理:包名在窄栏里必须能换行,否则会顶出卡片右边界 */
|
|
270
|
-
".dph_railCard .dph_instRow{flex-direction:column;align-items:
|
|
286
|
+
".dph_railCard .dph_instRow{flex-direction:column;align-items:flex-start;gap:4px}",
|
|
287
|
+
/* 2026-10-21:安装按钮原被拉满整行(176px),比下面两列 88px 的「复制命令/分享」
|
|
288
|
+
宽一倍,看起来就是"比别的按钮大"。按半行宽 —— 与命令条网格单元格同宽。 */
|
|
289
|
+
".dph_railCard .dph_instRow .dph_btn{min-width:50%}",
|
|
271
290
|
".dph_railCard .dph_instHint{word-break:break-all}",
|
|
272
291
|
"@media (max-width:900px){.dph_work{grid-template-columns:minmax(0,1fr)}.dph_rail{display:contents}.dph_workHead,.dph_tabbar{order:0}.dph_dailySlot{order:1}.dph_mainCol{order:2}.dph_railSlot{order:3}.dph_railCard .dph_instRow{flex-direction:row;align-items:center}.dph_cmdbarCol{flex-direction:row;align-items:center}.dph_cmdbarCol .dph_cmdbarCode{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}",
|
|
273
292
|
/* ──────────────── 社群 + 订阅(2026-10-20) ────────────────
|
|
@@ -506,6 +525,8 @@ window.__ModuleLoader__.load({
|
|
|
506
525
|
"updates.ackNote": "红点在你打开本页后熄灭,只有再出现更新的版本才会重新亮。",
|
|
507
526
|
"updates.restartConfirm": "确认重启 dsh?重启后当前会话会中断。",
|
|
508
527
|
"updates.upgrade": "升级",
|
|
528
|
+
"updates.upgradeGo": "确认升级",
|
|
529
|
+
"updates.upgradeAsk": "确认升级?会改写本机 profile,装完需重启 dsh。",
|
|
509
530
|
"updates.upgradeConfirm": "确认升级到最新版?",
|
|
510
531
|
"updates.upgradeHint": "升级会在本机执行 dsh plugin add <包名>@latest,改的是你的 profile,装完需要重启 dsh。",
|
|
511
532
|
"updates.upgradeAll": "全部升级({n})",
|
|
@@ -836,6 +857,8 @@ window.__ModuleLoader__.load({
|
|
|
836
857
|
"updates.ackNote": "The dot clears once you open this page, and returns only when a newer version shows up.",
|
|
837
858
|
"updates.restartConfirm": "Restart dsh? The current session will be interrupted.",
|
|
838
859
|
"updates.upgrade": "Upgrade",
|
|
860
|
+
"updates.upgradeGo": "Confirm",
|
|
861
|
+
"updates.upgradeAsk": "Confirm? This rewrites your local profile; a restart is needed.",
|
|
839
862
|
"updates.upgradeConfirm": "Upgrade to the latest version?",
|
|
840
863
|
"updates.upgradeHint": "This runs dsh plugin add <pkg>@latest against your profile; a restart is needed afterwards.",
|
|
841
864
|
"updates.upgradeAll": "Upgrade all ({n})",
|
|
@@ -2753,25 +2776,42 @@ window.__ModuleLoader__.load({
|
|
|
2753
2776
|
/* 已经装过的**不要再写"安装"** —— 实测有用户对着早就装好的插件反复点「安装」,
|
|
2754
2777
|
然后判定"安装不成功"(卡片上的「已安装 vX」标注还不够,按钮才是他看的那一处)。 */
|
|
2755
2778
|
const idleLabel = upgrading ? t("updates.upgrade") : item.installed ? t("install.reinstall") : t("install.action");
|
|
2756
|
-
const confirmLabel = upgrading ? t("updates.
|
|
2779
|
+
const confirmLabel = upgrading ? t("updates.upgradeGo") : item.installed ? t("install.reinstallConfirm") : t("install.confirm");
|
|
2757
2780
|
|
|
2758
2781
|
const job = state.install;
|
|
2759
2782
|
const mine = job && job.target === item.pkg;
|
|
2760
2783
|
const busyElsewhere = !!(job && job.active && !mine);
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2784
|
+
const phase = mine ? String(job.phase || "") : "";
|
|
2785
|
+
const running = !!(mine && job.active);
|
|
2786
|
+
const finished = !!(mine && !job.active && (phase === "okMarket" || phase === "okLocal"));
|
|
2787
|
+
const failed = !!(mine && !job.active && phase === "failed");
|
|
2788
|
+
|
|
2789
|
+
/* 两个实例,同一份宿主状态(2026-10-22):
|
|
2790
|
+
· mode="act" —— 行内按钮位:只出按钮(含二次确认),外壳走 `.dph_instInline`,
|
|
2791
|
+
与同排按钮同高同基线;运行中/已装完时让位给块位,避免重复。
|
|
2792
|
+
· mode="block" —— 行下状态位:只出进度/结果/失败这类**长文案**,空闲时不出。
|
|
2793
|
+
· 默认(无 mode)—— 历史行为,目录卡/套装/每日推荐照旧用「一块包全部」。
|
|
2794
|
+
失败是例外:块位出原因,行内恢复「升级」按钮让用户重试。 */
|
|
2795
|
+
const mode = props.mode === "act" ? "act" : props.mode === "block" ? "block" : "all";
|
|
2796
|
+
const inline = mode === "act";
|
|
2797
|
+
const shell = (children) => h("div", { className: "dph_instRow" + (inline ? " dph_instInline" : "") }, children);
|
|
2798
|
+
const colShell = (children) => h("div", { className: "dph_instRow dph_instCol" + (inline ? " dph_instInline" : "") }, children);
|
|
2799
|
+
if (mode === "act" && (running || finished)) return null;
|
|
2800
|
+
if (mode === "block" && !running && !finished && !failed) return null;
|
|
2801
|
+
|
|
2802
|
+
if (running) {
|
|
2803
|
+
return shell([
|
|
2764
2804
|
h("span", { className: "dph_instMsg", key: "msg" }, job.message),
|
|
2765
2805
|
]);
|
|
2766
2806
|
}
|
|
2767
2807
|
|
|
2768
|
-
if (
|
|
2808
|
+
if (finished) {
|
|
2769
2809
|
/* 三态(host 读盘得出):changed 装上了 / same **本来就是目标版本**(这是成功)/
|
|
2770
2810
|
none 真的什么都没发生。把 same 说成"什么都没装"会让人以为安装失败
|
|
2771
2811
|
(2026-10-12 实测被这句误导:用户对着早就装好的插件点安装)。 */
|
|
2772
2812
|
const outcome = job.outcome || (job.changed === false ? "same" : "changed");
|
|
2773
2813
|
const needsRestart = outcome === "changed" && job.phase === "okLocal";
|
|
2774
|
-
return
|
|
2814
|
+
return shell([
|
|
2775
2815
|
h("span", { className: "dph_instMsg " + (outcome === "none" ? "dph_instBad" : "dph_instOk"), key: "msg" },
|
|
2776
2816
|
outcome === "none" ? t("updates.noChangeTitle") : outcome === "same" ? t("updates.alreadyTitle") : job.message),
|
|
2777
2817
|
outcome === "none" ? h("span", { className: "dph_instHint", key: "nochange" }, format(t("updates.noChange"), { v: String(job.after || job.before || "?") })) : null,
|
|
@@ -2803,7 +2843,7 @@ window.__ModuleLoader__.load({
|
|
|
2803
2843
|
]);
|
|
2804
2844
|
}
|
|
2805
2845
|
|
|
2806
|
-
if (
|
|
2846
|
+
if (failed && mode !== "act") {
|
|
2807
2847
|
/* 供应链策略暂停:给出被拦的条目 + 还要等多久 + 两条通路。
|
|
2808
2848
|
只回一句英文错误码,用户会以为"插件坏了"(2026-10-14 用户实际撞到)。 */
|
|
2809
2849
|
if (job.why === "release-age" && job.reject) {
|
|
@@ -2817,7 +2857,7 @@ window.__ModuleLoader__.load({
|
|
|
2817
2857
|
const hoursLeft = latest > 0
|
|
2818
2858
|
? Math.max(1, Math.ceil((latest + 24 * 60 * 60 * 1000 - Date.now()) / (60 * 60 * 1000)))
|
|
2819
2859
|
: 0;
|
|
2820
|
-
return
|
|
2860
|
+
return colShell([
|
|
2821
2861
|
h("span", { className: "dph_instMsg dph_instBad", key: "title" }, t("updates.releaseAgeTitle")),
|
|
2822
2862
|
h("span", { className: "dph_instHint", key: "body" }, format(t("updates.releaseAgeBody"), {
|
|
2823
2863
|
n: String(aged.count || agedEntries.length),
|
|
@@ -2832,7 +2872,7 @@ window.__ModuleLoader__.load({
|
|
|
2832
2872
|
必须把原因、两端版本与放行通道说清楚 —— 只说"失败"用户只会觉得功能坏了
|
|
2833
2873
|
(实测踩到:通用错误提取抓不到这句话,界面只剩 "dsh: nothing was installed.")。 */
|
|
2834
2874
|
if (job.why === "incompatible" && job.reject) {
|
|
2835
|
-
return
|
|
2875
|
+
return colShell([
|
|
2836
2876
|
h("span", { className: "dph_instMsg dph_instBad", key: "title" }, t("updates.blockedTitle")),
|
|
2837
2877
|
h("span", { className: "dph_instHint", key: "body" }, format(t("updates.blockedBody"), { spec: job.reject.spec || "", dsh: job.reject.dsh || "" })),
|
|
2838
2878
|
h("span", { className: "dph_instHint", key: "how" }, t("updates.blockedHow")),
|
|
@@ -2847,39 +2887,52 @@ window.__ModuleLoader__.load({
|
|
|
2847
2887
|
}, copiedRaw ? t("action.copied") : t("updates.copyRaw")),
|
|
2848
2888
|
]);
|
|
2849
2889
|
}
|
|
2850
|
-
return
|
|
2890
|
+
return shell([
|
|
2851
2891
|
h("span", { className: "dph_instMsg dph_instBad", key: "msg" }, t("install.failed") + ":" + job.message),
|
|
2852
2892
|
]);
|
|
2853
2893
|
}
|
|
2854
2894
|
|
|
2855
2895
|
if (confirming) {
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2896
|
+
/* 确认段固定两行:说明一行、两个按钮一组。
|
|
2897
|
+
为什么不让它跟说明同排平铺 —— 372px 浮窗里说明 + 两个按钮放不下,
|
|
2898
|
+
平铺时「取消」会被单独换到下一行最左(与本次修的主问题同一种病)。
|
|
2899
|
+
收进 `.dph_logCmd` 后一组按钮只会在右端整体换行,不会散开。 */
|
|
2900
|
+
return colShell([
|
|
2901
|
+
/* 二次确认的两行字分工:**问句**(要不要升)在正文,
|
|
2902
|
+
全量说明(具体命令 / 需要重启)挂 title。原来把一句 48 字
|
|
2903
|
+
说明书塞在这行,按钮反而是个问句 —— 问答错位,且宽度一超就换行。 */
|
|
2904
|
+
h("span", {
|
|
2905
|
+
className: "dph_instHint",
|
|
2906
|
+
key: "hint",
|
|
2907
|
+
title: upgrading ? t("updates.upgradeHint") : t("install.hint"),
|
|
2908
|
+
}, t(upgrading ? "updates.upgradeAsk" : "install.hint")),
|
|
2909
|
+
h("span", { className: "dph_logCmd", key: "acts" }, [
|
|
2910
|
+
h("button", {
|
|
2911
|
+
className: "dph_btn dph_btnPrimary",
|
|
2912
|
+
key: "go",
|
|
2913
|
+
type: "button",
|
|
2914
|
+
onClick: () => {
|
|
2915
|
+
setConfirming(false);
|
|
2916
|
+
runInstall(item, t, kind);
|
|
2917
|
+
},
|
|
2918
|
+
}, confirmLabel),
|
|
2919
|
+
h("button", {
|
|
2920
|
+
className: "dph_btn",
|
|
2921
|
+
key: "cancel",
|
|
2922
|
+
type: "button",
|
|
2923
|
+
onClick: () => {
|
|
2924
|
+
setConfirming(false);
|
|
2925
|
+
/* 取消单独记一次:只埋 install(确认后)的话,
|
|
2926
|
+
「想装但被确认框劝退」的人会整段消失,
|
|
2927
|
+
而他们恰恰是文案/门槛该优化的对象。 */
|
|
2928
|
+
track("plugin_hub", { action: upgrading ? "upgrade_cancel" : "install_cancel", via: "confirm" });
|
|
2929
|
+
},
|
|
2930
|
+
}, t("install.cancel")),
|
|
2931
|
+
]),
|
|
2879
2932
|
]);
|
|
2880
2933
|
}
|
|
2881
2934
|
|
|
2882
|
-
return
|
|
2935
|
+
return shell([
|
|
2883
2936
|
h("button", {
|
|
2884
2937
|
className: "dph_btn dph_btnPrimary",
|
|
2885
2938
|
key: "install",
|
|
@@ -3910,35 +3963,52 @@ window.__ModuleLoader__.load({
|
|
|
3910
3963
|
if (nameZh) sub.push(String(item.name));
|
|
3911
3964
|
if (pinned) sub.push(format(t("updates.pinnedNote"), { v: String(item.current || "") }));
|
|
3912
3965
|
usageSubLines(item).forEach((line) => sub.push(line));
|
|
3966
|
+
/* 动作全部收进**一个** flex 项(`.dph_updActs`):放不下时整组换行并右对齐,
|
|
3967
|
+
不会再出现"最后一个按钮被单独甩到下一行最左"(2026-10-22 用户截图)。 */
|
|
3968
|
+
const acts = verdictActions(item, key, copied, mark);
|
|
3969
|
+
if (removable) {
|
|
3970
|
+
/* 「保留」标注:人工高于机器 —— 标了就不再进清理建议;再点一次取消 */
|
|
3971
|
+
acts.push(h("button", {
|
|
3972
|
+
className: "dph_btn",
|
|
3973
|
+
key: "keep",
|
|
3974
|
+
type: "button",
|
|
3975
|
+
title: t("usage.keepHint"),
|
|
3976
|
+
onClick: () => {
|
|
3977
|
+
const on = !kept;
|
|
3978
|
+
toggleKeep(item.name);
|
|
3979
|
+
track("plugin_hub", { action: "keep_toggle", on: on, scope: "updates" });
|
|
3980
|
+
},
|
|
3981
|
+
}, kept ? t("usage.kept") : t("usage.keep")));
|
|
3982
|
+
/* 启用/禁用:可逆的「观察」动作(宿主提供启停能力时才有这一项) */
|
|
3983
|
+
if (typeof item.enabled === "boolean") acts.push(h(ToggleButton, { key: "toggle", item: item }));
|
|
3984
|
+
/* 卸载入口:破坏性操作,自己带两步确认;本插件自己那一行不给
|
|
3985
|
+
(卸自己等于把管理界面卸掉)。外面那层 `.dph_actDanger` 只负责
|
|
3986
|
+
与可逆动作拉一道分界,降低误触。 */
|
|
3987
|
+
acts.push(h("span", { className: "dph_actDanger", key: "remove" },
|
|
3988
|
+
h(RemoveButton, { key: "rm", item: { pkg: String(item.name || ""), name: item.nameZh || String(item.name || "") } })));
|
|
3989
|
+
}
|
|
3913
3990
|
return h("div", { className: "dph_updItem" + (item.outdated === true ? " dph_updOn" : ""), key: key }, [
|
|
3914
3991
|
h("div", { className: "dph_upd", key: "row" }, [
|
|
3915
|
-
h("
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
removable ? h("button", {
|
|
3925
|
-
className: "dph_btn",
|
|
3926
|
-
key: "keep",
|
|
3927
|
-
type: "button",
|
|
3928
|
-
title: t("usage.keepHint"),
|
|
3929
|
-
onClick: () => {
|
|
3930
|
-
const on = !kept;
|
|
3931
|
-
toggleKeep(item.name);
|
|
3932
|
-
track("plugin_hub", { action: "keep_toggle", on: on, scope: "updates" });
|
|
3933
|
-
},
|
|
3934
|
-
}, kept ? t("usage.kept") : t("usage.keep")) : null,
|
|
3935
|
-
/* 启用/禁用:可逆的「观察」动作(宿主提供启停能力时才有这一项) */
|
|
3936
|
-
removable && typeof item.enabled === "boolean" ? h(ToggleButton, { key: "toggle", item: item }) : null,
|
|
3937
|
-
/* 卸载入口:与"该不该升"并排。破坏性操作,自己带两步确认;
|
|
3938
|
-
本插件自己那一行不给(卸自己等于把管理界面卸掉)。 */
|
|
3939
|
-
removable ? h(RemoveButton, { key: "remove", item: { pkg: String(item.name || ""), name: item.nameZh || String(item.name || "") } }) : null,
|
|
3992
|
+
h("div", { className: "dph_updInfo", key: "info" }, [
|
|
3993
|
+
h("span", { className: "dph_updName", key: "n" }, (prefix ? prefix + " · " : "") + (nameZh || String(item.name))),
|
|
3994
|
+
untranslated ? h("span", { className: "dph_tag", key: "raw" }, t("label.untranslated")) : null,
|
|
3995
|
+
blocked ? h("span", { className: "dph_tag", key: "blocked" }, t("updates.blocked")) : null,
|
|
3996
|
+
pinned ? h("span", { className: "dph_tag", key: "pinned" }, t("updates.pinned")) : null,
|
|
3997
|
+
tier ? h("span", { className: "dph_tag", key: "usage" }, tierLabel(tier)) : null,
|
|
3998
|
+
h("span", { className: "dph_updVer", key: "v" }, "v" + String(item.current || "?") + (item.outdated === true ? " → v" + String(item.latest || "") : "")),
|
|
3999
|
+
]),
|
|
4000
|
+
h("div", { className: "dph_updActs", key: "acts" }, [verdictStatus(item, key)].concat(acts)),
|
|
3940
4001
|
]),
|
|
3941
4002
|
sub.length ? h("div", { className: "dph_updSub", key: "sub" }, sub.join(" · ")) : null,
|
|
4003
|
+
/* 进度 / 已装完 / 失败这类**长文案**走在行下方的块位实例上:
|
|
4004
|
+
一行里塞长句必然把整个布局挤崩(用户 2026-10-22 点完升级后的截图)。
|
|
4005
|
+
以具体版本号作 target,与行内按钮构造的 pkg 完全一致,两处才认得出是同一个任务。 */
|
|
4006
|
+
h(InstallRow, {
|
|
4007
|
+
key: "inst",
|
|
4008
|
+
mode: "block",
|
|
4009
|
+
item: { pkg: String(item.name) + "@" + String(item.latest || ""), current: item.current },
|
|
4010
|
+
kind: "upgrade",
|
|
4011
|
+
}),
|
|
3942
4012
|
]);
|
|
3943
4013
|
}
|
|
3944
4014
|
|
|
@@ -4123,10 +4193,14 @@ window.__ModuleLoader__.load({
|
|
|
4123
4193
|
}
|
|
4124
4194
|
|
|
4125
4195
|
/**
|
|
4126
|
-
*
|
|
4196
|
+
* 一行的**结论**(只读,不含按钮)。三态必须三句话:可升级/已是最新/查不到 ——
|
|
4127
4197
|
* 把「查不到」显示成「已是最新」是本插件明确禁止的那类错误。
|
|
4198
|
+
*
|
|
4199
|
+
* 2026-10-22 与按钮拆开:结论留在行的右段,动作另起一组(verdictActions)。
|
|
4200
|
+
* 原因是状态与动作混在同一条 flex 行里时,元素一多,换行就按**单个元素**发生,
|
|
4201
|
+
* 尾部按钮被甩到下一行最左 —— 用户截图上「卸载」孤零零掉下去正是这样来的。
|
|
4128
4202
|
*/
|
|
4129
|
-
function
|
|
4203
|
+
function verdictStatus(item, key) {
|
|
4130
4204
|
if (!item || item.outdated === null) {
|
|
4131
4205
|
return h("span", { className: "dph_updNote", key: key + ":unknown" }, t("updates.unknown"));
|
|
4132
4206
|
}
|
|
@@ -4135,29 +4209,43 @@ window.__ModuleLoader__.load({
|
|
|
4135
4209
|
}
|
|
4136
4210
|
if (isIgnored(item)) {
|
|
4137
4211
|
/* 忽略记的是**具体目标版本**:出了更新的版本(latest 变了)提醒会自己回来 ——
|
|
4138
|
-
所以这里显示"忽略了哪一版"
|
|
4139
|
-
return h("span", { className: "
|
|
4140
|
-
h("span", { className: "dph_updNote", key: "note" }, format(t("updates.ignored"), { v: String(item.latest || "") })),
|
|
4141
|
-
h("button", {
|
|
4142
|
-
className: "dph_btn",
|
|
4143
|
-
key: "undo",
|
|
4144
|
-
type: "button",
|
|
4145
|
-
onClick: () => {
|
|
4146
|
-
setIgnored(item.name, null);
|
|
4147
|
-
track("plugin_hub", { action: "ignore_off", pkg: String(item.name || "") });
|
|
4148
|
-
},
|
|
4149
|
-
}, t("updates.unignore")),
|
|
4150
|
-
]);
|
|
4212
|
+
所以这里显示"忽略了哪一版",并给一个取消入口。 */
|
|
4213
|
+
return h("span", { className: "dph_updNote", key: key + ":ignored" }, format(t("updates.ignored"), { v: String(item.latest || "") }));
|
|
4151
4214
|
}
|
|
4152
|
-
return h("span", { className: "
|
|
4153
|
-
|
|
4215
|
+
return h("span", { className: "dph_tag dph_tagBad", key: key + ":out" }, t("updates.outdated"));
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
/**
|
|
4219
|
+
* 一行的**动作**(可交互):升级 + 复制命令 + 忽略此版本;已忽略时只剩「取消忽略」。
|
|
4220
|
+
* 返回数组,由 updateRow 与保留/禁用/卸载拼成同一组(`.dph_updActs`)。
|
|
4221
|
+
*/
|
|
4222
|
+
function verdictActions(item, key, copied, mark) {
|
|
4223
|
+
if (!item || item.outdated !== true) return [];
|
|
4224
|
+
if (isIgnored(item)) {
|
|
4225
|
+
return [h("button", {
|
|
4226
|
+
className: "dph_btn",
|
|
4227
|
+
key: key + ":undo",
|
|
4228
|
+
type: "button",
|
|
4229
|
+
onClick: () => {
|
|
4230
|
+
setIgnored(item.name, null);
|
|
4231
|
+
track("plugin_hub", { action: "ignore_off", pkg: String(item.name || "") });
|
|
4232
|
+
},
|
|
4233
|
+
}, t("updates.unignore"))];
|
|
4234
|
+
}
|
|
4235
|
+
return [
|
|
4154
4236
|
/* 一键升级**复用目录项那条安装通道**(二次确认 → 进度 → 失败原因 → 重启提示):
|
|
4155
4237
|
一条路径两处使用,行为才不会分叉。
|
|
4156
|
-
目标用**具体版本号**(更新检查已经知道它)—— 实测 `@latest` 在 dsh 上会静默空转。
|
|
4157
|
-
|
|
4238
|
+
目标用**具体版本号**(更新检查已经知道它)—— 实测 `@latest` 在 dsh 上会静默空转。
|
|
4239
|
+
mode="act":只出行内按钮,外壳不带块级的 padding/border,与同排按钮同基线。 */
|
|
4240
|
+
h(InstallRow, {
|
|
4241
|
+
key: key + ":do",
|
|
4242
|
+
mode: "act",
|
|
4243
|
+
item: { pkg: String(item.name) + "@" + String(item.latest), current: item.current },
|
|
4244
|
+
kind: "upgrade",
|
|
4245
|
+
}),
|
|
4158
4246
|
h("button", {
|
|
4159
4247
|
className: "dph_btn",
|
|
4160
|
-
key: "copy",
|
|
4248
|
+
key: key + ":copy",
|
|
4161
4249
|
type: "button",
|
|
4162
4250
|
title: item.upgrade || "",
|
|
4163
4251
|
onClick: () => copyText(item.upgrade || "", () => {
|
|
@@ -4169,7 +4257,7 @@ window.__ModuleLoader__.load({
|
|
|
4169
4257
|
否则用户每次打开都被同一个红点提醒一遍,久了就学会无视红点(那才是真损失)。 */
|
|
4170
4258
|
h("button", {
|
|
4171
4259
|
className: "dph_btn",
|
|
4172
|
-
key: "ignore",
|
|
4260
|
+
key: key + ":ignore",
|
|
4173
4261
|
type: "button",
|
|
4174
4262
|
title: format(t("updates.ignoreHint"), { v: String(item.latest || "") }),
|
|
4175
4263
|
onClick: () => {
|
|
@@ -4177,7 +4265,7 @@ window.__ModuleLoader__.load({
|
|
|
4177
4265
|
track("plugin_hub", { action: "ignore_on", pkg: String(item.name || ""), v: String(item.latest || "") });
|
|
4178
4266
|
},
|
|
4179
4267
|
}, t("updates.ignore")),
|
|
4180
|
-
]
|
|
4268
|
+
];
|
|
4181
4269
|
}
|
|
4182
4270
|
|
|
4183
4271
|
/**
|
package/lib/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export const name = "dpharness";
|
|
|
48
48
|
/** The dsh web server service used to register HTTP routes. */
|
|
49
49
|
export const inject = ["webServer"];
|
|
50
50
|
|
|
51
|
-
export const VERSION = "0.6.
|
|
51
|
+
export const VERSION = "0.6.7";
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* 本插件在 npm 上的包名 —— 与 dsh 的插件 id(上面的 `name = "dpharness"`)**不是一回事**,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-dpharness",
|
|
3
3
|
"icon": "./icon.svg",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.7",
|
|
5
5
|
"description": "Curated dpharness.com plugin catalog inside the DeepSeek Harness Web GUI: a conversation-view tab, a sidebar entry and a dismissible site-wide floating panel, offering a searchable full catalog, a monthly by-category shortlist, a daily pick and an update check (this plugin plus every installed plugin) with a red-dot reminder, with one-click install via dshmarket or the dsh CLI. Includes a settings page (General row + Plugins tab) for the widget visibility, the daily pick, the update check and the opt-out telemetry relay covering the full install funnel.",
|
|
6
6
|
"author": "zhanghao3693 <zhanghao3693@qq.com>",
|
|
7
7
|
"repository": {
|