dsh-multipane 1.0.28 → 1.0.29

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/client.js CHANGED
@@ -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.28";
20
+ const PLUGIN_VERSION = "1.0.29";
21
21
  const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
22
22
  /**
23
23
  * 插件市场把自己注册成客户端服务 `market`(`ctx.provide("market", …)`),
@@ -258,7 +258,10 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
258
258
  * the panel shows the settings page (or the native view) has no live bridge
259
259
  * yet, so the request parks here and the panel picks it up on mount.
260
260
  */
261
- const pendingOpen = { sessionId: null };
261
+ /* mode: "replace"(用户点某个会话,就地替换)| "tab"(新建会话,必须作为新标签落地)
262
+ 工作区被卸载时(停在别的插件设置页)两条路径都会走到 pendingOpen,
263
+ 不区分就会让「新建会话」把用户正在看的会话顶掉。 */
264
+ const pendingOpen = { sessionId: null, mode: null };
262
265
 
263
266
  /**
264
267
  * The session the host created a moment ago (新建会话 / Ctrl+Alt+N / any
@@ -409,6 +412,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
409
412
  bridge.openTab(sessionId);
410
413
  return;
411
414
  }
415
+ /* 工作区此刻不在(例如用户停在别的插件的设置页):先挂起,并明确标记
416
+ 「工作区回来后要作为**新标签**落地」,否则消费端会用替换语义把当前会话顶掉。 */
417
+ pendingOpen.mode = "tab";
412
418
  requestOpen(sessionId);
413
419
  }
414
420
 
@@ -7504,7 +7510,9 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
7504
7510
  // enabling the workspace lands on a single real tab, not a blank one.
7505
7511
  react.useEffect(() => {
7506
7512
  const queued = pendingOpen.sessionId;
7513
+ const queuedMode = pendingOpen.mode;
7507
7514
  pendingOpen.sessionId = null;
7515
+ pendingOpen.mode = null;
7508
7516
  let current = null;
7509
7517
  try {
7510
7518
  current = resolveWorkspaceService()?.selection?.getSnapshot?.()?.sessionId ?? null;
@@ -7516,7 +7524,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
7516
7524
  setState((prev) => {
7517
7525
  const showsSomething = prev.panes.some((pane) => pane.tabs.some((tab) => tab.sessionId !== null));
7518
7526
  if (showsSomething && queued === null) return prev;
7519
- return openSession(prev, seed, "replace");
7527
+ /* 「新建会话」挂起的用 tab;普通会话点击仍用 replace */
7528
+ return openSession(prev, seed, queuedMode === "tab" ? "tab" : "replace");
7520
7529
  });
7521
7530
  }, []);
7522
7531
 
package/lib/index.js CHANGED
@@ -131,7 +131,10 @@ function installFromRegistry(profileDir, version) {
131
131
  mkdirSync(staging, { recursive: true });
132
132
  const dl = await run("curl", ["-sSL", "--noproxy", "*", "--max-time", "110", "-o", tarball, url]);
133
133
  if (!dl.ok || !existsSync(tarball)) return { ok: false, message: "下载失败:" + dl.err.slice(0, 200) };
134
- const un = await run("tar", ["-xzf", tarball, "-C", staging]);
134
+ /* 必须用 Windows 自带的 bsdtar:git-bash 里的 GNU tar 会把 "C:/…" 当成
135
+ host:path 语法去连远程主机(报 "Cannot connect to C: resolve failed")。 */
136
+ const tarExe = existsSync("C:/Windows/System32/tar.exe") ? "C:/Windows/System32/tar.exe" : "tar";
137
+ const un = await run(tarExe, ["-xzf", tarball, "-C", staging]);
135
138
  if (!un.ok) return { ok: false, message: "解压失败:" + un.err.slice(0, 200) };
136
139
  const unpacked = join(staging, "package");
137
140
  if (!existsSync(join(unpacked, "package.json"))) return { ok: false, message: "包里没有 package.json" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-multipane",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Hermes-style tabbed workspace for the DSH main area: drag sessions in, split into up to four columns, close tabs.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",