Overview
Window management IPC methods control the visibility, position, and behavior of various application windows including the main menu, settings panel, brain panel, and suggestion windows.Window Control Methods
closeMenu
Closes the main menu window. Parameters: None Returns:void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:35
Behavior
Hides the main application window (AppState.mainWindow) from view. The window is not destroyed, only hidden, allowing it to be shown again quickly.
resizeWindow
Resizes the current window to the specified dimensions.Object containing optional width and height properties
New window width in pixels (optional)
New window height in pixels (optional)
void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:39
Behavior
Resizes the main window while preserving:- Current window position (x, y coordinates)
- Unspecified dimensions (width or height if not provided)
moveWindow
Moves the window by a relative offset from its current position.Object containing x and y offset values
Horizontal offset in pixels (positive = right, negative = left)
Vertical offset in pixels (positive = down, negative = up)
void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:50
Behavior
Moves the window relative to its current position while preserving:- Window dimensions (width and height)
- Current window state (minimized, maximized, etc.)
openSettings
Opens the settings window. Parameters: None Returns:void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:27
Behavior
Creates and displays a new settings window. If a settings window already exists, it will be brought to focus.Brain Panel Methods
The brain panel is a utility window that displays captured context and memories.toggleBrainPanel
Toggles the brain panel window visibility. Parameters: None Returns:void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:7
Behavior
- If the brain panel is visible, it will be hidden
- If the brain panel is not visible, it will be created and shown
- The panel appears in the top-right corner of the screen
setBrainPanelCollapsed
Sets the brain panel to collapsed or expanded state.Whether the brain panel should be collapsed
true- Collapse to 60x60px mini iconfalse- Expand to 320x400px full panel
void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:16
Dimensions
Collapsed:- Size: 60x60 pixels
- Position: 20px from top, 80px from right edge
- Size: 320x400 pixels
- Position: 20px from top, 340px from right edge
External Navigation
openExternal
Opens a URL in the system’s default web browser.The URL to open in the default browser
void (one-way message)
Implementation: frontend/electron/src/ipc/window-handlers.ts:31
Security
This method uses Electron’sshell.openExternal() which:
- Opens URLs in the system’s default browser (not in Electron)
- Respects system security settings
- Shows security warnings for non-http(s) protocols
Window Event Listeners
onMemoryStored
Called when a new memory is captured and stored.Function to call when memory is stored
memory- The captured memory text
() => void - Cleanup function to remove the listener
Implementation: frontend/electron/src/preload.ts:35
onCaptureStatusChanged
Called when the context capture feature is enabled or disabled.Function to call when capture status changes
enabled- Whether context capture is now enabled
() => void - Cleanup function to remove the listener
Implementation: frontend/electron/src/preload.ts:41
Related APIs
- Text Operations - Insert and manipulate text
- Settings - Configure application behavior
- Context Capture - Manage context and memory