Nihal2000 commited on
Commit
3427b80
Β·
1 Parent(s): d9ec965

feat: Implement Cyber-Glass UI with Bento Grid and Neon effects

Browse files
Files changed (2) hide show
  1. app.py +320 -241
  2. theme.py +8 -7
app.py CHANGED
@@ -1,5 +1,5 @@
1
  """
2
- DebugGenie - Modern Gradio 6 UI
3
  Redesigned for MCP 1st Birthday Hackathon
4
  """
5
  import os
@@ -10,336 +10,415 @@ from theme import debuggenie_theme
10
  # Check if Modal URL is configured
11
  MODAL_API_URL = os.environ.get("MODAL_API_URL")
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  def create_hero_section():
14
  """Create the hero/header section with branding."""
15
  return gr.Markdown("""
16
- # 🧞 DebugGenie
17
- ### AI-Powered Multi-Agent Debugging Assistant
18
- *Enterprise-grade error analysis powered by Claude, Gemini, and GPT-4*
19
-
20
- <div style="background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
21
- height: 4px; border-radius: 2px; margin: 20px 0;"></div>
22
- """)
 
 
 
23
 
24
  def create_main_interface():
25
- """Create the main tabbed interface."""
26
 
27
  with gr.Blocks(
28
  theme=debuggenie_theme,
29
- title="DebugGenie - AI Debugging Assistant",
30
- css="""
31
- .gradio-container {
32
- max-width: 1400px !important;
33
- }
34
- .agent-card {
35
- background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
36
- border-left: 4px solid #6366f1;
37
- padding: 16px;
38
- border-radius: 8px;
39
- margin: 8px 0;
40
- }
41
- .solution-card {
42
- border: 2px solid #475569;
43
- border-radius: 12px;
44
- padding: 20px;
45
- background: #1e293b;
46
- transition: all 0.3s ease;
47
- }
48
- .solution-card:hover {
49
- border-color: #6366f1;
50
- transform: translateY(-2px);
51
- box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
52
- }
53
- .confidence-badge {
54
- display: inline-block;
55
- padding: 6px 12px;
56
- border-radius: 20px;
57
- font-weight: bold;
58
- font-size: 14px;
59
- }
60
- .high-confidence {
61
- background: linear-gradient(90deg, #10b981 0%, #059669 100%);
62
- color: white;
63
- }
64
- .medium-confidence {
65
- background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
66
- color: white;
67
- }
68
- .low-confidence {
69
- background: linear-gradient(90deg, #6b7280 0%, #4b5563 100%);
70
- color: white;
71
- }
72
- """
73
  ) as demo:
74
 
75
- # Hero Section
76
- create_hero_section()
 
77
 
78
  # Configuration Check
79
  if not MODAL_API_URL:
80
- gr.Markdown("""
81
- ## ⚠️ Configuration Required
82
-
83
- This Space requires a `MODAL_API_URL` secret to be configured.
84
-
85
- ### Setup Instructions:
86
-
87
- 1. **Deploy Modal Backend** (if not done already):
88
- ```bash
89
- modal deploy modal_app.py
90
- ```
91
- Copy the URL from the output.
92
-
93
- 2. **Configure Secret**:
94
- - Go to Settings β†’ Repository secrets
95
- - Add a new secret:
96
- - Name: `MODAL_API_URL`
97
- - Value: Your Modal endpoint URL
98
-
99
- 3. **Restart this Space** (it will restart automatically after adding the secret)
100
-
101
- For more details, see the [DEPLOY.md](DEPLOY.md) file.
102
- """)
103
  else:
104
- # Main content - only show if configured
105
  with gr.Tabs() as tabs:
106
- # TAB 1: ANALYZE
107
- with gr.Tab("πŸ“ Analyze", id=0):
 
 
 
108
  with gr.Row():
109
- # LEFT COLUMN: Input Panel
110
- with gr.Column(scale=2):
 
111
  gr.Markdown("### πŸ“₯ Error Input")
