Skip to content

Commit 05038ad

Browse files
Merge feature/web-ui-phase0: Complete Phase 0 Web UI
- Backend API with system/projects/queue/services endpoints - React + TypeScript frontend with 9 routes - Dashboard with system metrics and charts - Projects management (CRUD operations) - Services management (systemd control) - Queue management (view and clear) - Settings page (GitHub token configuration) - Route-based navigation with modern UI - Dark mode support - Full documentation Closes #26
2 parents b9e3d17 + a69f6b3 commit 05038ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+10245
-0
lines changed

PHASE0_UI_SUMMARY.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Phase 0 Web UI - Completion Summary
2+
3+
## ✅ What Was Built
4+
5+
### Architecture
6+
- **Route-based navigation** - No modals, full-page forms for better UX
7+
- **React 18 + TypeScript** - Modern, type-safe React application
8+
- **TanStack Query** - Server state management with caching
9+
- **React Router** - Client-side routing with URL parameters
10+
- **Tailwind CSS** - Utility-first styling with dark mode support
11+
- **Vite** - Lightning-fast build tool with HMR
12+
13+
### Pages Implemented
14+
15+
| Page | Route | Features |
16+
|------|-------|----------|
17+
| **Dashboard** | `/` | System status cards, resource monitoring |
18+
| **Projects List** | `/projects` | View all projects, enable/disable, delete |
19+
| **Add Project** | `/projects/add` | Full-page form for creating projects |
20+
| **Edit Project** | `/projects/:id/edit` | Full-page form for editing projects |
21+
| **Services List** | `/services` | systemd services, start/stop/restart controls |
22+
| **Create Service** | `/services/add` | Full-page editor for systemd service files |
23+
| **Edit Service** | `/services/:name/edit` | Full-page editor for service configuration |
24+
| **Queue** | `/queue` | View queued tasks, task details |
25+
| **Settings** | `/settings` | GitHub token, service management |
26+
27+
### Key Features
28+
29+
**✅ Project Management**
30+
- Full CRUD operations (Create, Read, Update, Delete)
31+
- Enable/disable projects
32+
- Configure test and build commands
33+
- Multi-framework support (Godot, Python, Rust, Node.js, etc.)
34+
35+
**✅ Service Management**
36+
- List all systemd user services
37+
- Start, stop, restart services
38+
- Create new services with templates
39+
- Edit service files (full systemd configuration)
40+
- Enable/disable auto-start
41+
42+
**✅ System Monitoring**
43+
- Service status (running/stopped)
44+
- Resource usage (CPU, memory, disk)
45+
- Service uptime tracking
46+
- Live status updates (5-second polling)
47+
48+
**✅ Settings**
49+
- GitHub access token configuration
50+
- Token validation and testing
51+
- Service control from settings page
52+
53+
**✅ Modern UI/UX**
54+
- Dark mode support (system-aware)
55+
- Responsive design (mobile-friendly)
56+
- Clean, minimal interface
57+
- Proper loading states
58+
- Error handling
59+
- Smooth transitions
60+
- Bookmarkable URLs
61+
- Browser back/forward navigation
62+
63+
### Route-Based Architecture Benefits
64+
65+
**Why we chose routes over modals:**
66+
67+
1. **More space** - Full page for complex forms
68+
2. **Bookmarkable** - Can share URLs like `/projects/add`
69+
3. **Navigation** - Browser back button works naturally
70+
4. **Mobile** - Better experience on smaller screens
71+
5. **Focus** - Single task per page, less distraction
72+
73+
### Technical Implementation
74+
75+
**State Management:**
76+
- TanStack Query handles all server state
77+
- Automatic background refetching every 10 seconds
78+
- Optimistic updates for instant feedback
79+
- Cache invalidation on mutations
80+
81+
**TypeScript:**
82+
- Full type safety across the application
83+
- API response types defined
84+
- Props interfaces for all components
85+
- Type-safe route parameters
86+
87+
**API Integration:**
88+
- Centralized API client (`src/lib/api.ts`)
89+
- Custom hooks for all operations
90+
- Automatic error handling
91+
- Request/response interceptors
92+
93+
**Component Structure:**
94+
```
95+
Pages (route handlers)
96+
97+
Custom Hooks (API logic)
98+
99+
API Client (HTTP requests)
100+
101+
Backend Flask API
102+
```
103+
104+
## 📝 Documentation Updated
105+
106+
### Files Updated:
107+
1. **web/README.md** - Complete web UI documentation
108+
2. **web/frontend/README.md** - Frontend developer guide
109+
110+
### Documentation Includes:
111+
- Architecture decisions explained
112+
- Routing table with all routes
113+
- State management approach
114+
- Component structure
115+
- Development tips
116+
- Common tasks guide
117+
- TypeScript examples
118+
- API communication patterns
119+
120+
## 🎯 Phase 0 Status: COMPLETE
121+
122+
All planned Phase 0 features are implemented and tested:
123+
- ✅ Dashboard page
124+
- ✅ Projects CRUD
125+
- ✅ Services management
126+
- ✅ Settings page
127+
- ✅ Queue viewer
128+
- ✅ Route-based navigation
129+
- ✅ Modern UI design
130+
- ✅ Documentation
131+
132+
## 🚀 Next Steps (Phase 1)
133+
134+
**Planned for Phase 1:**
135+
1. Task log viewer (view Claude Code execution logs)
136+
2. Task cancellation (cancel running tasks)
137+
3. Enhanced error handling
138+
4. Toast notifications
139+
5. Loading skeletons
140+
6. Better empty states
141+
7. Search/filter functionality
142+
143+
## 📦 Commits Made
144+
145+
1. `52d4989` - Add ProjectForm modal component with React Portal
146+
2. `766f1ae` - Redesign ProjectForm with modern, minimal UI
147+
3. `9a8f859` - Convert project form from modal to separate routes
148+
4. `d2e0149` - Convert Services page from modals to route-based navigation
149+
5. `dc5acd6` - Update documentation to reflect route-based UI architecture
150+
151+
## 🔧 How to Run
152+
153+
```bash
154+
# Backend (Terminal 1)
155+
cd web/backend
156+
python3 -m venv venv
157+
source venv/bin/activate
158+
pip install -r requirements.txt
159+
python3 app.py
160+
161+
# Frontend (Terminal 2)
162+
cd web/frontend
163+
npm install
164+
npm run dev
165+
```
166+
167+
**Access at:** `http://localhost:5173`
168+
169+
## 📊 Statistics
170+
171+
- **Total Routes:** 9
172+
- **Pages:** 8 (DashboardPage, ProjectsPage, ProjectFormPage, ServicesPage, ServiceFormPage, QueuePage, SettingsPage, Layout)
173+
- **Custom Hooks:** 2 (useProjects, useSystem)
174+
- **Components:** 2 (Layout, ProjectForm)
175+
- **Lines of Code:** ~3,000+ (TypeScript + TSX)
176+
- **Dependencies:** React, React Router, TanStack Query, Tailwind, Lucide Icons, Axios
177+
178+
## ✨ Quality
179+
180+
- ✅ TypeScript strict mode enabled
181+
- ✅ No console errors
182+
- ✅ All routes working
183+
- ✅ Dark mode support
184+
- ✅ Responsive design
185+
- ✅ Clean code structure
186+
- ✅ Comprehensive documentation
187+
- ✅ Proper error handling
188+
189+
---
190+
191+
**Phase 0 Web UI is production-ready!** 🎉

