Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Merge remote-tracking branch 'origin/main' into train/nov8-b

milind-sonibd3674d99bc0
diff --cc src/components/ComputerPanel.simple.test.ts
index 72450e2eda,85d7cf8aea..d1cf7cdaa3
--- a/src/components/ComputerPanel.simple.test.ts
+++ b/src/components/ComputerPanel.simple.test.ts
@@@ -102,7 -102,7 +102,8 @@@ vi.mock("@/state/store", async (importO
}));
const { ComputerPanel } = await import("./ComputerPanel");
+const { WorksOnGrid } = await import("./WorksOnGrid");
+ const { FullScreenButton } = await import("./FullScreenButton");
const { ComputerFilesPane } = await import("./ComputerFilesPane");
const { CloudBackendPicker } = await import("./CloudBackendPicker");
const { LocalComputerAutoWarning } = await import("./LocalComputerAutoWarning");
@@@ -118,10 -118,12 +119,16 @@@ function nodes(value: ReactNode): Node[
return [node, ...nodes(node.props.children)];
});
}
+function destinations(rendered: { nodes: Node[] }): Node[] {
+ const grid = rendered.nodes.find((node) => node.type === WorksOnGrid)!;
+ return nodes(WorksOnGrid(grid.props as unknown as Parameters<typeof WorksOnGrid>[0])).filter((node) => node.type === "button");
+}
+ /** The action row's buttons by label; Full screen is its own component (watch-only until control is held). */
+ function actionLabels(row: Node): string[] {
+ return nodes(row.props.children).filter((node) => node.type === "button" || node.type === FullScreenButton)
+ .map((node) => node.type === FullScreenButton ? "Full screen" : text(node.props.children));
+ }
+
function text(value: ReactNode): string {
return Children.toArray(value).map((child) => {
if (typeof child === "string" || typeof child === "number") return String(child);