# ClientUI Module - User Interface

## Context
You are working EXCLUSIVELY on the client user interface. No networking, no game logic, just UI rendering and user interactions.

## Responsibilities
- **ImGui Interface**: Buttons, windows, input fields, data display
- **User Interactions**: Handle clicks, keyboard input, UI events
- **Data Display**: Show responses from server modules (Economy, MacroEntity)
- **UI State Management**: Window positions, selections, UI preferences

## Interface Contract
```cpp
// Input JSON examples (from user interactions):
{
  "type": "ui_event",
  "action": "button_click",
  "button": "get_economy_prices"
}

{
  "type": "display_data",
  "source": "economy",
  "data": {"steel_plate": 5.2, "iron_ore": 1.1}
}

// Output JSON examples (to server modules):
{
  "type": "economy_request",
  "action": "get_prices"
}

{
  "type": "macroentity_request",
  "action": "get_companies"
}
```

## Communication via IntraIO
```cpp
// Subscribe to server module responses
io->subscribe("economy:response");
io->subscribe("macroentity:response");

// Publish requests to server modules
io->publish("economy:request", {{"type", "get_prices"}});
io->publish("macroentity:request", {{"type", "get_companies"}});
```

## Build Commands
```bash
cd client/modules/client-ui/
cmake .                      # Build from THIS directory
make client-ui-module        # Generates client-ui.so
make client-ui-test          # Run UI tests
./build/client-ui-standalone # Test the UI module
```

## File Limits
- **ClientUIModule.cpp**: Max 300 lines
- **UI logic only**: No game logic, no networking beyond IntraIO
- **JSON in/out**: All communication via JSON messages through IIO

## Focus Areas
1. ImGui rendering (windows, buttons, text display)
2. User input handling (clicks, keyboard)
3. Data visualization (tables, graphs for economy/company data)
4. UI state persistence (window positions, preferences)

Claude Code should NEVER leave this directory or reference parent paths!