Complete UI rebuild: remove broken Gradio overrides, match reference layout
Browse files238 unmodified lines2392402412422432442452462472482492502 unmodified lines253254255256257258259260261262263264265266267268238 unmodified linesbody_html = extract_body(custom_html_content)# Remove the external CSS/JS link tags from the body HTML since Gradio handles them# Remove <link rel="stylesheet" href="/static/style.css...">body_html = re.sub(r'<link[^>]*href=["\']\/static\/style\.css[^>]*>', '', body_html)# Remove <script ... src="/static/app.js..."></script>body_html = re.sub(r'<script[^>]*src=["\']\/static\/app\.js[^>]*>[^<]*<\/script>', '', body_html)# Inject the JS inline at the end of the bodyinject_script = f"""<script type="module">2 unmodified lines</script>"""# Wrap everything in our custom-app-root div for CSS targetingfull_injected_html = f'<div id="custom-app-root">{body_html}{inject_script}</div>'# ββ Create the Gradio Blocks app ββββββββββββββββββββββββββββββββββββββββwith gr.Blocks(title="DeepSeek V4 Flash",css=custom_css,head="""<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap" rel="stylesheet">238 unmodified lines2392402412422432442 unmodified lines247248249250251252253254255256257258259260261262263264265266267268238 unmodified linesbody_html = extract_body(custom_html_content)# Inject the JS inline at the end of the bodyinject_script = f"""<script type="module">2 unmodified lines</script>"""full_injected_html = body_html + inject_script# Minimal Gradio overrides to make the HTML component full viewportgradio_overrides = """/* Make Gradio container fill the viewport */.gradio-container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }.gr-app, .main, .wrap { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }html, body { overflow: hidden !important; }"""# ββ Create the Gradio Blocks app ββββββββββββββββββββββββββββββββββββββββwith gr.Blocks(title="DeepSeek V4 Flash",css=gradio_overrides + custom_css,head="""<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap" rel="stylesheet">
app.py+11-11