@alexpeng/dsh-custom-plugin 0.9.2 → 0.9.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to this project are documented here. The format loosely
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
5
  follow [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## 0.9.3 — 2026-10-26
8
+
9
+ ### Changed
10
+
11
+ - **浮层/文件夹节点订阅收窄**:`OverlayRoot` 只选它渲染的 14 个字段(overlay/config/
12
+ theme/session),`FolderNode` 只选 `folderAdd` / `folderWsPick` / `dropHint`;
13
+ 整店 `useS()` 从 19 降到 17。流式/用量/toast 写入不再重渲染整个浮层树或每个文件夹
14
+ 节点。
15
+
16
+ ### Verified
17
+
18
+ - 0.9.3 tarball 装进隔离的 dsh 0.2.1-rc.3 profile(无兼容豁免)并冷启动;活体探针
19
+ 全部通过,1 项因无会话跳过(时间线/导出/搜索,由单测覆盖)。
20
+ - `pnpm check:readme`、`pnpm typecheck`、`pnpm test`(214)、`pnpm build`、`pnpm smoke`
21
+ 全绿。
22
+
7
23
  ## 0.9.2 — 2026-10-26
8
24
 
9
25
  ### Changed
package/README.i18n.yaml CHANGED
@@ -1,7 +1,7 @@
1
- # Bilingual-pair consistency record: the git blob hash of each README as of
2
- # the last confirmed-consistent state. Both languages carry equal authority;
3
- # after editing either side, bring the other along and re-record the hashes:
4
- # git hash-object --path README.md README.md
5
- # git hash-object --path README.zh.md README.zh.md
6
- README.md: 4c5fbe086924635e8f9020244fd8d18e2e80ed01
7
- README.zh.md: ead137acecc97e504b48ea2535d20e501de0b91f
1
+ # Bilingual-pair consistency record: the git blob hash of each README as of
2
+ # the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record the hashes:
4
+ # git hash-object --path README.md README.md
5
+ # git hash-object --path README.zh.md README.zh.md
6
+ README.md: 4c5fbe086924635e8f9020244fd8d18e2e80ed01
7
+ README.zh.md: ead137acecc97e504b48ea2535d20e501de0b91f
package/lib/client.js CHANGED
@@ -4169,7 +4169,11 @@ window.__ModuleLoader__.load({
4169
4169
  }));
4170
4170
  }
4171
4171
  function FolderNode(props) {
4172
- const s = useS();
4172
+ const { folderAdd, folderWsPick, dropHint } = useSSelector((state) => ({
4173
+ folderAdd: state.folderAdd,
4174
+ folderWsPick: state.folderWsPick,
4175
+ dropHint: state.dropHint
4176
+ }), shallowEqual);
4173
4177
  const node = props.node;
4174
4178
  const [open, setOpen] = react.useState(true);
4175
4179
  const sessions = useSessionsSafe(props);
@@ -4288,9 +4292,9 @@ window.__ModuleLoader__.load({
4288
4292
  const rowLeave = () => {
4289
4293
  if (S.dropHint !== null && S.dropHint.id === node.id) setS({ dropHint: null });
4290
4294
  };
4291
- const adding = s.folderAdd === node.id;
4292
- const pickingWs = s.folderWsPick === node.id;
4293
- const hintZone = s.dropHint !== null && s.dropHint.id === node.id ? s.dropHint.zone : null;
4295
+ const adding = folderAdd === node.id;
4296
+ const pickingWs = folderWsPick === node.id;
4297
+ const hintZone = dropHint !== null && dropHint.id === node.id ? dropHint.zone : null;
4294
4298
  const children = node.children ?? [];
4295
4299
  const sessIds = node.sessionIds ?? [];
4296
4300
  const wsIds = node.workspaceIds ?? [];
@@ -5735,7 +5739,22 @@ window.__ModuleLoader__.load({
5735
5739
  }, t.action.label) : null)));
5736
5740
  }
