@theoremjs/react 0.3.4-next.600.gb15be9a → 0.3.4-next.602.gb5a7fab

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.4-next.600.gb15be9a",
3
+ "version": "0.3.4-next.602.gb5a7fab",
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.4-next.600.gb15be9a",
64
- "@theoremjs/web": "^0.3.4-next.600.gb15be9a"
63
+ "@theoremjs/agents": "^0.3.4-next.602.gb5a7fab",
64
+ "@theoremjs/web": "^0.3.4-next.602.gb5a7fab"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@astryxdesign/core": {
@@ -10,7 +10,7 @@ import { SegmentedControl, SegmentedControlItem } from '@astryxdesign/core/Segme
10
10
  import { Text } from '@astryxdesign/core/Text';
11
11
  import { TextArea } from '@astryxdesign/core/TextArea';
12
12
  import { VStack } from '@astryxdesign/core/VStack';
13
- import { Children, createContext, use, useMemo, useRef, useSyncExternalStore, } from 'react';
13
+ import { Children, createContext, use, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
14
14
  import { useLabels } from "./labels-provider.js";
15
15
  import { PANEL_EDGE, PanelBody, PanelScroll, paneEdge, RAISED, SidePanel, SidePanelHeader, } from "./SidePanel.js";
16
16
  import { textRows } from "./StateFields.js";
@@ -56,7 +56,7 @@ function ConsoleBody({ layoutRef, flush, columns, maxWidth, requestLabel, childr
56
56
  const drawn = Children.toArray(children).length;
57
57
  const paired = columns && drawn > 1;
58
58
  if (paired && !narrow) {
59
- return (_jsx(ConsoleColumns, { requestLabel: requestLabel, basisWidth: layoutRef.current?.clientWidth ?? 0, children: children }));
59
+ return (_jsx(ConsoleColumns, { requestLabel: requestLabel, layoutRef: layoutRef, children: children }));
60
60
  }
61
61
  return (_jsx(ConsoleSingle, { flush: flush, wide: paired, maxWidth: maxWidth, children: children }));
62
62
  }
@@ -66,7 +66,7 @@ function ConsoleBody({ layoutRef, flush, columns, maxWidth, requestLabel, childr
66
66
  * against this inner layout, not the page, so a trace docked outside the pair
67
67
  * cannot take the request's share.
68
68
  */
69
- function ConsoleColumns({ requestLabel = 'Request', basisWidth, children, }) {
69
+ function ConsoleColumns({ requestLabel = 'Request', layoutRef, children, }) {
70
70
  const t = useLabels();
71
71
  const pairRef = useRef(null);
72
72
  // why: a percentage default resolves against a 1200px stand-in until the pair
@@ -74,6 +74,8 @@ function ConsoleColumns({ requestLabel = 'Request', basisWidth, children, }) {
74
74
  // reflowing the request. This layout is already on screen, so the first
75
75
  // width is two fifths of it. 70% leaves the response a readable share, and a
76
76
  // percentage maximum follows the pair when the trace opens.
77
+ // why: Read once. Reading layout on every render forces a reflow of each streamed event's commit.
78
+ const [basisWidth] = useState(() => layoutRef.current?.clientWidth ?? 0);
77
79
  const requestPanel = useResizable({
78
80
  defaultSize: basisWidth > 0 ? Math.round(basisWidth * 0.4) : '40%',
79
81
  minSize: 280,