Skip to main content

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
required
Object containing optional width and height properties
number
New window width in pixels (optional)
number
New window height in pixels (optional)
Returns: 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
required
Object containing x and y offset values
number
required
Horizontal offset in pixels (positive = right, negative = left)
number
required
Vertical offset in pixels (positive = down, negative = up)
Returns: 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.
boolean
required
Whether the brain panel should be collapsed
  • true - Collapse to 60x60px mini icon
  • false - Expand to 320x400px full panel
Returns: 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
Expanded:
  • Size: 320x400 pixels
  • Position: 20px from top, 340px from right edge

External Navigation

openExternal

Opens a URL in the system’s default web browser.
string
required
The URL to open in the default browser
Returns: void (one-way message) Implementation: frontend/electron/src/ipc/window-handlers.ts:31

Security

This method uses Electron’s shell.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.
(memory: string) => void
required
Function to call when memory is stored
  • memory - The captured memory text
Returns: () => 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.
(enabled: boolean) => void
required
Function to call when capture status changes
  • enabled - Whether context capture is now enabled
Returns: () => void - Cleanup function to remove the listener Implementation: frontend/electron/src/preload.ts:41