@michengai/dsh-codex-ui 0.2.66 → 0.2.68

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/dist/client.js CHANGED
@@ -1487,7 +1487,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
1487
1487
  };
1488
1488
  const renderGroup = (workspace, zone) => {
1489
1489
  const expandKey = zone === "pinned" ? `pin:${workspace.workspaceId}` : String(workspace.workspaceId);
1490
- const isExpanded = expanded[expandKey] ?? zone !== "pinned";
1490
+ const isExpanded = expanded[expandKey] ?? true;
1491
1491
  const shownIds = workspace.visibleIds.filter((id) => !pinSectionSessions.includes(id));
1492
1492
  const menuOpen = menu?.type === "workspace" && menu.id === workspace.workspaceId;
1493
1493
  const menuAt = menuOpen && menu.x !== void 0 && menu.y !== void 0 ? {
@@ -1575,7 +1575,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
1575
1575
  setPinSlot(void 0);
1576
1576
  },
1577
1577
  onClick: () => {
1578
- if (zone !== "pinned") toggleGroup(expandKey, true);
1578
+ toggleGroup(expandKey, true);
1579
1579
  },
1580
1580
  onContextMenu: (event) => {
1581
1581
  event.preventDefault();
@@ -1604,7 +1604,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
1604
1604
  onKeyDown: (event) => {
1605
1605
  if (event.key === "Enter" || event.key === " ") {
1606
1606
  event.preventDefault();
1607
- if (zone !== "pinned") toggleGroup(expandKey, true);
1607
+ toggleGroup(expandKey, true);
1608
1608
  }
1609
1609
  },
1610
1610
  children: [
@@ -1627,7 +1627,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
1627
1627
  top: box.top
1628
1628
  }, { immediate: true });
1629
1629
  },
1630
- children: zone !== "pinned" && isExpanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenOutline16, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderClose16, { size: 16 })
1630
+ children: isExpanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenOutline16, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderClose16, { size: 16 })
1631
1631
  }),
1632
1632
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1633
1633
  className: "dcu-wb-project-title",
@@ -1697,11 +1697,11 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
1697
1697
  })
1698
1698
  ]
1699
1699
  }),
1700
- zone !== "pinned" && isExpanded && shownIds.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1700
+ isExpanded && shownIds.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1701
1701
  className: "dcu-wb-nochat",
1702
1702
  children: t("workspace.noChat")
1703
1703
  }),
1704
- zone !== "pinned" && isExpanded && shownIds.map((id) => {
1704
+ isExpanded && shownIds.map((id) => {
1705
1705
  const session = sessions.byId[id];
1706
1706
  if (session === void 0) return null;
1707
1707
  const path = session.cwd ?? workspace.path;
package/dist/index.mjs CHANGED
@@ -333,16 +333,16 @@ function runDshPlugin(args) {
333
333
  /** 并发安装互斥:pnpm 锁文件竞争会触发 EPERM/EBUSY,同一时间只允许一个安装进程。 */
334
334
  let installing = false;
335
335
  /** 仅允许安装固定依赖,避免把浏览器输入转成任意命令。 */
336
- async function installDependency(id) {
336
+ async function installDependency(id, requestHotUpdate = requestDesktopHotUpdate) {
337
337
  if (installing) throw new Error("已有依赖安装正在进行,请等待完成后再试。");
338
338
  installing = true;
339
339
  try {
340
- return await installDependencyLocked(id);
340
+ return await installDependencyLocked(id, requestHotUpdate);
341
341
  } finally {
342
342
  installing = false;
343
343
  }
344
344
  }
345
- async function installDependencyLocked(id) {
345
+ async function installDependencyLocked(id, requestHotUpdate) {
346
346
  const dependency = managedDependency(id);
347
347
  if (dependency === void 0) throw new Error("不支持安装该依赖。");
348
348
  const latestVersion = await npmLatestVersion(dependency.packageName);
@@ -356,7 +356,7 @@ async function installDependencyLocked(id) {
356
356
  await ensureLatestReleaseAllowed(target, targetVersion);
357
357
  if (!isOfficialRuntimePackage(target)) await recordDeclaredVersion(target, targetVersion);
358
358
  await recordPendingUpdate(target, targetVersion);
359
- if (requestDesktopHotUpdate()) return dependencyStatuses();
359
+ if (requestHotUpdate()) return dependencyStatuses();
360
360
  try {
361
361
  await runDshPlugin([
362
362
  "add",
@@ -497,7 +497,11 @@ function apply(ctx) {
497
497
  response.end(JSON.stringify({ error: "已拒绝跨站请求。" }));
498
498
  return;
499
499
  }
500
- const dependencies = await installDependency(url.searchParams.get("dependency"));
500
+ let restartAfterResponse = false;
501
+ const dependencies = await installDependency(url.searchParams.get("dependency"), () => {
502
+ restartAfterResponse = typeof process.send === "function";
503
+ return restartAfterResponse;
504
+ });
501
505
  response.writeHead(200, {
502
506
  "content-type": "application/json; charset=utf-8",
503
507
  "cache-control": "no-store"
@@ -506,6 +510,9 @@ function apply(ctx) {
506
510
  dependencies,
507
511
  restartRequired: true
508
512
  }));
513
+ if (restartAfterResponse) setTimeout(() => {
514
+ requestDesktopHotUpdate();
515
+ }, 150).unref?.();
509
516
  return;
510
517
  }
511
518
  response.writeHead(405);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michengai/dsh-codex-ui",
3
- "version": "0.2.66",
3
+ "version": "0.2.68",
4
4
  "description": "以 Codex 风格重构 DSH Web 侧栏的独立客户端插件",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {