Check if Little Fig UI is mobile responsive
Browse files- check_ui_responsive.py +71 -0
check_ui_responsive.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Read the Little Fig UI and check for mobile responsiveness."""
|
| 3 |
+
import subprocess, os
|
| 4 |
+
|
| 5 |
+
TOKEN = "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"
|
| 6 |
+
subprocess.run(["git", "clone", f"https://{TOKEN}@github.com/ticketguy/littlefig.git", "/app/littlefig"], check=True)
|
| 7 |
+
|
| 8 |
+
# Read the UI file
|
| 9 |
+
ui_path = "/app/littlefig/src/little_fig/web/static/index.html"
|
| 10 |
+
with open(ui_path, "r") as f:
|
| 11 |
+
html = f.read()
|
| 12 |
+
|
| 13 |
+
print(f"UI file size: {len(html)} chars")
|
| 14 |
+
print(f"\n=== MOBILE RESPONSIVENESS CHECK ===\n")
|
| 15 |
+
|
| 16 |
+
# Check for viewport meta tag
|
| 17 |
+
if 'viewport' in html:
|
| 18 |
+
print("β
Has viewport meta tag")
|
| 19 |
+
else:
|
| 20 |
+
print("β NO viewport meta tag β will NOT scale on mobile")
|
| 21 |
+
|
| 22 |
+
# Check for media queries
|
| 23 |
+
if '@media' in html:
|
| 24 |
+
count = html.count('@media')
|
| 25 |
+
print(f"β
Has {count} media queries")
|
| 26 |
+
else:
|
| 27 |
+
print("β NO media queries β won't adapt to screen size")
|
| 28 |
+
|
| 29 |
+
# Check for responsive units
|
| 30 |
+
if 'vw' in html or 'vh' in html or '%' in html:
|
| 31 |
+
print("β
Uses relative units (vw/vh/%)")
|
| 32 |
+
else:
|
| 33 |
+
print("β No relative units")
|
| 34 |
+
|
| 35 |
+
# Check for flexbox/grid
|
| 36 |
+
if 'flex' in html:
|
| 37 |
+
print(f"β
Uses flexbox ({html.count('flex')} instances)")
|
| 38 |
+
else:
|
| 39 |
+
print("β No flexbox")
|
| 40 |
+
|
| 41 |
+
if 'grid' in html:
|
| 42 |
+
print(f"β
Uses CSS grid ({html.count('grid')} instances)")
|
| 43 |
+
else:
|
| 44 |
+
print("β οΈ No CSS grid")
|
| 45 |
+
|
| 46 |
+
# Check for fixed pixel widths that would break mobile
|
| 47 |
+
import re
|
| 48 |
+
fixed_widths = re.findall(r'width:\s*\d{4,}px', html)
|
| 49 |
+
if fixed_widths:
|
| 50 |
+
print(f"β Has fixed large widths: {fixed_widths[:5]}")
|
| 51 |
+
else:
|
| 52 |
+
print("β
No large fixed pixel widths")
|
| 53 |
+
|
| 54 |
+
# Check overall structure
|
| 55 |
+
if 'max-width' in html:
|
| 56 |
+
print("β
Uses max-width constraints")
|
| 57 |
+
|
| 58 |
+
if 'overflow' in html:
|
| 59 |
+
print("β
Has overflow handling")
|
| 60 |
+
|
| 61 |
+
# Print the first 200 lines to see structure
|
| 62 |
+
print(f"\n=== FIRST 100 LINES OF UI ===\n")
|
| 63 |
+
lines = html.split('\n')
|
| 64 |
+
for line in lines[:100]:
|
| 65 |
+
print(line)
|
| 66 |
+
|
| 67 |
+
print(f"\n\n=== LAST 50 LINES ===\n")
|
| 68 |
+
for line in lines[-50:]:
|
| 69 |
+
print(line)
|
| 70 |
+
|
| 71 |
+
print(f"\n\nTotal lines: {len(lines)}")
|