@cryptiklemur/lattice 1.11.1 → 1.11.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.
@@ -8,31 +8,14 @@ export function useChartFullscreen(): number | false {
8
8
  return useContext(ChartFullscreenContext);
9
9
  }
10
10
 
11
- function FullscreenChartArea(props: { children: ReactNode }) {
12
- var containerRef = useRef<HTMLDivElement>(null);
13
- var [height, setHeight] = useState(400);
14
-
11
+ function useViewportChartHeight(): number {
12
+ var [h, setH] = useState(Math.round(window.innerHeight * 0.5));
15
13
  useEffect(function () {
16
- if (!containerRef.current) return;
17
- var observer = new ResizeObserver(function (entries) {
18
- for (var i = 0; i < entries.length; i++) {
19
- var h = entries[i].contentRect.height;
20
- if (h > 0) setHeight(h);
21
- }
22
- });
23
- observer.observe(containerRef.current);
24
- var h = containerRef.current.clientHeight;
25
- if (h > 0) setHeight(h);
26
- return function () { observer.disconnect(); };
14
+ function onResize() { setH(Math.round(window.innerHeight * 0.5)); }
15
+ window.addEventListener("resize", onResize);
16
+ return function () { window.removeEventListener("resize", onResize); };
27
17
  }, []);
28
-
29
- return (
30
- <div ref={containerRef} className="flex-1 p-6 overflow-auto min-h-0">
31
- <ChartFullscreenContext.Provider value={height - 48}>
32
- {props.children}
33
- </ChartFullscreenContext.Provider>
34
- </div>
35
- );
18
+ return h;
36
19
  }
37
20
 
38
21
  interface ChartCardProps {
@@ -44,6 +27,7 @@ interface ChartCardProps {
44
27
 
45
28
  export function ChartCard(props: ChartCardProps) {
46
29
  var [isFullscreen, setIsFullscreen] = useState(false);
30
+ var chartHeight = useViewportChartHeight();
47
31
  var cardRef = useRef<HTMLDivElement>(null);
48
32
  var [originRect, setOriginRect] = useState<DOMRect | null>(null);
49
33
  var [animating, setAnimating] = useState(false);
@@ -177,9 +161,13 @@ export function ChartCard(props: ChartCardProps) {
177
161
  </button>
178
162
  </div>
179
163
  </div>
180
- <FullscreenChartArea>
181
- {props.children}
182
- </FullscreenChartArea>
164
+ <div className="flex-1 p-6 overflow-auto min-h-0">
165
+ <ChartFullscreenContext.Provider value={chartHeight}>
166
+ <div style={{ height: chartHeight + "px" }}>
167
+ {props.children}
168
+ </div>
169
+ </ChartFullscreenContext.Provider>
170
+ </div>
183
171
  </div>
184
172
  </div>
185
173
  </>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptiklemur/lattice",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "Multi-machine agentic dashboard for Claude Code. Monitor sessions, manage MCP servers and skills, orchestrate across mesh-networked nodes.",
5
5
  "license": "MIT",
6
6
  "author": "Aaron Scherer <me@aaronscherer.me>",