dsh-desktop-enhance 0.6.7 → 0.6.8
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 +2 -2
- package/lib/client.js +44 -29
- package/package.json +12 -14
package/README.md
CHANGED
|
@@ -112,13 +112,13 @@ Web 版(浏览器里打开的那种)键位是 **`Cmd+Shift+.`** —— `Cmd+
|
|
|
112
112
|
|
|
113
113
|
### 异常轮次分叉
|
|
114
114
|
|
|
115
|
-
已经结束、但原生 Fork
|
|
115
|
+
已经结束、但原生 Fork 仍不可用的轮次,也能在原位置分叉,包括恢复会话、前置检查拒绝,以及正常结束却没有最终文本的情况。不按结束原因筛选;原生按钮已可用时保持不变,不增加第二个入口。没有最终答复的轮次会补齐该入口。设置页「对话与显示 → 异常轮次分叉」可关闭并恢复原生行为。
|
|
116
116
|
|
|
117
117
|
只支持已保存结束记录的轮次,不处理运行中或损坏记录。**分叉复制对话,不回滚文件和外部操作**。
|
|
118
118
|
|
|
119
119
|
### 子智能体与团队会话模型
|
|
120
120
|
|
|
121
|
-
在输入框原模型位置显示子智能体和团队成员最近请求实际使用的模型与推理档位,只读、不可切换;悬停可查看完整 `provider/model`。普通会话仍使用原生模型选择器。首次自身请求前显示「模型尚未记录」,不把 Fork
|
|
121
|
+
在输入框原模型位置显示子智能体和团队成员最近请求实际使用的模型与推理档位,只读、不可切换;悬停可查看完整 `provider/model`。普通会话仍使用原生模型选择器。首次自身请求前显示「模型尚未记录」,不把 Fork 继承的父会话模型冒充为子会话模型。设置页「对话与显示 → 子会话模型」可单独关闭,恢复原生界面。
|
|
122
122
|
|
|
123
123
|
### 会话信息
|
|
124
124
|
|
package/lib/client.js
CHANGED
|
@@ -724,7 +724,9 @@ window.__ModuleLoader__.load({
|
|
|
724
724
|
"turnPrefix",
|
|
725
725
|
"compactionRow",
|
|
726
726
|
"stepDuration",
|
|
727
|
-
"folderStatus"
|
|
727
|
+
"folderStatus",
|
|
728
|
+
"sessionModel",
|
|
729
|
+
"abnormalFork"
|
|
728
730
|
]
|
|
729
731
|
},
|
|
730
732
|
{
|
|
@@ -735,8 +737,6 @@ window.__ModuleLoader__.load({
|
|
|
735
737
|
id: "session",
|
|
736
738
|
fields: [
|
|
737
739
|
"sessionInfo",
|
|
738
|
-
"sessionModel",
|
|
739
|
-
"abnormalFork",
|
|
740
740
|
"toolsManager",
|
|
741
741
|
"skillsManager"
|
|
742
742
|
]
|
|
@@ -6948,10 +6948,11 @@ window.__ModuleLoader__.load({
|
|
|
6948
6948
|
//#region src/client/mobile/styles.ts
|
|
6949
6949
|
const ADAPT_CSS = [
|
|
6950
6950
|
"html:has(body.dsh-remote-portrait){overflow:hidden;overscroll-behavior:none}",
|
|
6951
|
-
"body.dsh-remote-portrait{position:fixed;inset:0;width:100%;height:100
|
|
6951
|
+
"body.dsh-remote-portrait{position:fixed;inset:var(--desktop-enhance-viewport-top,0px) 0 auto;width:100%;height:var(--desktop-enhance-viewport-height,100%);overflow:hidden;overscroll-behavior:none}",
|
|
6952
6952
|
"body.dsh-remote-portrait [class*=\"_frame\"]:has([class*=\"_centerCol\"]){width:100%;height:var(--desktop-enhance-viewport-height,100dvh);max-height:100%;overflow:hidden}",
|
|
6953
6953
|
`body.dsh-remote-portrait{--dsh-content-font-size:14px !important;--dsh-content-font-size-secondary:12.5px !important;--dsh-content-font-delta:0px !important;--dsh-content-font-delta-secondary:0px !important;--dsh-code-font-size:12px !important;--dsh-code-font-delta:0px !important;--dsh-terminal-font-size:12px !important;--dsh-composer-side-clearance:10px !important;--dsw-font-markdown-base:400 14px/21px var(--dsw-font-family) !important;--dsw-font-markdown-base-font-size:14px !important;--dsw-font-markdown-base-line-height:21px !important;--dsw-font-markdown-base-strong:600 14px/21px var(--dsw-font-family) !important;--dsw-font-markdown-h1:700 16.5px/23px var(--dsw-font-family) !important;--dsw-font-markdown-h2:700 15.5px/22px var(--dsw-font-family) !important;--dsw-font-markdown-h3:600 14.5px/21px var(--dsw-font-family) !important;--dsw-font-markdown-h4:600 14px/20px var(--dsw-font-family) !important}`,
|
|
6954
6954
|
"[class$=\"_railFish\"] button,[class$=\"_panelIcon\"],[class$=\"_newSession\"]{min-width:44px;min-height:44px}",
|
|
6955
|
+
"body.dsh-remote-portrait [data-conversation-scroll]{overflow-x:hidden}",
|
|
6955
6956
|
`body.dsh-remote-portrait [class$="_scroll"]{padding:8px 12px !important}`,
|
|
6956
6957
|
"[class$=\"_input\"],textarea,input{font-size:16px}",
|
|
6957
6958
|
"[class$=\"_composer\"]{padding-bottom:calc(4px + env(safe-area-inset-bottom))}",
|
|
@@ -6989,6 +6990,7 @@ window.__ModuleLoader__.load({
|
|
|
6989
6990
|
`body.dsh-remote-portrait header[class*="_header"] [class$="_headerActions"]{margin-left:auto;gap:4px}`,
|
|
6990
6991
|
`body.dsh-remote-portrait header[class*="_header"] [class$="_headerActions"] button{height:24px;min-height:24px;font-size:11px;padding:0 6px}`,
|
|
6991
6992
|
`#dshRemoteWhale{position:fixed;top:calc(4px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left));z-index:2147482999;width:34px;height:34px;min-width:34px;padding:0;border-radius:10px;background:var(--dsw-alias-bg-module-platform);border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 1px 6px rgba(0,0,0,.25);touch-action:none}`,
|
|
6993
|
+
`#dshRemoteWhale{translate:0 var(--desktop-enhance-viewport-top,0px)}`,
|
|
6992
6994
|
`#dshRemoteWhale svg{width:20px;height:15px;display:block}`,
|
|
6993
6995
|
`#dshRemoteWhale:active{opacity:.72}`,
|
|
6994
6996
|
`#dshRemoteWhale [data-mobile-connection-label]{position:absolute;left:calc(100% + 7px);top:50%;transform:translateY(-50%);max-width:calc(50vw - 36px);padding:5px 8px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font-size:12px;line-height:18px;white-space:nowrap;box-shadow:0 2px 8px var(--dsw-alias-interactive-bg-hover);pointer-events:none}`,
|
|
@@ -7023,8 +7025,9 @@ window.__ModuleLoader__.load({
|
|
|
7023
7025
|
"[class$=\"_composerSeat\"] [class$=\"_primary\"]:has(~ [class$=\"_primary\"]){right:48px}",
|
|
7024
7026
|
"[class$=\"_composerSeat\"] [class$=\"_dock\"]{padding-top:2px;gap:8px}",
|
|
7025
7027
|
"[class$=\"_composerSeat\"]{transform:none !important}",
|
|
7026
|
-
`body.dsh-remote-portrait[data-mobile-bottom-sheet] [class$="_composerSeat"] [class$="_menu"]
|
|
7027
|
-
|
|
7028
|
+
`body.dsh-remote-portrait[data-mobile-bottom-sheet] [class$="_composerSeat"] [class$="_menu"]:not([data-trigger-menu]){position:fixed !important;left:12px !important;right:12px !important;top:auto !important;bottom:calc(56px + env(safe-area-inset-bottom)) !important;width:auto !important;max-width:none !important;max-height:65dvh !important;overflow-y:auto !important;z-index:2147482000 !important}`,
|
|
7029
|
+
"body.dsh-remote-portrait [data-composer-seat] [data-trigger-menu]{max-height:min(400px,max(0px,calc(var(--desktop-enhance-viewport-height,100dvh) - var(--dsh-composer-height,0px) - 84px))) !important}",
|
|
7030
|
+
`body.dsh-remote-portrait[data-mobile-bottom-sheet] [class$="_composerSeat"] [class$="_menu"] [class$="_cell"]{height:44px;min-height:44px;font-size:13px}`,
|
|
7028
7031
|
`body.dsh-remote-portrait[data-mobile-bottom-sheet] .dsh-codex-quota-popover{position:fixed !important;left:12px !important;right:12px !important;top:auto !important;bottom:calc(56px + env(safe-area-inset-bottom)) !important;width:auto !important;max-width:none !important;z-index:2147482000 !important}`,
|
|
7029
7032
|
"[class$=\"_composerSeat\"] [data-slot=\"conversation.composer.dock\"] [class$=\"_root\"]{font-size:10px;white-space:normal;word-break:break-word;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:left;line-height:13px;letter-spacing:-0.2px;padding-left:0;padding-right:0}",
|
|
7030
7033
|
"[class*=\"_bubble\"][role=\"tooltip\"]{display:none}",
|
|
@@ -7149,6 +7152,7 @@ window.__ModuleLoader__.load({
|
|
|
7149
7152
|
if (viewport && viewport.scale !== 1) return;
|
|
7150
7153
|
viewportHeight = viewport?.height ?? globalThis.window.innerHeight;
|
|
7151
7154
|
globalThis.document.body.style.setProperty("--desktop-enhance-viewport-height", `${viewportHeight}px`);
|
|
7155
|
+
globalThis.document.body.style.setProperty("--desktop-enhance-viewport-top", `${viewport?.offsetTop ?? 0}px`);
|
|
7152
7156
|
if (drag === null) applyWhalePos();
|
|
7153
7157
|
}
|
|
7154
7158
|
let whaleEvents = null;
|
|
@@ -7209,6 +7213,7 @@ window.__ModuleLoader__.load({
|
|
|
7209
7213
|
restoreRowDrag();
|
|
7210
7214
|
globalThis.document.body.classList.remove(ACTIVE_CLASS);
|
|
7211
7215
|
globalThis.document.body.style.removeProperty("--desktop-enhance-viewport-height");
|
|
7216
|
+
globalThis.document.body.style.removeProperty("--desktop-enhance-viewport-top");
|
|
7212
7217
|
globalThis.document.body.classList.remove(RAIL_HIDDEN_CLASS);
|
|
7213
7218
|
globalThis.document.body.classList.remove(WHALE_MOVED_CLASS);
|
|
7214
7219
|
globalThis.document.body.removeAttribute("data-mobile-bottom-sheet");
|
|
@@ -7484,7 +7489,10 @@ window.__ModuleLoader__.load({
|
|
|
7484
7489
|
}
|
|
7485
7490
|
listen(globalThis.window, "orientationchange", evaluate);
|
|
7486
7491
|
listen(globalThis.window, "resize", evaluate);
|
|
7487
|
-
if (globalThis.window.visualViewport)
|
|
7492
|
+
if (globalThis.window.visualViewport) {
|
|
7493
|
+
listen(globalThis.window.visualViewport, "resize", syncViewport);
|
|
7494
|
+
listen(globalThis.window.visualViewport, "scroll", syncViewport);
|
|
7495
|
+
}
|
|
7488
7496
|
listen(globalThis.window, "pageshow", evaluate);
|
|
7489
7497
|
listen(globalThis.document, "visibilitychange", () => {
|
|
7490
7498
|
setWhaleTimer(globalThis.document.visibilityState !== "hidden");
|
|
@@ -7860,27 +7868,45 @@ window.__ModuleLoader__.load({
|
|
|
7860
7868
|
const OWNED = "data-desktop-enhance-abnormal-fork-button";
|
|
7861
7869
|
function takeNativeFork(root, label, run, isDisabled) {
|
|
7862
7870
|
const originals = new Map();
|
|
7871
|
+
const restoreTooltip = (original) => {
|
|
7872
|
+
const saved = original.tooltip;
|
|
7873
|
+
if (saved && saved.node.textContent === label) saved.node.textContent = saved.text;
|
|
7874
|
+
delete original.tooltip;
|
|
7875
|
+
};
|
|
7863
7876
|
const refresh = () => {
|
|
7864
|
-
for (const
|
|
7877
|
+
for (const button of originals.keys()) {
|
|
7865
7878
|
if (button.getAttribute("data-unavailable") === "true") continue;
|
|
7866
7879
|
button.removeAttribute(OWNED);
|
|
7867
|
-
if (original.title === null) button.removeAttribute("title");
|
|
7868
|
-
else button.setAttribute("title", original.title);
|
|
7869
7880
|
originals.delete(button);
|
|
7870
7881
|
}
|
|
7871
7882
|
const row = root.querySelector(":scope > [data-clock=\"end\"]");
|
|
7872
7883
|
for (const child of Array.from(row?.children ?? [])) {
|
|
7873
7884
|
if (!(child instanceof globalThis.HTMLButtonElement) || child.getAttribute("aria-label") !== label || child.getAttribute("data-unavailable") !== "true") continue;
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7885
|
+
let original = originals.get(child);
|
|
7886
|
+
if (!original) {
|
|
7887
|
+
original = {
|
|
7888
|
+
disabled: child.getAttribute("aria-disabled"),
|
|
7889
|
+
described: child.getAttribute("aria-describedby")
|
|
7890
|
+
};
|
|
7891
|
+
originals.set(child, original);
|
|
7892
|
+
}
|
|
7879
7893
|
child.setAttribute(OWNED, "");
|
|
7880
7894
|
const desired = isDisabled() ? "true" : "false";
|
|
7881
7895
|
if (child.getAttribute("aria-disabled") !== desired) child.setAttribute("aria-disabled", desired);
|
|
7882
7896
|
child.removeAttribute("aria-describedby");
|
|
7883
|
-
child.
|
|
7897
|
+
const bubble = child.nextElementSibling;
|
|
7898
|
+
const content = bubble?.getAttribute("role") === "tooltip" ? bubble.firstElementChild : null;
|
|
7899
|
+
if (original.tooltip?.node !== content) {
|
|
7900
|
+
restoreTooltip(original);
|
|
7901
|
+
if (content) original.tooltip = {
|
|
7902
|
+
node: content,
|
|
7903
|
+
text: content.textContent
|
|
7904
|
+
};
|
|
7905
|
+
}
|
|
7906
|
+
if (content && content.textContent !== label) {
|
|
7907
|
+
if (original.tooltip) original.tooltip.text = content.textContent;
|
|
7908
|
+
content.textContent = label;
|
|
7909
|
+
}
|
|
7884
7910
|
}
|
|
7885
7911
|
};
|
|
7886
7912
|
const onClick = (event) => {
|
|
@@ -7890,21 +7916,12 @@ window.__ModuleLoader__.load({
|
|
|
7890
7916
|
event.stopPropagation();
|
|
7891
7917
|
if (!isDisabled()) run();
|
|
7892
7918
|
};
|
|
7893
|
-
const suppressUnavailableTooltip = (event) => {
|
|
7894
|
-
const target = event.target instanceof globalThis.Element ? event.target.closest("button") : null;
|
|
7895
|
-
if (target && originals.has(target) && target.getAttribute("data-unavailable") === "true") event.stopPropagation();
|
|
7896
|
-
};
|
|
7897
|
-
const tooltipEvents = [
|
|
7898
|
-
"mouseover",
|
|
7899
|
-
"pointerover",
|
|
7900
|
-
"focusin"
|
|
7901
|
-
];
|
|
7902
|
-
for (const name of tooltipEvents) root.addEventListener(name, suppressUnavailableTooltip, true);
|
|
7903
7919
|
root.addEventListener("click", onClick, true);
|
|
7904
7920
|
const observer = new globalThis.MutationObserver(refresh);
|
|
7905
7921
|
observer.observe(root, {
|
|
7906
7922
|
childList: true,
|
|
7907
7923
|
subtree: true,
|
|
7924
|
+
characterData: true,
|
|
7908
7925
|
attributes: true,
|
|
7909
7926
|
attributeFilter: [
|
|
7910
7927
|
"aria-disabled",
|
|
@@ -7916,12 +7933,10 @@ window.__ModuleLoader__.load({
|
|
|
7916
7933
|
return () => {
|
|
7917
7934
|
observer.disconnect();
|
|
7918
7935
|
root.removeEventListener("click", onClick, true);
|
|
7919
|
-
for (const name of tooltipEvents) root.removeEventListener(name, suppressUnavailableTooltip, true);
|
|
7920
7936
|
for (const [button, original] of originals) {
|
|
7921
7937
|
button.removeAttribute(OWNED);
|
|
7922
|
-
if (original.title === null) button.removeAttribute("title");
|
|
7923
|
-
else button.setAttribute("title", original.title);
|
|
7924
7938
|
if (button.getAttribute("data-unavailable") !== "true") continue;
|
|
7939
|
+
restoreTooltip(original);
|
|
7925
7940
|
const attributes = [["aria-disabled", original.disabled], ["aria-describedby", original.described]];
|
|
7926
7941
|
for (const [key, value] of attributes) if (value === null) button.removeAttribute(key);
|
|
7927
7942
|
else button.setAttribute(key, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-desktop-enhance",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "DSH Desktop 界面增强:页内查找(Cmd+F)、轮次编号、上下文压缩行常显、建议、每步耗时、折叠文件夹状态计数、会话信息(含上下文注入 C1 视图)、工具管理、Skill 管理、独立远程接入与手机体验。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
"icon.svg",
|
|
33
33
|
"cordis.patch.yml"
|
|
34
34
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsdown",
|
|
37
|
-
"dev": "tsdown --watch",
|
|
38
|
-
"typecheck": "tsc --noEmit",
|
|
39
|
-
"test": "node --test tests/*.test.mjs",
|
|
40
|
-
"test:isolation": "./tools/test-isolation.sh",
|
|
41
|
-
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
42
|
-
"prepack": "pnpm build",
|
|
43
|
-
"prepublishOnly": "pnpm verify",
|
|
44
|
-
"release:patch": "npm version patch && pnpm publish",
|
|
45
|
-
"release:minor": "npm version minor && pnpm publish"
|
|
46
|
-
},
|
|
47
35
|
"publishConfig": {
|
|
48
36
|
"access": "public"
|
|
49
37
|
},
|
|
@@ -62,5 +50,15 @@
|
|
|
62
50
|
"@types/react": "^18.3.31",
|
|
63
51
|
"tsdown": "0.23.0",
|
|
64
52
|
"typescript": "5.9.3"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsdown",
|
|
56
|
+
"dev": "tsdown --watch",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"test": "node --test tests/*.test.mjs",
|
|
59
|
+
"test:isolation": "./tools/test-isolation.sh",
|
|
60
|
+
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
61
|
+
"release:patch": "npm version patch && pnpm publish",
|
|
62
|
+
"release:minor": "npm version minor && pnpm publish"
|
|
65
63
|
}
|
|
66
|
-
}
|
|
64
|
+
}
|