mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-29 22:02:05 +00:00
fix: address PR #93 review issues
- Remove translate-x/translate-y CSS selectors that broke layout utilities (AssistantPanel slide animation, DebugLogViewer resize handle) - Add browser validation to get_playwright_browser() with warning for invalid values (matches get_playwright_headless() behavior) - Remove phantom SQLite documentation from CUSTOM_UPDATES.md that described features not present in PR #93 - Update checklist and revert instructions to match actual changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,8 +8,7 @@ This document tracks all customizations made to AutoCoder that deviate from the
|
|||||||
|
|
||||||
1. [UI Theme Customization](#1-ui-theme-customization)
|
1. [UI Theme Customization](#1-ui-theme-customization)
|
||||||
2. [Playwright Browser Configuration](#2-playwright-browser-configuration)
|
2. [Playwright Browser Configuration](#2-playwright-browser-configuration)
|
||||||
3. [SQLite Robust Connection Handling](#3-sqlite-robust-connection-handling)
|
3. [Update Checklist](#update-checklist)
|
||||||
4. [Update Checklist](#update-checklist)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -175,95 +174,7 @@ playwright_args = [
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. SQLite Robust Connection Handling
|
## 3. Update Checklist
|
||||||
|
|
||||||
### Overview
|
|
||||||
|
|
||||||
Added robust SQLite connection handling to prevent database corruption from concurrent access (MCP server, FastAPI server, progress tracking).
|
|
||||||
|
|
||||||
**Features Added:**
|
|
||||||
- WAL mode for better concurrency
|
|
||||||
- Busy timeout (30 seconds)
|
|
||||||
- Retry logic with exponential backoff
|
|
||||||
- Database health check endpoint
|
|
||||||
|
|
||||||
### Modified Files
|
|
||||||
|
|
||||||
#### `api/database.py`
|
|
||||||
|
|
||||||
**New functions added:**
|
|
||||||
|
|
||||||
```python
|
|
||||||
def get_robust_connection(db_path: str) -> sqlite3.Connection:
|
|
||||||
"""
|
|
||||||
Create a SQLite connection with robust settings:
|
|
||||||
- WAL mode for concurrent access
|
|
||||||
- 30 second busy timeout
|
|
||||||
- Foreign keys enabled
|
|
||||||
"""
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def robust_db_connection(db_path: str):
|
|
||||||
"""Context manager for robust database connections."""
|
|
||||||
|
|
||||||
def execute_with_retry(conn, sql, params=None, max_retries=3):
|
|
||||||
"""Execute SQL with exponential backoff retry for transient errors."""
|
|
||||||
|
|
||||||
def check_database_health(db_path: str) -> dict:
|
|
||||||
"""
|
|
||||||
Check database integrity and return health status.
|
|
||||||
Returns: {healthy: bool, message: str, details: dict}
|
|
||||||
"""
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### `progress.py`
|
|
||||||
|
|
||||||
**Changed from raw sqlite3 to robust connections:**
|
|
||||||
|
|
||||||
```python
|
|
||||||
# BEFORE:
|
|
||||||
conn = sqlite3.connect(db_path)
|
|
||||||
|
|
||||||
# AFTER:
|
|
||||||
from api.database import robust_db_connection, execute_with_retry
|
|
||||||
|
|
||||||
with robust_db_connection(db_path) as conn:
|
|
||||||
execute_with_retry(conn, sql, params)
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### `server/routers/projects.py`
|
|
||||||
|
|
||||||
**New endpoint added:**
|
|
||||||
|
|
||||||
```python
|
|
||||||
@router.get("/{project_name}/db-health")
|
|
||||||
async def get_database_health(project_name: str) -> DatabaseHealth:
|
|
||||||
"""
|
|
||||||
Check the health of the project's features database.
|
|
||||||
Useful for diagnosing corruption issues.
|
|
||||||
"""
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### `server/schemas.py`
|
|
||||||
|
|
||||||
**New schema added:**
|
|
||||||
|
|
||||||
```python
|
|
||||||
class DatabaseHealth(BaseModel):
|
|
||||||
healthy: bool
|
|
||||||
message: str
|
|
||||||
details: dict = {}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Update Checklist
|
|
||||||
|
|
||||||
When updating AutoCoder from upstream, verify these items:
|
When updating AutoCoder from upstream, verify these items:
|
||||||
|
|
||||||
@@ -276,13 +187,8 @@ When updating AutoCoder from upstream, verify these items:
|
|||||||
### Backend Changes
|
### Backend Changes
|
||||||
- [ ] `client.py` - Playwright browser/headless defaults preserved
|
- [ ] `client.py` - Playwright browser/headless defaults preserved
|
||||||
- [ ] `.env.example` - Documentation updates preserved
|
- [ ] `.env.example` - Documentation updates preserved
|
||||||
- [ ] `api/database.py` - Robust connection functions preserved
|
|
||||||
- [ ] `progress.py` - Uses robust_db_connection
|
|
||||||
- [ ] `server/routers/projects.py` - db-health endpoint preserved
|
|
||||||
- [ ] `server/schemas.py` - DatabaseHealth schema preserved
|
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- [ ] Test database operations under concurrent load
|
|
||||||
- [ ] Verify Playwright uses Firefox by default
|
- [ ] Verify Playwright uses Firefox by default
|
||||||
- [ ] Check that browser runs headless by default
|
- [ ] Check that browser runs headless by default
|
||||||
|
|
||||||
@@ -299,8 +205,7 @@ cd ui && npm run build
|
|||||||
|
|
||||||
### Backend Only
|
### Backend Only
|
||||||
```bash
|
```bash
|
||||||
git checkout client.py .env.example api/database.py progress.py
|
git checkout client.py .env.example
|
||||||
git checkout server/routers/projects.py server/schemas.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -311,18 +216,13 @@ git checkout server/routers/projects.py server/schemas.py
|
|||||||
|------|------|-------------------|
|
|------|------|-------------------|
|
||||||
| `ui/src/styles/custom-theme.css` | UI | Twitter-style theme |
|
| `ui/src/styles/custom-theme.css` | UI | Twitter-style theme |
|
||||||
| `ui/src/components/KanbanColumn.tsx` | UI | Themeable kanban columns |
|
| `ui/src/components/KanbanColumn.tsx` | UI | Themeable kanban columns |
|
||||||
|
| `ui/src/main.tsx` | UI | Imports custom theme |
|
||||||
| `client.py` | Backend | Firefox + headless defaults |
|
| `client.py` | Backend | Firefox + headless defaults |
|
||||||
| `.env.example` | Config | Updated documentation |
|
| `.env.example` | Config | Updated documentation |
|
||||||
| `api/database.py` | Backend | Robust SQLite connections |
|
|
||||||
| `progress.py` | Backend | Uses robust connections |
|
|
||||||
| `server/routers/projects.py` | Backend | db-health endpoint |
|
|
||||||
| `server/schemas.py` | Backend | DatabaseHealth schema |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Last Updated
|
## Last Updated
|
||||||
|
|
||||||
**Date:** January 2026
|
**Date:** January 2026
|
||||||
**Commits:**
|
**PR:** #93 - Twitter-style UI theme with custom theme override system
|
||||||
- `1910b96` - SQLite robust connection handling
|
|
||||||
- `e014b04` - Custom theme override system
|
|
||||||
|
|||||||
12
client.py
12
client.py
@@ -59,6 +59,10 @@ def get_playwright_headless() -> bool:
|
|||||||
return value in truthy
|
return value in truthy
|
||||||
|
|
||||||
|
|
||||||
|
# Valid browsers supported by Playwright MCP
|
||||||
|
VALID_PLAYWRIGHT_BROWSERS = {"chrome", "firefox", "webkit", "msedge"}
|
||||||
|
|
||||||
|
|
||||||
def get_playwright_browser() -> str:
|
def get_playwright_browser() -> str:
|
||||||
"""
|
"""
|
||||||
Get the browser to use for Playwright.
|
Get the browser to use for Playwright.
|
||||||
@@ -67,7 +71,13 @@ def get_playwright_browser() -> str:
|
|||||||
Options: chrome, firefox, webkit, msedge
|
Options: chrome, firefox, webkit, msedge
|
||||||
Firefox is recommended for lower CPU usage.
|
Firefox is recommended for lower CPU usage.
|
||||||
"""
|
"""
|
||||||
return os.getenv("PLAYWRIGHT_BROWSER", DEFAULT_PLAYWRIGHT_BROWSER).lower()
|
value = os.getenv("PLAYWRIGHT_BROWSER", DEFAULT_PLAYWRIGHT_BROWSER).strip().lower()
|
||||||
|
if value not in VALID_PLAYWRIGHT_BROWSERS:
|
||||||
|
print(f" - Warning: Invalid PLAYWRIGHT_BROWSER='{value}', "
|
||||||
|
f"valid options: {', '.join(sorted(VALID_PLAYWRIGHT_BROWSERS))}. "
|
||||||
|
f"Defaulting to {DEFAULT_PLAYWRIGHT_BROWSER}")
|
||||||
|
return DEFAULT_PLAYWRIGHT_BROWSER
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
# Feature MCP tools for feature/test management
|
# Feature MCP tools for feature/test management
|
||||||
|
|||||||
@@ -298,10 +298,9 @@ a:focus-visible,
|
|||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only disable hover transforms, not layout utilities like -translate-x-1/2 */
|
||||||
[class*="hover:translate"],
|
[class*="hover:translate"],
|
||||||
[class*="hover:-translate"],
|
[class*="hover:-translate"] {
|
||||||
[class*="translate-x"],
|
|
||||||
[class*="translate-y"] {
|
|
||||||
transform: none !important;
|
transform: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user