112
 
113
  error_input = gr.Textbox(
114
  label="Error Message / Stack Trace",
115
- placeholder="Paste your error message, stack trace, or describe the bug...",
116
  lines=8,
117
- max_lines=15
 
118
  )
119
 
120
  with gr.Row():
121
  screenshot_input = gr.Image(
122
- label="πŸ“Έ Screenshot (Optional)",
123
  type="pil",
124
- height=200
125
  )
126
  files_input = gr.File(
127
- label="πŸ“ Code Files (Optional)",
128
  file_count="multiple",
129
- file_types=[".py", ".js", ".java", ".cpp", ".ts"]
130
  )
131
 
132
  with gr.Row():
133
  analyze_btn = gr.Button(
134
- "πŸ” Analyze Error",
135
  variant="primary",
136
  size="lg",
137
- scale=2
138
  )
139
  clear_btn = gr.Button(
140
- "πŸ—‘οΈ Clear",
141
  variant="secondary",
142
- size="lg",
143
- scale=1
144
  )
145
-
146
- # RIGHT COLUMN: Live Analysis Panel
147
- with gr.Column(scale=3):
148
- gr.Markdown("### πŸ€– Live Agent Collaboration")
149
 
150
  agent_status = gr.Chatbot(
151
- label="",
152
  type="messages",
153
- height=300,
154
  bubble_full_width=False,
155
- show_copy_button=True
 
156
  )
157
 
158
  status_bar = gr.Markdown(
159
- "**Status:** Ready to analyze",
160
- elem_classes=["agent-card"]
161
  )
162
-
163
- # Results Section
164
  gr.Markdown("---")
165
- gr.Markdown("## 🎯 Analysis Results")
166
 
167
  with gr.Row():
168
- root_cause_box = gr.Markdown(
169
- "Results will appear here after analysis...",
170
- elem_classes=["solution-card"]
171
- )
172
-
173
- gr.Markdown("### πŸ’‘ Recommended Solutions")
174
-
175
- with gr.Row():
176
- solution_1 = gr.Markdown(visible=False)
177
- solution_2 = gr.Markdown(visible=False)
178
- solution_3 = gr.Markdown(visible=False)
179
-
180
  with gr.Row():
181
- export_md_btn = gr.DownloadButton(
182
- "πŸ“„ Export as Markdown",
183
- visible=False,
184
- variant="secondary"
185
- )
186
- export_json_btn = gr.DownloadButton(
187
- "πŸ“Š Export as JSON",
188
- visible=False,
189
- variant="secondary"
190
- )
191
- voice_btn = gr.Button(
192
- "πŸ”Š Generate Voice Explanation",
193
- visible=False,
194
- variant="secondary"
195
- )
196
 
197
- audio_output = gr.Audio(
198
- label="AI Voice Explanation",
199
- visible=False,
200
- interactive=False
201
- )
202
-
203
- # TAB 2: REPORTS
204
- with gr.Tab("πŸ“Š Reports", id=1):
205
- gr.Markdown("### Analysis Reports")
206
- gr.Markdown("*Coming soon: Comprehensive analysis reports and statistics*")
207
-
208
- # TAB 3: HISTORY
209
- with gr.Tab("🎯 History", id=2):
210
- gr.Markdown("### Analysis History")
211
  history_df = gr.Dataframe(
212
- headers=["Timestamp", "Error Type", "Confidence", "Status"],
213
  datatype=["str", "str", "number", "str"],
214
- row_count=(5, "dynamic"),
215
- col_count=(4, "fixed"),
216
  )
217
-
218
- # TAB 4: SETTINGS
219
- with gr.Tab("βš™οΈ Settings", id=3):
220
- gr.Markdown("### Configuration")
221
-
222
  with gr.Row():
223
- model_choice = gr.Dropdown(
224
- choices=["All Agents", "Claude Only", "Gemini Only", "GPT-4 Only"],
225
- value="All Agents",
226
- label="Agent Selection"
227
- )
228
- voice_enabled = gr.Checkbox(
229
- label="Enable Voice Explanations",
230
- value=True
231
- )
232
-
233
- api_status = gr.Markdown(f"""
234
- **Modal Backend:** {'βœ… Connected' if MODAL_API_URL else '❌ Not Configured'}
235
-
236
- **Endpoint:** `{MODAL_API_URL or 'Not set'}`
237
- """)
238
-
239
- # Event Handlers
240
  def mock_analyze(error_text, screenshot, files, progress=gr.Progress()):
241
- """Mock analysis function for demo purposes."""
242
  import time
243
 
244
- # Simulate agent collaboration
245
  messages = []
246
 
247
- progress(0.1, desc="Initializing agents...")
248
- messages.append({
249
- "role": "assistant",
250
- "content": "πŸ€– **Claude:** Starting syntax analysis..."
251
- })
252
- yield messages, "**Status:** πŸ” Analyzing with Claude...", gr.update(), gr.update(), gr.update(), gr.update()
253
- time.sleep(0.5)
254
 
255
- progress(0.3, desc="Claude analyzing...")
256
- messages.append({
257
- "role": "assistant",
258
- "content": "🧠 **Gemini:** Checking imports and dependencies..."
259
- })
260
- yield messages, "**Status:** 🧠 Gemini analyzing imports...", gr.update(), gr.update(), gr.update(), gr.update()
261
- time.sleep(0.5)
262
 
263
- progress(0.5, desc="Gemini analyzing...")
264
- messages.append({
265
- "role": "assistant",
266
- "content": "πŸ’‘ **GPT-4:** Searching for similar issues and solutions..."
267
- })
268
- yield messages, "**Status:** πŸ’‘ GPT-4 finding solutions...", gr.update(), gr.update(), gr.update(), gr.update()
269
- time.sleep(0.5)
270
 
271
- progress(0.8, desc="Synthesizing results...")
 
 
 
 
272
 
273
- # Final results
274
  root_cause = """
275
- <div class="solution-card">
276
- <h3>🎯 Root Cause Identified</h3>
277
- <p>Based on multi-agent analysis, the issue is likely caused by a <strong>missing import statement</strong>
278
- or an <strong>incorrect module path</strong>.</p>
279
- <p><span class="confidence-badge high-confidence">98% Confidence</span></p>
280
- </div>
281
  """
282
 
283
  sol1 = """
284
- <div class="solution-card">
285
- <h4>βœ… Solution 1: Add Missing Import</h4>
286
- <p>Import the required module at the top of your file.</p>
287
- <pre><code>from module_name import ClassName</code></pre>
288
- <p><span class="confidence-badge high-confidence">95% Confidence</span></p>
289
- </div>
 
 
290
  """
291
 
292
  sol2 = """
293
- <div class="solution-card">
294
- <h4>πŸ’‘ Solution 2: Check Module Path</h4>
295
- <p>Verify that the module is in your Python path.</p>
296
- <p><span class="confidence-badge medium-confidence">75% Confidence</span></p>
297
- </div>
 
 
 
298
  """
299
 
300
  sol3 = """
301
- <div class="solution-card">
302
- <h4>πŸ”§ Solution 3: Install Dependencies</h4>
303
- <p>Install missing packages using pip.</p>
304
- <pre><code>pip install package-name</code></pre>
305
- <p><span class="confidence-badge low-confidence">60% Confidence</span></p>
306
- </div>
307
  """
308
 
309
- progress(1.0, desc="Analysis complete!")
 
310
 
311
  yield (
312
  messages,
313
- "**Status:** βœ… Analysis complete!",
314
  root_cause,
315
- sol1,
316
- sol2,
317
- sol3
318
  )
319
-
320
- # Wire up the analyze button
321
  analyze_btn.click(
322
  fn=mock_analyze,
323
  inputs=[error_input, screenshot_input, files_input],
324
  outputs=[agent_status, status_bar, root_cause_box, solution_1, solution_2, solution_3]
325
  )
326
 
327
- # Clear button
328
  clear_btn.click(
329
- fn=lambda: ("", None, None, [], "**Status:** Ready to analyze", "", "", "", ""),
330
- outputs=[error_input, screenshot_input, files_input, agent_status, status_bar,
331
- root_cause_box, solution_1, solution_2, solution_3]
332
  )
333
-
334
- # Footer
335
- gr.Markdown("""
336
- ---
337
- <div style="text-align: center; color: #94a3b8; font-size: 14px;">
338
- 🧞 DebugGenie v2.0 | Powered by Claude, Gemini & GPT-4 |
339
- <a href="https://github.com/nihald2000/debugging-assistant" style="color: #6366f1;">View on GitHub</a>
340
- </div>
341
- """)
342
-
343
  return demo
344
 
345
  if __name__ == "__main__":
 
1
  """
2
+ DebugGenie - Cyber-Glass UI Edition
3
  Redesigned for MCP 1st Birthday Hackathon
4
  """
5
  import os
 
10
  # Check if Modal URL is configured
11
  MODAL_API_URL = os.environ.get("MODAL_API_URL")
12
 
13
+ # --- CSS ARCHITECTURE ---
14
+ CYBER_GLASS_CSS = """
15
+ /* 🌌 Background Animation */
16
+ @keyframes gradient-animation {
17
+ 0% { background-position: 0% 50%; }
18
+ 50% { background-position: 100% 50%; }
19
+ 100% { background-position: 0% 50%; }
20
+ }
21
+
22
+ body {
23
+ background: linear-gradient(-45deg, #020617, #0f172a, #1e1b4b, #0f172a);
24
+ background-size: 400% 400%;
25
+ animation: gradient-animation 15s ease infinite;
26
+ color: #f8fafc;
27
+ }
28
+
29
+ /* πŸͺŸ Glassmorphism Base Class */
30
+ .glass-panel {
31
+ background: rgba(30, 41, 59, 0.4) !important;
32
+ backdrop-filter: blur(12px);
33
+ -webkit-backdrop-filter: blur(12px);
34
+ border: 1px solid rgba(255, 255, 255, 0.05);
35
+ box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
36
+ border-radius: 16px !important;
37
+ }
38
+
39
+ /* ⚑ Neon Accents */
40
+ .neon-border {
41
+ border: 1px solid rgba(99, 102, 241, 0.3);
42
+ box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
43
+ transition: all 0.3s ease;
44
+ }
45
+
46
+ .neon-border:hover {
47
+ border-color: #6366f1;
48
+ box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
49
+ }
50
+
51
+ /* 🍱 Bento Grid Layout Components */
52
+
53
+ /* Header */
54
+ .header-glass {
55
+ background: rgba(15, 23, 42, 0.6);
56
+ backdrop-filter: blur(10px);
57
+ border-bottom: 1px solid rgba(99, 102, 241, 0.2);
58
+ padding: 20px;
59
+ margin-bottom: 20px;
60
+ border-radius: 0 0 20px 20px;
61
+ }
62
+
63
+ /* Agent Command Deck (Right Panel) */
64
+ .agent-deck {
65
+ background: rgba(15, 23, 42, 0.5) !important;
66
+ border-left: 2px solid #6366f1;
67
+ }
68
+
69
+ /* Solution Cards */
70
+ .solution-card-glass {
71
+ background: rgba(30, 41, 59, 0.4);
72
+ backdrop-filter: blur(8px);
73
+ border: 1px solid rgba(255, 255, 255, 0.05);
74
+ border-radius: 12px;
75
+ padding: 20px;
76
+ transition: all 0.3s ease;
77
+ height: 100%;
78
+ }
79
+
80
+ .solution-card-glass:hover {
81
+ transform: translateY(-5px);
82
+ background: rgba(30, 41, 59, 0.6);
83
+ border-color: #8b5cf6;
84
+ box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
85
+ }
86
+
87
+ /* Confidence Badges */
88
+ .badge-high {
89
+ background: linear-gradient(135deg, #059669 0%, #10b981 100%);
90
+ color: white;
91
+ padding: 4px 12px;
92
+ border-radius: 20px;
93
+ font-weight: 600;
94
+ box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
95
+ }
96
+
97
+ .badge-med {
98
+ background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
99
+ color: white;
100
+ padding: 4px 12px;
101
+ border-radius: 20px;
102
+ font-weight: 600;
103
+ }
104
+
105
+ .badge-low {
106
+ background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
107
+ color: white;
108
+ padding: 4px 12px;
109
+ border-radius: 20px;
110
+ font-weight: 600;
111
+ }
112
+
113
+ /* Custom Scrollbar */
114
+ ::-webkit-scrollbar {
115
+ width: 8px;
116
+ height: 8px;
117
+ }
118
+
119
+ ::-webkit-scrollbar-track {
120
+ background: rgba(15, 23, 42, 0.5);
121
+ }
122
+
123
+ ::-webkit-scrollbar-thumb {
124
+ background: #475569;
125
+ border-radius: 4px;
126
+ }
127
+
128
+ ::-webkit-scrollbar-thumb:hover {
129
+ background: #6366f1;
130
+ }
131
+
132
+ /* Typewriter Effect for Logs */
133
+ .typewriter {
134
+ font-family: 'JetBrains Mono', monospace;
135
+ overflow: hidden;
136
+ white-space: nowrap;
137
+ border-right: 2px solid #6366f1;
138
+ animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
139
+ }
140
+
141
+ /* Pulse Animation for Active Agents */
142
+ @keyframes pulse-glow {
143
+ 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
144
+ 70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
145
+ 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
146
+ }
147
+
148
+ .agent-active {
149
+ animation: pulse-glow 2s infinite;
150
+ border-color: #6366f1 !important;
151
+ }
152
+ """
153
+
154
  def create_hero_section():
