MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / openWindow

Function openWindow

apps/webuiapps/src/lib/windowManager.ts:48–75  ·  view source on GitHub ↗
(appId: number)

Source from the content-addressed store, hash-verified

46}
47
48export function openWindow(appId: number): void {
49 const existing = windows.find((w) => w.appId === appId);
50 if (existing) {
51 // Focus existing window
52 existing.zIndex = ++nextZ;
53 existing.minimized = false;
54 windows = [...windows];
55 notify();
56 return;
57 }
58
59 const size = getAppDefaultSize(appId);
60 const offset = (offsetCounter++ % 5) * 30;
61
62 const win: WindowState = {
63 appId,
64 title: getAppDisplayName(appId),
65 x: 80 + offset,
66 y: 40 + offset,
67 width: size.width,
68 height: size.height,
69 zIndex: ++nextZ,
70 minimized: false,
71 };
72
73 windows = [...windows, win];
74 notify();
75}
76
77export function closeWindow(appId: number): void {
78 windows = windows.filter((w) => w.appId !== appId);

Callers 2

ShellFunction · 0.90
dispatchAgentActionFunction · 0.90

Calls 3

getAppDefaultSizeFunction · 0.90
getAppDisplayNameFunction · 0.90
notifyFunction · 0.85

Tested by

no test coverage detected