No description
- Go 98.9%
- Makefile 1.1%
| cmd/tradebotui | ||
| docs/features | ||
| internal | ||
| openspec | ||
| scripts | ||
| .gitignore | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| go.mod | ||
| go.sum | ||
| Icon.png | ||
| Makefile | ||
| QWEN.md | ||
| README.md | ||
tradebotui
Trading Robot UI - A desktop application for monitoring trading accounts and positions.
Features
- Dashboard: View aggregated metrics across all trading accounts
- Account Filtering: Click account buttons in sidebar to filter dashboard content by specific account
- Positions Management: View and monitor open positions
- Real-time Updates: Periodic refresh of account data (every 30 seconds)
- Multiple Accounts: Support for multiple trading accounts with aggregated views
- Robot Version Display: View backend robot version in header with detailed info on click
- Control Panels: Send YAML configurations to backend (Config, State, Strategy)
- Config Refresh: Load current configuration from backend with Refresh button
- Unsaved Changes Protection: Confirmation dialog when overwriting unsaved changes
Robot Version Display
The header displays the backend robot version next to the connection status:
- Version Label: Shows short version (e.g., "v0.4.0") in the header
- Clickable: Click on version to open modal dialog with full details
- Full Info: Modal shows Version, Commit hash, and Build Time
- Auto-refresh: Version updates automatically with each data refresh
- Error Handling: Shows "v?" if version cannot be fetched
Control Panels
The Settings tab provides three panels for managing backend configuration:
- Trading Config: Manage trading parameters (risk limits, slippage prevention)
- Notification Config: Configure ntfy and Telegram notifications
- Strategy Config: Manage strategy weights and parameters
Refresh Configuration
Each panel includes a Refresh button (⟳) to load current configuration from the backend:
- Auto-load: Configuration can be loaded manually by clicking Refresh
- Account-based: Configuration is loaded for the currently selected account
- Loading State: Buttons are disabled during loading to prevent conflicts
- Error Display: Load errors are shown in the panel status area
- Unsaved Changes: Confirmation dialog appears when overwriting unsaved changes
YAML Format
Each panel shows a placeholder with the expected YAML format. The account_id is automatically provided from the selected account and should not be included in the YAML input.
Account Filtering
The sidebar includes account buttons that allow filtering dashboard content:
- All Accounts Button: Shows aggregated view across all accounts (default)
- Account Buttons: Filter dashboard to show data for specific account only
- Visual Indicators: Active filter is highlighted with different button styling
- Persistent Filter: Filter applies across all dashboard tabs (balance, positions)
- Stay on Current Tab: Selecting an account doesn't switch tabs - stays on current view
Settings
The Settings tab contains configuration panels:
- API Settings: Configure backend connection (URL, credentials) via the gear icon in header
- Trading Config: Backend configuration for trading parameters
- Notification Config: Backend configuration for notifications
- Strategy Config: Backend configuration for trading strategies
Each configuration panel stretches to fill available window space and includes:
- YAML text input with syntax validation
- Refresh button to load current values from backend
- Save button to push configuration to backend
- Status indicator showing validation and save results
Building
# Build the application
make build
# Install to ~/.local/bin
make install
# Build WASM version (for web)
make build.wasm
Requirements
- Go 1.25+
- Fyne v2.7.2
- Backend: tradebotpp v0.4.0 (gRPC service)
Running
# Run from source
go run ./cmd/tradebotui/main.go
# After installation
~/.local/bin/tradebotui
Testing
# Run all tests
make test
# Run tests with coverage
go test -cover ./...
Project Structure
cmd/tradebotui/ # Application entry point
internal/
ui/ # UI orchestration
app.go # Main controller
tabs.go # Tab management
sidebar.go # Account sidebar
header.go # Header with status
settings.go # Settings tab with config panels
client/ # gRPC client
client.go # Connection management
control.go # Control API methods
domain/ # Domain models
account.go # Account model
position.go # Position model
widgets/ # Custom widgets
control.go # ControlPanel widget
cards.go # Stat cards
License
See LICENSE file for details.