dsh-multipane 1.0.55 → 1.0.57
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/LICENSE +21 -21
- package/README.en.md +4 -0
- package/README.md +8 -0
- package/cordis.patch.yml +11 -11
- package/lib/client.js +283 -191
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 weiaisuyan
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 weiaisuyan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
CHANGED
|
@@ -161,6 +161,10 @@ node scripts/check-names.cjs # package name / version / release-age allowanc
|
|
|
161
161
|
|
|
162
162
|
## Changelog
|
|
163
163
|
|
|
164
|
+
### 1.0.56 (2026-11-22)
|
|
165
|
+
|
|
166
|
+
- **The host settings section now has Check for updates too.** Previously the version/con check/one-click update row only existed on the plugin's own settings page (sidebar entry); opening the plugin from DSH Settings showed switches and appearance only. The row is now a shared component rendered by both the plugin settings page and the host settings section, so the two stay identical and a future change only has to be made once.
|
|
167
|
+
|
|
164
168
|
### 1.0.55 (2026-11-22)
|
|
165
169
|
|
|
166
170
|
- **Fix duplicate New Session rows when the sidebar button is clicked repeatedly.** The sidebar New Session entry (and Ctrl+N) goes through the host's `uiWorkspace.startSession`. The 1.0.54 guard tried to install itself once at plugin load, but that host service often becomes available later, so the guard was never installed: each click really created or reused a blank session. The plugin did not open it as a tab, but the host still made it the current session, so another "New session" row appeared in the sidebar. The guard now retries until the service is ready (every 700ms, then stops), and when a new blank is merged into the pane's existing blank tab the host's main session is switched back to that existing blank as a second line of defence.
|
package/README.md
CHANGED
|
@@ -160,6 +160,14 @@ node scripts/check-names.cjs # 包名 / 版本 / 冷却豁免三处是否一
|
|
|
160
160
|
|
|
161
161
|
## 更新记录
|
|
162
162
|
|
|
163
|
+
### 1.0.57(2026-12-03)
|
|
164
|
+
|
|
165
|
+
- **修「切到全局面板(插件页 / 插件设置页)后右栏仍占位、按钮点不动、关不掉」**(Issue #1,@Free-LZJ):删掉每 900ms 的 `startRightbarKeepOpen()` 补开定时器(它在全局面板下也会命中「store 说展开、列宽却是 0」,于是不停把已让位的右栏顶回来);新增 `syncRightbarVisibility()`,切到全局面板时对右栏列加 `visibility:hidden + pointer-events:none + opacity:0 + overflow:hidden`,把宿主原生壳与 `dsh-better-sidebar` 这类 keepMounted 面板(absolute 定位、不跟随轨道收缩)一起压住,切回会话视图全部还原。
|
|
166
|
+
|
|
167
|
+
### 1.0.56(2026-11-22)
|
|
168
|
+
|
|
169
|
+
- **宿主设置里的「多栏视图」分区补上「检查更新」**:以前这一块只在插件自己的完整设置页(侧栏入口)里有,从 DSH 设置进去只能改开关和外观,看不到版本检查。现在把「当前版本 / 检查更新 / 一键更新 / 插件市场」整块抽成共用组件,插件设置页和宿主设置分区渲染同一份,两处内容保持一致;以后改一处两处都生效。
|
|
170
|
+
|
|
163
171
|
### 1.0.55(2026-11-22)
|
|
164
172
|
|
|
165
173
|
- **修「连点新建会话,侧栏会多出新会话行」**:侧栏「新建会话」/ Ctrl+N 走的是宿主的 `uiWorkspace.startSession`。上一版的拦截在插件加载时只尝试安装一次,而宿主的这个服务经常晚于插件就绪,拦截没装上,于是每点一次宿主就真的新建/复用一个空白会话;插件虽然没给它开标签,宿主仍把它当成当前会话,侧栏就多出一行「新会话」。现在改为服务就绪后自动重试安装(每 700ms 一次,装好即停),并在「合并到本栏已有空白标签」时把宿主的主会话切回原有空白会话,双保险。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# dsh-split-view bundle patch.
|
|
2
|
-
#
|
|
3
|
-
# Installing this package through the official CLI
|
|
4
|
-
# dsh plugin --profile desktop add file:<path-to-this-directory>
|
|
5
|
-
# reconciles `dsh.profile.bundles` against installed packages and appends
|
|
6
|
-
# `dsh-split-view` to the bundle stack; the profile boot then merges this patch
|
|
7
|
-
# (a single `insert` of the plugin row).
|
|
8
|
-
- insert:
|
|
9
|
-
- id: split-view
|
|
10
|
-
name: 'dsh-multipane'
|
|
11
|
-
label: '多栏视图'
|
|
1
|
+
# dsh-split-view bundle patch.
|
|
2
|
+
#
|
|
3
|
+
# Installing this package through the official CLI
|
|
4
|
+
# dsh plugin --profile desktop add file:<path-to-this-directory>
|
|
5
|
+
# reconciles `dsh.profile.bundles` against installed packages and appends
|
|
6
|
+
# `dsh-split-view` to the bundle stack; the profile boot then merges this patch
|
|
7
|
+
# (a single `insert` of the plugin row).
|
|
8
|
+
- insert:
|
|
9
|
+
- id: split-view
|
|
10
|
+
name: 'dsh-multipane'
|
|
11
|
+
label: '多栏视图'
|
package/lib/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
2
|
id: "dsh-multipane",
|
|
3
3
|
factory: (require) => {
|
|
4
4
|
var module = { exports: {} };
|
|
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
*/
|
|
18
18
|
const PLUGIN_LABEL = "多栏视图";
|
|
19
19
|
/* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
|
|
20
|
-
const PLUGIN_VERSION = "1.0.
|
|
20
|
+
const PLUGIN_VERSION = "1.0.57";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
|
|
23
23
|
|
|
@@ -6257,36 +6257,69 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
6257
6257
|
* 这里只处理一种情况:**store 说已展开,但列宽是 0** → 补一次 openRightbar。
|
|
6258
6258
|
* 绝不处理反方向(store 说收起时不去关),所以不会和宿主的收起逻辑打架,
|
|
6259
6259
|
* 也不会把正在进行的过渡动画拉回去。
|
|
6260
|
+
*
|
|
6261
|
+
* ⚠️ 只在**会话视图**里补开(Issue #1:切到全局面板时右栏被顶回来、关不掉)。
|
|
6262
|
+
* 判据与宿主 ui-sidebar-right 自己的 `visible` 一致 —— `layout.panelInfo` 的
|
|
6263
|
+
* `activePanelId === null` 才算会话视图;这个字段在 0.2.2-rc.1 起就有,
|
|
6264
|
+
* 本插件 `mirrorSettingsFromPanel()` 也一直读它,不是新版宿主专有。
|
|
6265
|
+
* 拿不到 panelInfo(服务未起 / 更老的宿主)时按会话视图处理,保持原行为。
|
|
6260
6266
|
*/
|
|
6261
|
-
function
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6267
|
+
function onSessionView() {
|
|
6268
|
+
try {
|
|
6269
|
+
const info = SERVICES.layout?.panelInfo?.getSnapshot?.();
|
|
6270
|
+
if (info === void 0 || info === null) return true;
|
|
6271
|
+
return (info.activePanelId ?? null) === null;
|
|
6272
|
+
} catch {
|
|
6273
|
+
return true;
|
|
6274
|
+
}
|
|
6275
|
+
}
|
|
6276
|
+
|
|
6277
|
+
/**
|
|
6278
|
+
* 右栏列(真正占宽度的那一格)。
|
|
6279
|
+
*
|
|
6280
|
+
* ⚠️ 不要只认哈希类名(`.mP3x-q_rightbarCol` 之流):它是 CSS Modules 的
|
|
6281
|
+
* **构建产物**,由**分发通道**的构建决定,与版本号无关 —— 实测:
|
|
6282
|
+
* · npm 包(web / CLI 宿主,0.2.2-rc.5 与 0.2.3-alpha.2 都一样)→ `pI_x6G_`
|
|
6283
|
+
* · 桌面版 app.asar(0.2.2-rc.5 / 0.2.3-alpha.2)→ `mP3x-q_`
|
|
6284
|
+
* 拿它当唯一判据,换一条通道跑就可能对不上,本文件里兜底与开关的 measure
|
|
6285
|
+
* 会静默退化。
|
|
6286
|
+
*
|
|
6287
|
+
* 稳定判据是宿主自己挂的 `data-rightbar-col` 属性 —— AppFrame 的
|
|
6288
|
+
* RightbarColumn 无条件输出,0.2.2-rc.1 / 0.2.2-rc.5 / 0.2.3-alpha.2
|
|
6289
|
+
* 实测都有。哈希类名只作为极旧宿主的兜底。
|
|
6290
|
+
*/
|
|
6291
|
+
function rightbarColumn() {
|
|
6292
|
+
try {
|
|
6293
|
+
const stable = document.querySelector("[data-rightbar-col]");
|
|
6294
|
+
if (stable !== null) return stable;
|
|
6295
|
+
return document.querySelector(".mP3x-q_rightbarCol");
|
|
6296
|
+
} catch {
|
|
6297
|
+
return null;
|
|
6298
|
+
}
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
/**
|
|
6302
|
+
* 右栏现在是不是**真的看得见**:以列宽为准,列不在时才问 store。
|
|
6303
|
+
*
|
|
6304
|
+
* 为什么不能只信 `isExpanded()`:它是 store 的镜像,会滞后;0.2.2 的
|
|
6305
|
+
* `isExpanded()` 还依赖 mountedSurface(本会话没挂上挂载面时恒为 false)。
|
|
6306
|
+
* 用户点“收起”时判据必须是「现在看不看得见」,否则会把“收起”算成“打开”。
|
|
6307
|
+
*/
|
|
6308
|
+
function rightbarVisible() {
|
|
6309
|
+
const col = rightbarColumn();
|
|
6310
|
+
if (col !== null) return col.getBoundingClientRect().width > 1;
|
|
6311
|
+
try {
|
|
6312
|
+
const right = SERVICES.ctx?.get?.("sidebarRight");
|
|
6313
|
+
return right !== null && right !== void 0 && typeof right.isExpanded === "function" && right.isExpanded() === true;
|
|
6314
|
+
} catch {
|
|
6315
|
+
return false;
|
|
6316
|
+
}
|
|
6278
6317
|
}
|
|
6279
6318
|
|
|
6280
6319
|
function RightbarToggle() {
|
|
6281
6320
|
const [open, setOpen] = react.useState(false);
|
|
6282
6321
|
const measure = react.useCallback(() => {
|
|
6283
|
-
|
|
6284
|
-
try {
|
|
6285
|
-
const col = document.querySelector(".mP3x-q_rightbarCol");
|
|
6286
|
-
next = col !== null && col.getBoundingClientRect().width > 1;
|
|
6287
|
-
} catch {
|
|
6288
|
-
next = false;
|
|
6289
|
-
}
|
|
6322
|
+
const next = rightbarVisible();
|
|
6290
6323
|
setOpen((prev) => (prev === next ? prev : next));
|
|
6291
6324
|
return next;
|
|
6292
6325
|
}, []);
|
|
@@ -6357,6 +6390,47 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
6357
6390
|
);
|
|
6358
6391
|
}
|
|
6359
6392
|
|
|
6393
|
+
|
|
6394
|
+
/**
|
|
6395
|
+
* 切到全局面板(插件页 / 设置页等)时隐藏右栏,切回会话视图恢复(Issue #1 修复,1.1.x 移植)。
|
|
6396
|
+
*
|
|
6397
|
+
* 背景(台式机真机实测 2026-12-03):宿主右栏轨道在 syncPresentation({shown:false}) 后
|
|
6398
|
+
* 把列宽收成 0,但已安装的 dsh-better-sidebar 的「开始」等 keepMounted 面板是 absolute
|
|
6399
|
+
* 定位、固定宽度,不跟随轨道收缩 —— 于是插件页上残留「占位还在、内容没了、顶部按钮
|
|
6400
|
+
* 还在但不可点」的壳。宿主原生 tab 会自己卸载,唯独 keepMounted 面板不清场。
|
|
6401
|
+
*
|
|
6402
|
+
* 这里只动视觉层:visibility + pointer-events + opacity + overflow,不卸载 DOM、不动
|
|
6403
|
+
* better-sidebar 的 keepMounted 状态。不要用 display:none —— 那会改变几何,让宿主的
|
|
6404
|
+
* isExpanded() 误判为收起、把 store.expanded 写成 false,破坏「切回会话右栏还开着」。
|
|
6405
|
+
*/
|
|
6406
|
+
function syncRightbarVisibility() {
|
|
6407
|
+
try {
|
|
6408
|
+
const layout = SERVICES.layout ?? service("layout");
|
|
6409
|
+
SERVICES.layout = layout;
|
|
6410
|
+
if (layout === void 0 || layout.panelInfo === void 0) return;
|
|
6411
|
+
const active = layout.panelInfo.getSnapshot()?.activePanelId ?? null;
|
|
6412
|
+
const col = rightbarColumn();
|
|
6413
|
+
if (col === null) return;
|
|
6414
|
+
if (active === null) {
|
|
6415
|
+
/* 会话视图:恢复 */
|
|
6416
|
+
try { col.style.removeProperty("visibility"); } catch { /* 忽略 */ }
|
|
6417
|
+
try { col.style.removeProperty("pointer-events"); } catch { /* 忽略 */ }
|
|
6418
|
+
col.removeAttribute("data-dsv-rightbar-hidden");
|
|
6419
|
+
try { col.style.removeProperty("overflow"); } catch { /* 忽略 */ }
|
|
6420
|
+
try { col.style.removeProperty("opacity"); } catch { /* 忽略 */ }
|
|
6421
|
+
} else {
|
|
6422
|
+
/* 全局面板:隐藏 */
|
|
6423
|
+
try { col.style.setProperty("overflow", "hidden", "important"); } catch { /* 忽略 */ }
|
|
6424
|
+
try { col.style.setProperty("opacity", "0", "important"); } catch { /* 忽略 */ }
|
|
6425
|
+
try { col.style.setProperty("visibility", "hidden", "important"); } catch { /* 忽略 */ }
|
|
6426
|
+
try { col.style.setProperty("pointer-events", "none", "important"); } catch { /* 忽略 */ }
|
|
6427
|
+
col.setAttribute("data-dsv-rightbar-hidden", "1");
|
|
6428
|
+
}
|
|
6429
|
+
} catch {
|
|
6430
|
+
/* 忽略 */
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
|
|
6360
6434
|
/**
|
|
6361
6435
|
* 「更多」:把被 .dsv-hostbar-right 裁掉的会话头按钮收进一个下拉菜单。
|
|
6362
6436
|
*
|
|
@@ -7821,17 +7895,14 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
7821
7895
|
}
|
|
7822
7896
|
|
|
7823
7897
|
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
const toggle = () => {
|
|
7833
|
-
prefs.update({ enabled: !p.enabled });
|
|
7834
|
-
};
|
|
7898
|
+
/**
|
|
7899
|
+
* 「当前版本 / 检查更新 / 一键更新」卡片。
|
|
7900
|
+
*
|
|
7901
|
+
* 插件自己的完整设置页(SettingsPage)和宿主设置对话框里的分区
|
|
7902
|
+
* (SettingsSection)都渲染这一个组件 —— 两处内容必须保持一致,
|
|
7903
|
+
* 检查/下载/进度/弹窗只维护这一份。
|
|
7904
|
+
*/
|
|
7905
|
+
function UpdatePanel() {
|
|
7835
7906
|
/* 检查更新 + 一键更新。
|
|
7836
7907
|
首选插件市场的公开更新 API(GET/POST /dsh-market/api/v1/updates):
|
|
7837
7908
|
它自己负责装包、校验版本、保留回滚点,并且明确返回 refreshRequired / restartRequired。
|
|
@@ -8254,6 +8325,174 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
8254
8325
|
}));
|
|
8255
8326
|
}
|
|
8256
8327
|
};
|
|
8328
|
+
return h(
|
|
8329
|
+
react.Fragment,
|
|
8330
|
+
null,
|
|
8331
|
+
/* 版本行:当前版本 + 检查更新 + 有新版本时的一键更新(走插件市场 API) */
|
|
8332
|
+
h(
|
|
8333
|
+
"div",
|
|
8334
|
+
{ className: "dsv-update-row" },
|
|
8335
|
+
h(
|
|
8336
|
+
"span",
|
|
8337
|
+
{ className: "dsv-update-text", "data-phase": update.phase },
|
|
8338
|
+
update.text === "" ? t("当前版本 {0}", [PLUGIN_VERSION]) : update.text
|
|
8339
|
+
),
|
|
8340
|
+
h(
|
|
8341
|
+
"button",
|
|
8342
|
+
{
|
|
8343
|
+
type: "button",
|
|
8344
|
+
className: "dsv-mini-btn",
|
|
8345
|
+
disabled: update.phase === "checking" || update.phase === "updating",
|
|
8346
|
+
onClick: checkUpdate
|
|
8347
|
+
},
|
|
8348
|
+
update.phase === "checking" ? t("检查中…") : t("检查更新")
|
|
8349
|
+
),
|
|
8350
|
+
h(
|
|
8351
|
+
"button",
|
|
8352
|
+
{ type: "button", className: "dsv-mini-btn", onClick: openMarket },
|
|
8353
|
+
t("插件市场")
|
|
8354
|
+
)
|
|
8355
|
+
),
|
|
8356
|
+
/* 更新弹窗:发现新版本时弹出来,版本对比 + 进度 + 一键更新/刷新,全程不用离开设置页 */
|
|
8357
|
+
update.modal === true
|
|
8358
|
+
? h(
|
|
8359
|
+
"div",
|
|
8360
|
+
{ className: "dsv-modal-mask", onClick: closeModal },
|
|
8361
|
+
h(
|
|
8362
|
+
"div",
|
|
8363
|
+
{
|
|
8364
|
+
className: "dsv-modal",
|
|
8365
|
+
onClick: (event) => {
|
|
8366
|
+
event.stopPropagation();
|
|
8367
|
+
}
|
|
8368
|
+
},
|
|
8369
|
+
h(
|
|
8370
|
+
"div",
|
|
8371
|
+
{ className: "dsv-modal-title" },
|
|
8372
|
+
update.phase === "done" ? t("更新完成") : update.phase === "error" ? t("更新没有完成") : t("发现新版本 {0}", [update.latest])
|
|
8373
|
+
),
|
|
8374
|
+
h(
|
|
8375
|
+
"div",
|
|
8376
|
+
{ className: "dsv-modal-body" },
|
|
8377
|
+
h(
|
|
8378
|
+
"div",
|
|
8379
|
+
{ className: "dsv-modal-row" },
|
|
8380
|
+
h("span", null, t("当前版本")),
|
|
8381
|
+
h("b", null, update.installed)
|
|
8382
|
+
),
|
|
8383
|
+
update.phase === "done" || update.phase === "error"
|
|
8384
|
+
? null
|
|
8385
|
+
: h(
|
|
8386
|
+
"div",
|
|
8387
|
+
{ className: "dsv-modal-row" },
|
|
8388
|
+
h("span", null, t("新版本")),
|
|
8389
|
+
h("b", null, update.latest)
|
|
8390
|
+
),
|
|
8391
|
+
update.checkedAt !== "" ? h("div", { className: "dsv-modal-row" }, h("span", null, t("检查时间")), h("b", null, update.checkedAt)) : null,
|
|
8392
|
+
update.progress === null || update.progress === void 0
|
|
8393
|
+
? null
|
|
8394
|
+
: h(
|
|
8395
|
+
"div",
|
|
8396
|
+
{ className: "dsv-modal-bar" },
|
|
8397
|
+
h("i", { style: { width: `${Math.max(4, Math.min(100, update.progress))}%` } })
|
|
8398
|
+
),
|
|
8399
|
+
update.forceHint !== ""
|
|
8400
|
+
? h("div", { className: "dsv-modal-note" }, update.forceHint)
|
|
8401
|
+
: null,
|
|
8402
|
+
update.phase === "done" ? h("div", null, update.text) : null,
|
|
8403
|
+
update.phase === "error" ? h("div", { className: "dsv-modal-err" }, update.text) : null
|
|
8404
|
+
),
|
|
8405
|
+
h(
|
|
8406
|
+
"div",
|
|
8407
|
+
{ className: "dsv-modal-actions" },
|
|
8408
|
+
update.phase === "done"
|
|
8409
|
+
? h(
|
|
8410
|
+
"button",
|
|
8411
|
+
{
|
|
8412
|
+
type: "button",
|
|
8413
|
+
"data-primary": "1",
|
|
8414
|
+
onClick: () => {
|
|
8415
|
+
try {
|
|
8416
|
+
window.location.reload();
|
|
8417
|
+
} catch {
|
|
8418
|
+
/* 忽略 */
|
|
8419
|
+
}
|
|
8420
|
+
}
|
|
8421
|
+
},
|
|
8422
|
+
t("刷新页面")
|
|
8423
|
+
)
|
|
8424
|
+
: [
|
|
8425
|
+
h(
|
|
8426
|
+
"button",
|
|
8427
|
+
{ key: "later", type: "button", onClick: closeModal },
|
|
8428
|
+
t("稍后")
|
|
8429
|
+
),
|
|
8430
|
+
h(
|
|
8431
|
+
"button",
|
|
8432
|
+
{
|
|
8433
|
+
key: "go",
|
|
8434
|
+
type: "button",
|
|
8435
|
+
"data-primary": "1",
|
|
8436
|
+
onClick: update.canUpdate === true ? () => runUpdate() : () => checkUpdate()
|
|
8437
|
+
},
|
|
8438
|
+
update.canUpdate === true ? t("立即更新") : t("重新检查")
|
|
8439
|
+
)
|
|
8440
|
+
]
|
|
8441
|
+
)
|
|
8442
|
+
)
|
|
8443
|
+
)
|
|
8444
|
+
: null,
|
|
8445
|
+
marketOpen === true
|
|
8446
|
+
? h(
|
|
8447
|
+
"div",
|
|
8448
|
+
{
|
|
8449
|
+
className: "dsv-market-shell",
|
|
8450
|
+
onClick: () => {
|
|
8451
|
+
setMarketOpen(false);
|
|
8452
|
+
}
|
|
8453
|
+
},
|
|
8454
|
+
h(
|
|
8455
|
+
"div",
|
|
8456
|
+
{
|
|
8457
|
+
className: "dsv-market-box",
|
|
8458
|
+
onClick: (event) => {
|
|
8459
|
+
event.stopPropagation();
|
|
8460
|
+
}
|
|
8461
|
+
},
|
|
8462
|
+
h(
|
|
8463
|
+
"div",
|
|
8464
|
+
{ className: "dsv-market-head" },
|
|
8465
|
+
h("span", { className: "dsv-market-title" }, t("插件市场 · 已安装")),
|
|
8466
|
+
h(
|
|
8467
|
+
"button",
|
|
8468
|
+
{
|
|
8469
|
+
type: "button",
|
|
8470
|
+
className: "dsv-mini-btn",
|
|
8471
|
+
onClick: () => {
|
|
8472
|
+
setMarketOpen(false);
|
|
8473
|
+
}
|
|
8474
|
+
},
|
|
8475
|
+
t("关闭")
|
|
8476
|
+
)
|
|
8477
|
+
),
|
|
8478
|
+
h("div", { className: "dsv-market-body" }, renderMarketPanel())
|
|
8479
|
+
)
|
|
8480
|
+
)
|
|
8481
|
+
: null
|
|
8482
|
+
);
|
|
8483
|
+
}
|
|
8484
|
+
|
|
8485
|
+
function SettingsPage(props) {
|
|
8486
|
+
const { onEnter, onExit } = props;
|
|
8487
|
+
const p = usePrefs();
|
|
8488
|
+
/* 用户口径 2026-11-08:在**这个**设置页里拨主开关,只改状态,**不要退出设置页**。
|
|
8489
|
+
之前是 `if (next) onEnter(); else onExit();` —— 开也走、关也走,
|
|
8490
|
+
拨一下页面就跳走(用户原话「开 关插件,都会立刻退出设置,这不对」)。
|
|
8491
|
+
参照物是宿主系统设置里那个「多栏插件」分区:拨开关只改状态、页面留着。
|
|
8492
|
+
`onEnter`/`onExit` 仍保留给页面底部「进入会话」按钮(那是明确的离开动作)。 */
|
|
8493
|
+
const toggle = () => {
|
|
8494
|
+
prefs.update({ enabled: !p.enabled });
|
|
8495
|
+
};
|
|
8257
8496
|
return h(
|
|
8258
8497
|
"div",
|
|
8259
8498
|
{ className: "dsv-settings" },
|
|
@@ -8281,32 +8520,8 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
8281
8520
|
t("把对话区变成可分栏的工作区:多个会话并排,各自有输入框、工具调用和插件面板。")
|
|
8282
8521
|
)
|
|
8283
8522
|
),
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
"div",
|
|
8287
|
-
{ className: "dsv-update-row" },
|
|
8288
|
-
h(
|
|
8289
|
-
"span",
|
|
8290
|
-
{ className: "dsv-update-text", "data-phase": update.phase },
|
|
8291
|
-
update.text === "" ? t("当前版本 {0}", [PLUGIN_VERSION]) : update.text
|
|
8292
|
-
),
|
|
8293
|
-
h(
|
|
8294
|
-
"button",
|
|
8295
|
-
{
|
|
8296
|
-
type: "button",
|
|
8297
|
-
className: "dsv-mini-btn",
|
|
8298
|
-
disabled: update.phase === "checking" || update.phase === "updating",
|
|
8299
|
-
onClick: checkUpdate
|
|
8300
|
-
},
|
|
8301
|
-
update.phase === "checking" ? t("检查中…") : t("检查更新")
|
|
8302
|
-
),
|
|
8303
|
-
h(
|
|
8304
|
-
"button",
|
|
8305
|
-
{ type: "button", className: "dsv-mini-btn", onClick: openMarket },
|
|
8306
|
-
t("插件市场")
|
|
8307
|
-
)
|
|
8308
|
-
),
|
|
8309
|
-
/* ── 区块一:基本 ── */
|
|
8523
|
+
h(UpdatePanel, { key: "update" }),
|
|
8524
|
+
/* ── 区块一:基本 ── */
|
|
8310
8525
|
h(
|
|
8311
8526
|
"div",
|
|
8312
8527
|
{ className: "dsv-section-head", key: "sec-basic" },
|
|
@@ -8626,132 +8841,7 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
8626
8841
|
h("span", { className: "dsv-enter-label" }, t("进入会话"))
|
|
8627
8842
|
)
|
|
8628
8843
|
),
|
|
8629
|
-
|
|
8630
|
-
update.modal === true
|
|
8631
|
-
? h(
|
|
8632
|
-
"div",
|
|
8633
|
-
{ className: "dsv-modal-mask", onClick: closeModal },
|
|
8634
|
-
h(
|
|
8635
|
-
"div",
|
|
8636
|
-
{
|
|
8637
|
-
className: "dsv-modal",
|
|
8638
|
-
onClick: (event) => {
|
|
8639
|
-
event.stopPropagation();
|
|
8640
|
-
}
|
|
8641
|
-
},
|
|
8642
|
-
h(
|
|
8643
|
-
"div",
|
|
8644
|
-
{ className: "dsv-modal-title" },
|
|
8645
|
-
update.phase === "done" ? t("更新完成") : update.phase === "error" ? t("更新没有完成") : t("发现新版本 {0}", [update.latest])
|
|
8646
|
-
),
|
|
8647
|
-
h(
|
|
8648
|
-
"div",
|
|
8649
|
-
{ className: "dsv-modal-body" },
|
|
8650
|
-
h(
|
|
8651
|
-
"div",
|
|
8652
|
-
{ className: "dsv-modal-row" },
|
|
8653
|
-
h("span", null, t("当前版本")),
|
|
8654
|
-
h("b", null, update.installed)
|
|
8655
|
-
),
|
|
8656
|
-
update.phase === "done" || update.phase === "error"
|
|
8657
|
-
? null
|
|
8658
|
-
: h(
|
|
8659
|
-
"div",
|
|
8660
|
-
{ className: "dsv-modal-row" },
|
|
8661
|
-
h("span", null, t("新版本")),
|
|
8662
|
-
h("b", null, update.latest)
|
|
8663
|
-
),
|
|
8664
|
-
update.checkedAt !== "" ? h("div", { className: "dsv-modal-row" }, h("span", null, t("检查时间")), h("b", null, update.checkedAt)) : null,
|
|
8665
|
-
update.progress === null || update.progress === void 0
|
|
8666
|
-
? null
|
|
8667
|
-
: h(
|
|
8668
|
-
"div",
|
|
8669
|
-
{ className: "dsv-modal-bar" },
|
|
8670
|
-
h("i", { style: { width: `${Math.max(4, Math.min(100, update.progress))}%` } })
|
|
8671
|
-
),
|
|
8672
|
-
update.forceHint !== ""
|
|
8673
|
-
? h("div", { className: "dsv-modal-note" }, update.forceHint)
|
|
8674
|
-
: null,
|
|
8675
|
-
update.phase === "done" ? h("div", null, update.text) : null,
|
|
8676
|
-
update.phase === "error" ? h("div", { className: "dsv-modal-err" }, update.text) : null
|
|
8677
|
-
),
|
|
8678
|
-
h(
|
|
8679
|
-
"div",
|
|
8680
|
-
{ className: "dsv-modal-actions" },
|
|
8681
|
-
update.phase === "done"
|
|
8682
|
-
? h(
|
|
8683
|
-
"button",
|
|
8684
|
-
{
|
|
8685
|
-
type: "button",
|
|
8686
|
-
"data-primary": "1",
|
|
8687
|
-
onClick: () => {
|
|
8688
|
-
try {
|
|
8689
|
-
window.location.reload();
|
|
8690
|
-
} catch {
|
|
8691
|
-
/* 忽略 */
|
|
8692
|
-
}
|
|
8693
|
-
}
|
|
8694
|
-
},
|
|
8695
|
-
t("刷新页面")
|
|
8696
|
-
)
|
|
8697
|
-
: [
|
|
8698
|
-
h(
|
|
8699
|
-
"button",
|
|
8700
|
-
{ key: "later", type: "button", onClick: closeModal },
|
|
8701
|
-
t("稍后")
|
|
8702
|
-
),
|
|
8703
|
-
h(
|
|
8704
|
-
"button",
|
|
8705
|
-
{
|
|
8706
|
-
key: "go",
|
|
8707
|
-
type: "button",
|
|
8708
|
-
"data-primary": "1",
|
|
8709
|
-
onClick: update.canUpdate === true ? () => runUpdate() : () => checkUpdate()
|
|
8710
|
-
},
|
|
8711
|
-
update.canUpdate === true ? t("立即更新") : t("重新检查")
|
|
8712
|
-
)
|
|
8713
|
-
]
|
|
8714
|
-
)
|
|
8715
|
-
)
|
|
8716
|
-
)
|
|
8717
|
-
: null,
|
|
8718
|
-
marketOpen === true
|
|
8719
|
-
? h(
|
|
8720
|
-
"div",
|
|
8721
|
-
{
|
|
8722
|
-
className: "dsv-market-shell",
|
|
8723
|
-
onClick: () => {
|
|
8724
|
-
setMarketOpen(false);
|
|
8725
|
-
}
|
|
8726
|
-
},
|
|
8727
|
-
h(
|
|
8728
|
-
"div",
|
|
8729
|
-
{
|
|
8730
|
-
className: "dsv-market-box",
|
|
8731
|
-
onClick: (event) => {
|
|
8732
|
-
event.stopPropagation();
|
|
8733
|
-
}
|
|
8734
|
-
},
|
|
8735
|
-
h(
|
|
8736
|
-
"div",
|
|
8737
|
-
{ className: "dsv-market-head" },
|
|
8738
|
-
h("span", { className: "dsv-market-title" }, t("插件市场 · 已安装")),
|
|
8739
|
-
h(
|
|
8740
|
-
"button",
|
|
8741
|
-
{
|
|
8742
|
-
type: "button",
|
|
8743
|
-
className: "dsv-mini-btn",
|
|
8744
|
-
onClick: () => {
|
|
8745
|
-
setMarketOpen(false);
|
|
8746
|
-
}
|
|
8747
|
-
},
|
|
8748
|
-
t("关闭")
|
|
8749
|
-
)
|
|
8750
|
-
),
|
|
8751
|
-
h("div", { className: "dsv-market-body" }, renderMarketPanel())
|
|
8752
|
-
)
|
|
8753
|
-
)
|
|
8754
|
-
: null
|
|
8844
|
+
|
|
8755
8845
|
);
|
|
8756
8846
|
}
|
|
8757
8847
|
|
|
@@ -8798,6 +8888,7 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
8798
8888
|
{ style: { margin: 0, fontSize: "13px", lineHeight: 1.65, opacity: 0.72 } },
|
|
8799
8889
|
t("启用后,对话区会变成 Hermes 式工作区:顶部一条标签栏,可并排多个会话,每个会话都有独立输入框。")
|
|
8800
8890
|
),
|
|
8891
|
+
h(UpdatePanel, { key: "update" }),
|
|
8801
8892
|
switchCard(t("启用{0}", [pluginName()]), p.enabled ? t("已启用") : t("未启用(保持原生单栏对话)"), p.enabled === true, t("启用{0}", [pluginName()]), toggle),
|
|
8802
8893
|
switchCard(
|
|
8803
8894
|
t("在侧边栏显示入口"),
|
|
@@ -8905,7 +8996,7 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
8905
8996
|
st.done = focusKey;
|
|
8906
8997
|
return;
|
|
8907
8998
|
}
|
|
8908
|
-
const col =
|
|
8999
|
+
const col = rightbarColumn();
|
|
8909
9000
|
const wasOpen = col !== null && col.getBoundingClientRect().width > 1;
|
|
8910
9001
|
/* 决策 2b 的兜底素材:切换**前**右栏是不是正开着一个会话相关内容。
|
|
8911
9002
|
记下来是为了「切到一个从没开过侧栏的会话」时,能沿用同一种类型,
|
|
@@ -10579,6 +10670,7 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
10579
10670
|
stop = layout.panelInfo.subscribe(() => {
|
|
10580
10671
|
check();
|
|
10581
10672
|
mirrorSettingsFromPanel();
|
|
10673
|
+
syncRightbarVisibility();
|
|
10582
10674
|
});
|
|
10583
10675
|
}
|
|
10584
10676
|
} catch {
|
|
@@ -10586,6 +10678,7 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
10586
10678
|
}
|
|
10587
10679
|
check();
|
|
10588
10680
|
mirrorSettingsFromPanel();
|
|
10681
|
+
syncRightbarVisibility();
|
|
10589
10682
|
return () => {
|
|
10590
10683
|
disposed = true;
|
|
10591
10684
|
if (timed !== null) clearInterval(timed);
|
|
@@ -10616,7 +10709,6 @@ if (typeof renderFactorySlot !== "function") return h("div", { className: "dsv-e
|
|
|
10616
10709
|
};
|
|
10617
10710
|
}, "dsh-split-view: one new session per pane");
|
|
10618
10711
|
|
|
10619
|
-
startRightbarKeepOpen();
|
|
10620
10712
|
startSidebarMarks();
|
|
10621
10713
|
activateWorkspace(ctx);
|
|
10622
10714
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
2
|
"name": "dsh-multipane",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "Split the DSH main area into up to four panes, each with its own tab strip, composer and view switcher. Drag a tab to a pane edge to split. Bilingual (zh/en).",
|
|
5
5
|
"displayName": "多栏视图",
|
|
6
6
|
"dshhub": {
|