scripts/agent-runner.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
set -euo pipefail
66

7+
# Ensure user local bin is in PATH for godot and other tools
8+
export PATH="$HOME/.local/bin:$PATH"
9+
710
# Colors for output
811
RED='\033[0;31m'
912
GREEN='\033[0;32m'
@@ -233,6 +236,53 @@ create_worktree() {
233236
fi
234237
}
235238

239+
# Initialize Godot project in worktree (gdUnit4 requires .godot directory)
240+
initialize_godot_worktree() {
241+
# Only run for Godot projects
242+
if [ "$PROJECT_TYPE" != "godot" ]; then
243+
log_info "[$PROJECT_ID] Not a Godot project, skipping initialization"
244+
return 0
245+
fi
246+
247+
log_info "[$PROJECT_ID] Initializing Godot project in worktree..."
248+
249+
cd "$WORKTREE_PATH" || exit 3
250+
251+
# Check if godot command is available
252+
if ! command -v godot &> /dev/null; then
253+
log_warning "[$PROJECT_ID] godot command not found, skipping initialization"
254+
return 0
255+
fi
256+
257+
# Always run godot --editor --quit to initialize the project properly
258+
# This scans all scripts and registers global classes, which is required for gdUnit4
259+
log_info "[$PROJECT_ID] Running 'godot --editor --quit --headless' to scan scripts..."
260+
261+
local godot_log="/tmp/godot-init-$$.log"
262+
if timeout 45 godot --editor --quit --headless > "$godot_log" 2>&1; then
263+
log_success "[$PROJECT_ID] Godot project initialized successfully"
264+
265+
# Verify .godot directory was created
266+
if [ -d ".godot" ]; then
267+
log_success "[$PROJECT_ID] .godot directory created"
268+
269+
# Verify critical files exist
270+
if [ -f ".godot/global_script_class_cache.cfg" ]; then
271+
log_success "[$PROJECT_ID] Plugin class cache generated"
272+
else
273+
log_warning "[$PROJECT_ID] Plugin class cache not found (tests may fail)"
274+
fi
275+
else
276+
log_warning "[$PROJECT_ID] .godot directory not created (tests may fail)"
277+
fi
278+
else
279+
log_warning "[$PROJECT_ID] Godot initialization had issues (tests may fail)"
280+
cat "$godot_log" || true
281+
fi
282+
283+
return 0
284+
}
285+
236286
# Run Claude Code
237287
run_claude() {
238288
log_info "[$PROJECT_ID] Running Claude Code on task..."
@@ -613,6 +663,9 @@ main() {
613663
log_info "Step 4/11: Creating worktree..."
614664
create_worktree
615665

666+
log_info "Step 4.5/11: Initializing Godot worktree..."
667+
initialize_godot_worktree
668+
616669
# Execute task
617670
log_info "Step 5/11: Running Claude Code..."
618671
if ! run_claude; then

0 commit comments

Comments
 (0)