155
  """Create the hero/header section with branding."""
156
  return gr.Markdown("""
157
+ <div style="text-align: center; margin-bottom: 20px;">
158
+ <h1 style="font-size: 3.5rem; background: linear-gradient(to right, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0;">
159
+ 🧞 DebugGenie
160
+ </h1>
161
+ <p style="font-size: 1.2rem; color: #94a3b8; margin-top: 10px;">
162
+ <span style="border: 1px solid #6366f1; padding: 4px 12px; border-radius: 20px; color: #818cf8; font-size: 0.9rem;">v2.0</span>
163
+ &nbsp; AI-Powered Multi-Agent Debugging Assistant
164
+ </p>
165
+ </div>
166
+ """)
167
 
168
  def create_main_interface():
169
+ """Create the main interface with Bento Grid layout."""
170
 
171
  with gr.Blocks(
172
  theme=debuggenie_theme,
173
+ title="DebugGenie - Cyber-Glass Edition",
174
+ css=CYBER_GLASS_CSS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  ) as demo:
176
 
177
+ # 1. Header Section (Glass)
178
+ with gr.Row(elem_classes=["header-glass"]):
179
+ create_hero_section()
180
 
181
  # Configuration Check
182
  if not MODAL_API_URL:
183
+ with gr.Row():
184
+ with gr.Column(elem_classes=["glass-panel", "neon-border"]):
185
+ gr.Markdown("""
186
+ ## ⚠️ Configuration Required
187
+
188
+ This Space requires a `MODAL_API_URL` secret to be configured.
189
+
190
+ ### Setup Instructions:
191
+
192
+ 1. **Deploy Modal Backend** (if not done already):
193
+ ```bash
194
+ modal deploy modal_app.py
195
+ ```
196
+ Copy the URL from the output.
197
+
198
+ 2. **Configure Secret**:
199
+ - Go to Settings β†’ Repository secrets
200
+ - Add a new secret:
201
+ - Name: `MODAL_API_URL`
202
+ - Value: Your Modal endpoint URL
203
+
204
+ 3. **Restart this Space** (it will restart automatically after adding the secret)
205
+ """)
206
  else:
