AIencoder commited on
Commit
878577a
·
verified ·
1 Parent(s): 7478df4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -147,8 +147,7 @@ def create_diff_view(original: str, modified: str) -> str:
147
 
148
  # --- Gradio UI Configuration ---
149
 
150
- # 1. THEME FIX: Removed invalid 'radius_size' from .set()
151
- # We use standard color overrides only.
152
  theme = gr.themes.Default(
153
  font=[gr.themes.GoogleFont('JetBrains Mono'), 'monospace'],
154
  font_mono=[gr.themes.GoogleFont('JetBrains Mono'), 'monospace'],
@@ -159,10 +158,9 @@ theme = gr.themes.Default(
159
  button_primary_background_fill_hover="*primary_600",
160
  body_background_fill="*neutral_900",
161
  body_text_color="*neutral_50",
162
- # radius_size="none" <-- REMOVED to prevent TypeError
163
  )
164
 
165
- # 2. CSS FIX: Added strict border-radius rule for the "square" look
166
  css = """
167
  /* Force square corners globally */
168
  * { border-radius: 0 !important; }
@@ -238,7 +236,8 @@ with gr.Blocks(title="Axon Pro - Free AI IDE", theme=theme, css=css) as demo:
238
  send_btn = gr.Button("Generate", variant="primary", scale=1)
239
 
240
  with gr.Tab("Diff View", id="diff-tab"):
241
- diff_view = gr.Code(label="AI Changes", language="diff", elem_classes="diff-view code-wrap", interactive=False)
 
242
  with gr.Row():
243
  apply_btn = gr.Button("Apply Changes", variant="primary")
244
  discard_btn = gr.Button("Discard Changes", variant="secondary")
@@ -338,4 +337,6 @@ with gr.Blocks(title="Axon Pro - Free AI IDE", theme=theme, css=css) as demo:
338
  )
339
 
340
  if __name__ == "__main__":
 
 
341
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
147
 
148
  # --- Gradio UI Configuration ---
149
 
150
+ # 1. THEME: Cleaned up to avoid errors
 
151
  theme = gr.themes.Default(
152
  font=[gr.themes.GoogleFont('JetBrains Mono'), 'monospace'],
153
  font_mono=[gr.themes.GoogleFont('JetBrains Mono'), 'monospace'],
 
158
  button_primary_background_fill_hover="*primary_600",
159
  body_background_fill="*neutral_900",
160
  body_text_color="*neutral_50",
 
161
  )
162
 
163
+ # 2. CSS: Styling
164
  css = """
165
  /* Force square corners globally */
166
  * { border-radius: 0 !important; }
 
236
  send_btn = gr.Button("Generate", variant="primary", scale=1)
237
 
238
  with gr.Tab("Diff View", id="diff-tab"):
239
+ # FIX: Changed language="diff" to language="javascript" to prevent crash
240
+ diff_view = gr.Code(label="AI Changes", language="javascript", elem_classes="diff-view code-wrap", interactive=False)
241
  with gr.Row():
242
  apply_btn = gr.Button("Apply Changes", variant="primary")
243
  discard_btn = gr.Button("Discard Changes", variant="secondary")
 
337
  )
338
 
339
  if __name__ == "__main__":
340
+ # If the warning about theme/css being in launch() persists, you can move them here.
341
+ # But for now, we keep them in Blocks to support older/standard versions as well.
342
  demo.launch(server_name="0.0.0.0", server_port=7860)