5737
5741
  function OverlayRoot(props) {
5738
- const s = useS();
5742
+ const { cfg, dark, booted, sessionId, panelOpen, foldersOpen, promptOpen, mermaidModal, batchModal, commandOpen, quoteSel, ask, confirmAsk, templatePrompt } = useSSelector((state) => ({
5743
+ cfg: state.cfg,
5744
+ dark: state.dark,
5745
+ booted: state.booted,
5746
+ sessionId: state.sessionId,
5747
+ panelOpen: state.panelOpen,
5748
+ foldersOpen: state.foldersOpen,
5749
+ promptOpen: state.promptOpen,
5750
+ mermaidModal: state.mermaidModal,
5751
+ batchModal: state.batchModal,
5752
+ commandOpen: state.commandOpen,
5753
+ quoteSel: state.quoteSel,
5754
+ ask: state.ask,
5755
+ confirmAsk: state.confirmAsk,
5756
+ templatePrompt: state.templatePrompt
5757
+ }), shallowEqual);
5739
5758
  /** 当前 GUI 实际配色。主题服务已解析的快照最权威(覆盖 GUI 内全局深色
5740
5759
  * 切换,与 OS 偏好无关);其次 body 上呈现器维护的 data-ds-dark-theme;
5741
5760
  * 最后兜底操作系统 prefers-color-scheme。 */
@@ -5770,27 +5789,27 @@ window.__ModuleLoader__.load({
5770
5789
  return () => d.removeEventListener("keydown", onKey);
5771
5790
  }, []);
5772
5791
  react.useEffect(() => {
5773
- if (s.booted) applyAppearance();
5792
+ if (booted) applyAppearance();
5774
5793
  }, [
5775
- s.booted,
5776
- s.cfg.bg,
5777
- s.cfg.glass,
5778
- s.cfg.glassMode,
5779
- s.cfg.globalGlass,
5780
- s.dark
5794
+ booted,
5795
+ cfg.bg,
5796
+ cfg.glass,
5797
+ cfg.glassMode,
5798
+ cfg.globalGlass,
5799
+ dark
5781
5800
  ]);
5782
5801
  react.useEffect(() => {
5783
- syncAntiScroll(s.cfg.antiScroll === true);
5802
+ syncAntiScroll(cfg.antiScroll === true);
5784
5803
  return () => {
5785
5804
  syncAntiScroll(false);
5786
5805
  };
5787
- }, [s.cfg.antiScroll]);
5806
+ }, [cfg.antiScroll]);
5788
5807
  react.useEffect(() => {
5789
5808
  const w = typeof window !== "undefined" ? window : null;
5790
5809
  const d = typeof document !== "undefined" ? document : null;
5791
- const applyDark = (dark) => {
5792
- S.dark = dark;
5793
- setS({ dark });
5810
+ const applyDark = (nextDark) => {
5811
+ S.dark = nextDark;
5812
+ setS({ dark: nextDark });
5794
5813
  };
5795
5814
  applyDark(readDark());
5796
5815
  let offTheme;
@@ -5828,15 +5847,15 @@ window.__ModuleLoader__.load({
5828
5847
  const dark = readDark();
5829
5848
  S.dark = dark;
5830
5849
  setS({ dark });
5831
- }, [s.booted]);
5850
+ }, [booted]);
5832
5851
  react.useEffect(() => {
5833
5852
  const d = typeof document !== "undefined" ? document : null;
5834
5853
  if (d === null) return;
5835
- d.documentElement.classList.toggle("vx-dark", s.dark === true);
5836
- d.documentElement.classList.toggle("vx-light", s.dark !== true);
5837
- }, [s.dark]);
5854
+ d.documentElement.classList.toggle("vx-dark", dark === true);
5855
+ d.documentElement.classList.toggle("vx-light", dark !== true);
5856
+ }, [dark]);
5838
5857
  const sessions = useSessionsSafe(props);