207
+ # Main Bento Grid Layout
208
  with gr.Tabs() as tabs:
209
+
210
+ # TAB 1: COMMAND CENTER (Main Analysis)
211
+ with gr.Tab("πŸš€ Command Center", id=0):
212
+
213
+ # Top Row: Input & Live Feed
214
  with gr.Row():
215
+
216
+ # LEFT: Input Control Panel (Glass)
217
+ with gr.Column(scale=2, elem_classes=["glass-panel"]):
218
  gr.Markdown("### πŸ“₯ Error Input")
219
 
220
  error_input = gr.Textbox(
221
  label="Error Message / Stack Trace",
222
+ placeholder="Paste your error message here...",
223
  lines=8,
224
+ max_lines=15,
225
+ elem_id="error-input"
226
  )
227
 
228
  with gr.Row():
229
  screenshot_input = gr.Image(
230
+ label="πŸ“Έ Screenshot",
231
  type="pil",
232
+ height=150
233
  )
234
  files_input = gr.File(
235
+ label="πŸ“ Context Files",
236
  file_count="multiple",
237
+ height=150
238
  )
239
 
240
  with gr.Row():
241
  analyze_btn = gr.Button(
242
+ "⚑ Initialize Analysis",
243
  variant="primary",
244
  size="lg",
245
+ elem_classes=["neon-border"]
246
  )
247
  clear_btn = gr.Button(
248
+ "πŸ—‘οΈ Reset System",
249
  variant="secondary",
250
+ size="lg"
 
251
  )
252
+
253
+ # RIGHT: Agent Command Deck (Glass)
254
+ with gr.Column(scale=3, elem_classes=["glass-panel", "agent-deck"]):
255
+ gr.Markdown("### πŸ€– Agent Neural Link")
256
 
257
  agent_status = gr.Chatbot(
258
+ label="Live Agent Communication",
259
  type="messages",
260
+ height=450,
261
  bubble_full_width=False,
262
+ show_copy_button=True,
263
+ avatar_images=(None, "https://api.iconify.design/fluent-emoji:robot.svg")
264
  )
265
 
266
  status_bar = gr.Markdown(
267
+ "**System Status:** 🟒 Ready for input",
268
+ elem_classes=["glass-panel"]
269
  )
270
+
271
+ # Bottom Row: Solution Matrix
272
  gr.Markdown("---")
273
+ gr.Markdown("## 🧩 Solution Matrix")
274
 
275
  with gr.Row():
276
+ # Root Cause Card
277
+ with gr.Column(scale=1):
278
+ root_cause_box = gr.Markdown(
279
+ """
280
+ <div style="text-align: center; padding: 40px; color: #64748b;">
281
+ Waiting for analysis data...
282
+ </div>
283
+ """,
284
+ elem_classes=["solution-card-glass", "neon-border"]
285
+ )
286
+
287
+ # Solution Cards
288
  with gr.Row():
289
+ solution_1 = gr.Markdown(visible=False, elem_classes=["solution-card-glass"])
290
+ solution_2 = gr.Markdown(visible=False, elem_classes=["solution-card-glass"])
291
+ solution_3 = gr.Markdown(visible=False, elem_classes=["solution-card-glass"])
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
+ # Action Bar
294
+ with gr.Row(elem_classes=["glass-panel"], style="margin-top: 20px; padding: 10px;"):
295
+ export_md_btn = gr.DownloadButton("πŸ“„ Export Report", visible=False)
296
+ export_json_btn = gr.DownloadButton("πŸ“Š Export Data", visible=False)
297
+ voice_btn = gr.Button("πŸ”Š Voice Briefing", visible=False)
298
+ audio_output = gr.Audio(label="Voice Output", visible=False, interactive=False)
299
+
300
+ # TAB 2: DATA VAULT (History)
301
+ with gr.Tab("πŸ’Ύ Data Vault", id=1):
302
+ gr.Markdown("### πŸ“œ Analysis Logs")
 
 
 
 
303
  history_df = gr.Dataframe(
304
+ headers=["Timestamp", "Error Signature", "Confidence", "Status"],
305
  datatype=["str", "str", "number", "str"],
306
+ interactive=False,
307
+ elem_classes=["glass-panel"]
308
  )
309
+
310
+ # TAB 3: SYSTEM CONFIG
311
+ with gr.Tab("βš™οΈ System Config", id=2):
 
 
312
  with gr.Row():
313
+ with gr.Column(elem_classes=["glass-panel"]):
314
+ gr.Markdown("### πŸ”§ Agent Configuration")
315
+ model_choice = gr.Dropdown(
316
+ choices=["All Agents (Swarm Mode)", "Claude Only", "Gemini Only", "GPT-4 Only"],
317
+ value="All Agents (Swarm Mode)",
318
+ label="Active Neural Network"
319
+ )
320
+ voice_enabled = gr.Checkbox(
321
+ label="Enable Vocal Synthesis",
322
+ value=True
323
+ )
324
+
325
+ gr.Markdown(f"""
326
+ **Backend Uplink:** `{MODAL_API_URL or 'Disconnected πŸ”΄'}`
327
+ """)
328
+
329
+ # Event Handlers (Mock Logic for UI Demo)
330
  def mock_analyze(error_text, screenshot, files, progress=gr.Progress()):
 
331
  import time
332
 
 
333
  messages = []
334
 
335
+ # Step 1: Initialization
336
+ progress(0.1, desc="Establishing neural link...")
337
+ messages.append({"role": "assistant", "content": "πŸ”„ **System:** Initializing multi-agent swarm..."})
338
+ yield messages, "**Status:** 🟑 Initializing...", gr.update(), gr.update(), gr.update(), gr.update()
339
+ time.sleep(0.8)
 
 
340
 
341
+ # Step 2: Claude Analysis
342
+ progress(0.3, desc="Claude analyzing syntax...")
343
+ messages.append({"role": "assistant", "content": "πŸ€– **Claude:** Scanning code structure and syntax trees..."})
344
+ yield messages, "**Status:** πŸ”΅ Claude Analyzing...", gr.update(), gr.update(), gr.update(), gr.update()
345
+ time.sleep(1.0)
 
 
346
 
347
+ # Step 3: Gemini Analysis
348
+ progress(0.5, desc="Gemini checking context...")
349
+ messages.append({"role": "assistant", "content": "🧠 **Gemini:** Cross-referencing with documentation and known issues..."})
350
+ yield messages, "**Status:** 🟣 Gemini Processing...", gr.update(), gr.update(), gr.update(), gr.update()
351
+ time.sleep(1.0)
 
 
352
 
353
+ # Step 4: GPT-4 Synthesis
354
+ progress(0.8, desc="GPT-4 synthesizing solutions...")
355
+ messages.append({"role": "assistant", "content": "πŸ’‘ **GPT-4:** Synthesizing findings and generating optimal solutions..."})
356
+ yield messages, "**Status:** 🟒 Synthesizing...", gr.update(), gr.update(), gr.update(), gr.update()
357
+ time.sleep(1.0)
358
 
359
+ # Final Results
360
  root_cause = """
361
+ ### 🎯 Root Cause Identified
362
+ **ImportError: Module not found**
363
+
364
+ The system detected a missing dependency in the environment configuration. The module `gradio` is attempting to access a resource that is not installed.
365
+
366
+ <span class="badge-high">98% Confidence</span>
367
  """
368
 
369
  sol1 = """
370
+ #### βœ… Optimal Solution
371
+ **Install Missing Package**
372
+
373
+ Run the following command:
374
+ ```bash
375
+ pip install gradio[mcp]
376
+ ```
377
+ <span class="badge-high">98% Success Rate</span>
378
  """
379
 
