@theoremjs/react 0.3.5-next.926.g05c82e3 → 0.3.5-next.929.gfca1b14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/react",
3
- "version": "0.3.5-next.926.g05c82e3",
3
+ "version": "0.3.5-next.929.gfca1b14",
4
4
  "description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -60,8 +60,8 @@
60
60
  "@stylexjs/stylex": "0.19.0",
61
61
  "react": "^19.0.0",
62
62
  "react-dom": "^19.0.0",
63
- "@theoremjs/agents": "^0.3.5-next.926.g05c82e3",
64
- "@theoremjs/web": "^0.3.5-next.926.g05c82e3"
63
+ "@theoremjs/agents": "^0.3.5-next.929.gfca1b14",
64
+ "@theoremjs/web": "^0.3.5-next.929.gfca1b14"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {
@@ -575,15 +575,19 @@ function useTurnElapsed(streaming, startedAt, workedMs) {
575
575
  /**
576
576
  * The turn's work status; with a trace, a Collapsible over its thinking and
577
577
  * tool calls, open while the turn runs so they can be followed, folded away
578
- * when it ends.
578
+ * when it ends. invariant: a run's end folds only what the run opened; a trace
579
+ * the person opened before a wake continued the turn stays open.
579
580
  */
580
581
  function TurnStatus(props) {
581
582
  const { status, streaming } = props;
582
583
  const [traceOpen, setTraceOpen] = useState(streaming);
583
584
  const [wasStreaming, setWasStreaming] = useState(streaming);
585
+ const [openBefore, setOpenBefore] = useState(false);
584
586
  if (wasStreaming !== streaming) {
585
587
  setWasStreaming(streaming);
586
- setTraceOpen(streaming);
588
+ if (streaming)
589
+ setOpenBefore(traceOpen);
590
+ setTraceOpen(streaming || (traceOpen && openBefore));
587
591
  }
588
592
  if (!status)
589
593
  return null;