5839
- const summary = sessions !== null && s.sessionId !== null ? sessions.byId[s.sessionId] : null;
5858
+ const summary = sessions !== null && sessionId !== null ? sessions.byId[sessionId] : null;
5840
5859
  react.useEffect(() => {
5841
5860
  const watchedId = S.sessionId;
5842
5861
  if (watchedId === null) return;
@@ -5864,36 +5883,36 @@ window.__ModuleLoader__.load({
5864
5883
  if (typeof document !== "undefined") document.removeEventListener("visibilitychange", onVisibility);
5865
5884
  if (!disposed && S.sessionId === watchedId) fetchTurns(watchedId);
5866
5885
  };
5867
- }, [s.sessionId, summary?.running]);
5886
+ }, [sessionId, summary?.running]);
5868
5887
  const children = [react.createElement(FxCanvas, { key: "fx" })];
5869
5888
  children.push(react.createElement(MermaidInPlace, { key: "mmd" }));
5870
- if (s.panelOpen === true) children.push(react.createElement(PersonalizePanel, {
5889
+ if (panelOpen === true) children.push(react.createElement(PersonalizePanel, {
5871
5890
  key: "panel",
5872
5891
  useSessions: props.useSessions,
5873
5892
  useWorkspaces: props.useWorkspaces
5874
5893
  }));
5875
- if (s.foldersOpen === true) children.push(react.createElement(SidebarFoldersPanel, {
5894
+ if (foldersOpen === true) children.push(react.createElement(SidebarFoldersPanel, {
5876
5895
  key: "folders",
5877
5896
  useSessions: props.useSessions,
5878
5897
  useWorkspaces: props.useWorkspaces
5879
5898
  }));
5880
- if (s.promptOpen !== null) children.push(react.createElement(PromptPopover, { key: "prompt" }));
5881
- if (s.mermaidModal !== null) children.push(react.createElement(MermaidModal, { key: "mermaid" }));
5882
- if (s.batchModal === true) children.push(react.createElement(BatchModal, {
5899
+ if (promptOpen !== null) children.push(react.createElement(PromptPopover, { key: "prompt" }));
5900
+ if (mermaidModal !== null) children.push(react.createElement(MermaidModal, { key: "mermaid" }));
5901
+ if (batchModal === true) children.push(react.createElement(BatchModal, {
5883
5902
  key: "batch",
5884
5903
  useSessions: props.useSessions
5885
5904
  }));
5886
- if (s.commandOpen === true) children.push(react.createElement(CommandPalette, {
5905
+ if (commandOpen === true) children.push(react.createElement(CommandPalette, {
5887
5906
  key: "command",
5888
5907
  useSessions: props.useSessions,
5889
5908
  useWorkspaces: props.useWorkspaces
5890
5909
  }));
5891
- if (s.quoteSel !== null && s.cfg.quote === true) children.push(react.createElement(QuoteButton, { key: "quote" }));
5892
- if (s.ask !== null) children.push(react.createElement(AskModal, { key: "ask" }));
5893
- if (s.confirmAsk !== null) children.push(react.createElement(ConfirmModal, { key: "confirm" }));
5894
- if (s.templatePrompt !== null) children.push(react.createElement(TemplateModal, { key: "template" }));
5910
+ if (quoteSel !== null && cfg.quote === true) children.push(react.createElement(QuoteButton, { key: "quote" }));
5911
+ if (ask !== null) children.push(react.createElement(AskModal, { key: "ask" }));
5912
+ if (confirmAsk !== null) children.push(react.createElement(ConfirmModal, { key: "confirm" }));
5913
+ if (templatePrompt !== null) children.push(react.createElement(TemplateModal, { key: "template" }));
5895
5914
  children.push(react.createElement(Toasts, { key: "toasts" }));
5896
- return react.createElement("div", { className: `vx-root ${s.dark ? "vx-dark" : "vx-light"}` }, children);
5915
+ return react.createElement("div", { className: `vx-root ${dark ? "vx-dark" : "vx-light"}` }, children);
5897
5916
  }
5898
5917
  setDynCss("");
5899
5918
  try {