380
  sol2 = """
381
+ #### πŸ”„ Alternative
382
+ **Check Virtual Environment**
383
+
384
+ Ensure you are active in the correct venv:
385
+ ```bash
386
+ source venv/bin/activate
387
+ ```
388
+ <span class="badge-med">75% Probability</span>
389
  """
390
 
391
  sol3 = """
392
+ #### πŸ”§ Patch
393
+ **Manual Path Add**
394
+
395
+ Add the library path manually to `sys.path`.
396
+ <span class="badge-low">40% Recommended</span>
 
397
  """
398
 
399
+ progress(1.0, desc="Analysis Complete")
400
+ messages.append({"role": "assistant", "content": "βœ… **System:** Analysis complete. Solutions generated."})
401
 
402
  yield (
403
  messages,
404
+ "**Status:** 🟒 Ready",
405
  root_cause,
406
+ gr.update(value=sol1, visible=True),
407
+ gr.update(value=sol2, visible=True),
408
+ gr.update(value=sol3, visible=True)
409
  )
410
+
 
411
  analyze_btn.click(
412
  fn=mock_analyze,
413
  inputs=[error_input, screenshot_input, files_input],
414
  outputs=[agent_status, status_bar, root_cause_box, solution_1, solution_2, solution_3]
415
  )
416
 
 
417
  clear_btn.click(
418
+ fn=lambda: ("", None, None, [], "**Status:** 🟒 Ready", "", gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)),
419
+ outputs=[error_input, screenshot_input, files_input, agent_status, status_bar, root_cause_box, solution_1, solution_2, solution_3]
 
420
  )
421
+
 
 
 
 
 
 
 
 
 
422
  return demo
423
 
424
  if __name__ == "__main__":
theme.py CHANGED
@@ -1,12 +1,13 @@
1
  """
2
  DebugGenie Custom Theme for Gradio 6
3
- Professional dark theme optimized for developer tools
4
  """
5
  import gradio as gr
6
 
7
  def create_debuggenie_theme():
8
  """Create the custom DebugGenie theme with professional dark mode."""
9
 
 
10
  theme = gr.themes.Soft(
11
  primary_hue="indigo",
12
  secondary_hue="purple",
@@ -30,16 +31,16 @@ def create_debuggenie_theme():
30
  body_text_color="#f1f5f9",
31
  body_text_color_subdued="#cbd5e1",
32
 
33
- # Backgrounds
34
- body_background_fill="*neutral_950",
35
- block_background_fill="*neutral_900",
36
 
37
  # Borders
38
- border_color_primary="*neutral_700",
39
 
40
  # Shadows for depth
41
- shadow_drop="0 10px 15px -3px rgba(0, 0, 0, 0.3)",
42
- shadow_drop_lg="0 20px 25px -5px rgba(0, 0, 0, 0.4)",
43
  )
44
 
45
  return theme
 
1
  """
2
  DebugGenie Custom Theme for Gradio 6
3
+ Professional dark theme optimized for developer tools with Cyber-Glass aesthetics
4
  """
5
  import gradio as gr
6
 
7
  def create_debuggenie_theme():
8
  """Create the custom DebugGenie theme with professional dark mode."""
9
 
10
+ # Base theme - using Slate as neutral for that deep code-editor feel
11
  theme = gr.themes.Soft(
12
  primary_hue="indigo",
13
  secondary_hue="purple",
 
31
  body_text_color="#f1f5f9",
32
  body_text_color_subdued="#cbd5e1",
33
 
34
+ # Backgrounds - Deep dark for contrast with glass elements
35
+ body_background_fill="#020617", # Slate 950
36
+ block_background_fill="#0f172a", # Slate 900
37
 
38
  # Borders
39
+ border_color_primary="#334155", # Slate 700
40
 
41
  # Shadows for depth
42
+ shadow_drop="0 10px 15px -3px rgba(0, 0, 0, 0.5)",
43
+ shadow_drop_lg="0 20px 25px -5px rgba(0, 0, 0, 0.6)",
44
  )
45
 
46
  return theme