Class: UIController

UIController()

new UIController()

Main UI Controller - Coordinates all managers and components

This is the central coordinator for the entire application UI. It manages the interaction between different managers and handles global UI state.

Version:
  • 1.0.0
Author:
  • CTrace GUI Team
Source:
Example
// UIController is automatically instantiated in the HTML
const uiController = new UIController();

Classes

UIController

Methods

connectManagers()

Connect managers and set up inter-manager communication

Source:

(async) ensureAssistantConfigured()

Ensure assistant is configured; if not, show guided setup modal

Source:

getAssistantConfig() → {Object|null}

Retrieve assistant configuration from localStorage

Source:
Returns:
Type
Object | null

(async) openSearchResult(filePath, lineNumber)

Open search result with proper line navigation

Parameters:
Name Type Description
filePath string

File path

lineNumber number

Line number

Source:

(async) openWorkspace()

Open workspace and update search manager

Source:

(async) refreshFileTree()

Refreshes the file tree in the explorer view.

This method manually triggers a refresh of the file tree to show any new files or folders that may have been added to the workspace. It communicates with the main process to get an updated file tree structure.

Source:
Throws:

When file tree refresh fails

Type
Error
Example
// Refresh is typically triggered by the refresh button
await uiController.refreshFileTree();

renderAssistantUI()

Inject a simple chat UI into the tools panel (like VSCode Copilot sidebar)

Source:

saveAssistantConfig(cfg)

Save assistant configuration to localStorage

Parameters:
Name Type Description
cfg Object
Source:

setActiveActivity()

Activity bar management

Source:

setupEventListeners()

Setup event listeners for UI components

Source:

setupFileTreeWatcher()

Set up file system watcher to auto-refresh file tree

Source:

setupFileTreeWatcher()

Setup file tree watcher to listen for automatic updates

Source:

setupKeyboardShortcuts()

Setup keyboard shortcuts

Source:

setupMenus()

Setup menu functionality

Source:

setupResizing()

Setup resizing functionality

Source:

setupUIComponents()

Setup UI component functions

Source:

setupWSLStatusListener()

Setup WSL status listener to handle WSL availability updates

Source:

showAssistantSetupGuide()

Render a first-time setup modal for Assistant configuration. Calls the done callback with saved config or null if cancelled.

Source:

showToolsPanel()

Tools panel management

Source:

showWSLSetupDialog(wslStatus)

Show WSL setup dialog with detailed instructions

Parameters:
Name Type Description
wslStatus Object

Current WSL status

Source:

toggleSidebar()

Sidebar toggle

Source:

toggleVisualyzerPanel()

Visualyzer panel management

Source:

updateWSLStatusIndicator(wslStatus)

Update WSL status indicator in the UI

Parameters:
Name Type Description
wslStatus Object

WSL status object with available, hasDistros, and error properties

Source: