@240xu/dsh-message-ops 0.4.2 → 0.4.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/README.md CHANGED
@@ -219,3 +219,9 @@ MIT
219
219
  chevron)、rounded-xl + 0.5px 边框 + bg-layer-01 容器、24px 行高 + neutral
220
220
  小按钮(非文字链)、items 变化自动折叠、Enter/Space 键盘切换、18px
221
221
  sacrificial 空间。
222
+
223
+ ### 0.4.3 · dock 崩溃修复(Hooks 规则违规)
224
+
225
+ - 0.4.1 的自动折叠 useEffect 位于「无标记早退」之后——标记从 0 变非 0 时多出
226
+ 第 4 个 hook,React 抛出 hooks 顺序错误并卸载整个槽(dock 永远不可见,
227
+ Playwright 抓到 React #310)。已把该 effect 移到早退之前(无条件 hook)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@240xu/dsh-message-ops",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Roll back, branch, and export any DSH conversation — from the UI or straight from the agent via a message_ops tool. Non-destructive: logs stay append-only and recoverable. 消息回滚/删除/分支/导出四合一,内置 message_ops agent 工具;非破坏语义,日志只追加可恢复。",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/client.js CHANGED
@@ -745,6 +745,8 @@ window.__ModuleLoader__.load({
745
745
  return () => { alive = false }
746
746
  }, [sessionId])
747
747
 
748
+ // items 变化自动折叠(opencode createEffect 同款;必须在早退之前——Hooks 规则)
749
+ useEffect(() => { setOpen(false) }, [markers && markers.length, markers && markers[0] && markers[0].seq])
748
750
  if (!markers || !markers.length) return null
749
751
 
750
752
  const restoreRow = (row) => {
@@ -769,8 +771,6 @@ window.__ModuleLoader__.load({
769
771
  })
770
772
  }
771
773
 
772
- // items 变化自动折叠(opencode createEffect 同款)
773
- useEffect(() => { setOpen(false) }, [markers && markers.length, markers && markers[0] && markers[0].seq])
774
774
 
775
775
  const headerKbd = (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setOpen((v) => !v) } }
776
776
  const label = t('dock.title', { n: String(markers.length) })