AI-Life-Coach-Streamlit2 / test_ui_fixes.py
rdune71's picture
Fix UI issues, restore advanced debug panel, and improve Ollama connection handling
fde6c6f
import sys
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.append(str(project_root))
def test_ui_fixes():
"""Test the UI fixes and improvements"""
print("=== UI Fixes Test ===")
print()
# Test 1: Check if app.py was updated correctly
print("1. Testing app.py structure:")
try:
with open('app.py', 'r') as f:
content = f.read()
# Check for key components
required_components = [
'st.session_state.ngrok_url_temp',
'Test Ollama Connection',
'Advanced System Monitor',
'πŸ“‘ Test Ollama Connection',
'is_sending'
]
missing_components = []
for component in required_components:
if component not in content:
missing_components.append(component)
if missing_components:
print(f" ❌ Missing components: {missing_components}")
else:
print(" βœ… All required UI components present")
except Exception as e:
print(f" ❌ Error reading app.py: {e}")
print()
# Test 2: Check Ollama provider timeout
print("2. Testing Ollama provider timeout:")
try:
with open('core/providers/ollama.py', 'r') as f:
content = f.read()
if 'timeout: int = 60' in content:
print(" βœ… Ollama timeout increased to 60 seconds")
else:
print(" ❌ Ollama timeout not updated")
except Exception as e:
print(f" ❌ Error reading Ollama provider: {e}")
print()
# Test 3: Check for debug panel restoration
print("3. Testing debug panel restoration:")
try:
with open('app.py', 'r') as f:
content = f.read()
debug_features = [
'Advanced System Monitor',
'System Controls',
'Provider Status',
'Session Statistics'
]
missing_features = []
for feature in debug_features:
if feature not in content:
missing_features.append(feature)
if missing_features:
print(f" ❌ Missing debug features: {missing_features}")
else:
print(" βœ… All debug panel features restored")
except Exception as e:
print(f" ❌ Error checking debug panel: {e}")
print()
print("πŸŽ‰ UI Fixes Test Completed!")
if __name__ == "__main__":
test_ui_fixes()