sekpona kokou commited on
Commit
2aa47aa
·
1 Parent(s): ae515c2

add changes

Browse files
.claude/settings.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git push *)",
5
+ "Bash(git reset *)",
6
+ "Bash(git commit -m ' *)",
7
+ "Bash(ls /Users/sekponakokou/Documents/folder/data-analyst-mcp/*.css)",
8
+ "Bash(./venv/bin/pip show *)",
9
+ "Bash(git add *)",
10
+ "Bash(git commit -m 'fix: lock layout to viewport height in HF Spaces *)"
11
+ ]
12
+ }
13
+ }
__pycache__/prompt.cpython-311.pyc ADDED
Binary file (1.35 kB). View file
 
__pycache__/templates.cpython-311.pyc ADDED
Binary file (5.63 kB). View file
 
__pycache__/tools.cpython-311.pyc ADDED
Binary file (4.51 kB). View file
 
charts/chart_Repartition_of_Questions_by_Percentage.png ADDED
style.css CHANGED
@@ -1,198 +1,494 @@
1
- html, body {
2
- height: 100vh !important; max-height: 100vh !important;
3
- margin: 0 !important; padding: 0 !important; overflow: hidden !important;
4
- }
5
- /* Cible tous les wrappers intermédiaires Gradio */
6
- .gradio-container,
7
- .gradio-container > *,
8
- .gradio-container > .main,
9
- .gradio-container > .main > .wrap,
10
- .gradio-container > .main > .wrap > *,
11
- .app, .app > *, svelte-scoped, #svelte {
12
- height: 100vh !important; max-height: 100vh !important;
13
- overflow: hidden !important; margin: 0 !important; padding: 0 !important;
14
- }
15
- .gradio-container { max-width: 100% !important; }
16
- .gradio-container > .main > .wrap { gap: 0 !important; }
17
- footer { display: none !important; }
18
-
19
- /* ── sidebar style ── */
 
 
 
 
 
 
20
  #sidebar {
21
- position: fixed; left:0; top:0; bottom:0; width:260px;
22
- background:#171717; display:flex; flex-direction:column;
23
- padding:8px; box-sizing:border-box; z-index:200;
 
 
 
 
 
 
 
 
 
24
  }
 
25
  .sb-top {
26
- display:flex; align-items:center; justify-content:space-between;
27
- padding:6px 6px 4px 6px; margin-bottom:4px;
 
 
28
  }
29
- .sb-logo { color:#fff; font-size:0.95rem; font-weight:600; display:flex; align-items:center; gap:8px; }
30
- .sb-logo svg { width:18px; height:18px; fill:#fff; flex-shrink:0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  .sb-icon-btn {
32
- width:36px; height:36px; border-radius:8px; background:transparent;
33
- border:none; color:#8e8ea0; cursor:pointer;
34
- display:flex; align-items:center; justify-content:center; font-size:1rem;
 
 
 
35
  }
36
- .sb-icon-btn:hover { background:#2a2a2a; color:#fff; }
 
 
 
 
 
 
37
  .sb-new-chat {
38
- display:flex; align-items:center; gap:10px;
39
- padding:10px 10px; border-radius:10px; cursor:pointer;
40
- color:#ececf1; font-size:0.88rem; margin-bottom:8px;
41
- border:none; background:transparent; width:100%; text-align:left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
- .sb-new-chat:hover { background:#2a2a2a; }
44
- .sb-new-chat svg { width:16px; height:16px; stroke:#ececf1; flex-shrink:0; }
45
  .sb-section-label {
46
- color:#8e8ea0; font-size:0.7rem; font-weight:600;
47
- letter-spacing:.06em; padding:8px 10px 4px 10px;
 
 
 
48
  }
 
49
  .sb-item {
50
- padding:8px 10px; border-radius:8px; cursor:pointer;
51
- color:#ececf1; font-size:0.83rem; white-space:nowrap;
52
- overflow:hidden; text-overflow:ellipsis;
53
- }
54
- .sb-item:hover { background:#2a2a2a; }
55
- .sb-spacer { flex:1; }
56
- .sb-divider { border:none; border-top:1px solid #2a2a2a; margin:6px 0; }
57
- .sb-bottom { padding:4px 0; }
58
- .sb-user {
59
- display:flex; align-items:center; gap:10px;
60
- padding:10px; border-radius:10px; cursor:pointer;
61
- }
62
- .sb-user:hover { background:#2a2a2a; }
63
- .sb-avatar {
64
- width:32px; height:32px; border-radius:50%;
65
- background:#FF9D00; display:flex; align-items:center;
66
- justify-content:center; color:#fff; font-size:0.8rem; font-weight:700; flex-shrink:0;
67
- }
68
- .sb-username { color:#ececf1; font-size:0.85rem; font-weight:500; }
69
- .sb-dots { margin-left:auto; color:#8e8ea0; font-size:1rem; }
70
-
71
- /* ── main area ── */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  #main-col {
73
- display:flex; flex-direction:column;
74
- height:100vh; max-height:100vh; overflow:hidden;
75
- background:#212121 !important; padding:0 !important;
76
- margin-left:260px; width:calc(100vw - 260px) !important;
 
 
 
 
 
 
 
77
  }
78
 
79
- /* ── welcome screen ── */
80
  #welcome {
81
- flex:1; min-height:0; display:flex; flex-direction:column;
82
- align-items:center; justify-content:center; gap:20px;
83
- padding-bottom:120px; overflow:hidden; background:#212121;
84
- }
85
- #welcome-logo { font-size:3rem; }
86
- #welcome-title { font-size:1.5rem; font-weight:700; color:#fff; margin:0; }
87
- #welcome-sub { font-size:0.88rem; color:#666; margin:0; }
88
- #pills-row { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; max-width:620px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  .pill {
90
- background:#2f2f2f; border:1px solid #3a3a3a; border-radius:20px;
91
- padding:6px 14px; font-size:0.8rem; color:#bbb; cursor:pointer;
92
- transition: background .15s;
 
 
 
 
 
 
 
 
 
93
  }
94
- .pill:hover { background:#3a3a3a; border-color:#555; color:#fff; }
95
 
96
- /* ── chatbot ── */
97
  #chatbot {
98
- flex:1; min-height:0; overflow-y:auto;
99
- border:none !important; border-radius:0 !important;
100
- box-shadow:none !important; background:#212121 !important;
101
- padding-bottom:160px !important;
102
- }
103
- #chatbot > div { max-width:760px; margin:0 auto; padding:16px 8px; background:#212121 !important; }
104
- #chatbot .bubble-wrap { background:#212121 !important; }
105
- #chatbot [data-testid="bot"] .prose { color:#e0e0e0 !important; }
106
- #chatbot [data-testid="user"] .prose { color:#fff !important; }
107
- #chatbot img { border-radius:10px; max-width:100%; margin-top:8px; }
108
-
109
- /* ── reasoning steps ── */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  #steps-box {
111
- max-width:760px; margin:0 auto 8px auto; width:100%;
112
- background:transparent !important; border:none !important; padding:0 !important;
 
 
 
 
113
  }
 
114
  .steps-toggle {
115
- background:none; border:none; color:#444; font-size:0.7rem;
116
- cursor:pointer; padding:2px 0 2px 2px;
117
- display:flex; align-items:center; gap:4px; line-height:1;
 
 
 
 
 
 
118
  }
119
- .steps-toggle:hover { color:#888; }
 
 
 
 
120
  .steps-content {
121
- display:none; margin-top:6px; padding:10px 12px;
122
- background:#161616; border-radius:7px; border:1px solid #252525;
123
- font-size:0.78rem; color:#aaa; overflow-x:auto;
 
 
 
 
 
124
  }
 
125
  .steps-content pre {
126
- background:#1e1e1e; padding:6px 8px; border-radius:5px;
127
- font-size:0.72rem; color:#ccc; overflow-x:auto;
 
 
 
 
 
128
  }
 
129
  .step-tool {
130
- font-family:monospace; background:#2a2a2a; padding:1px 5px;
131
- border-radius:4px; font-size:0.72rem; color:#FF9D00;
 
 
 
 
 
 
132
  }
133
 
134
- /* ── input bar (fixed bottom) ── */
135
  #input-bar {
136
- position:fixed !important;
137
- bottom:0; left:260px; right:0;
138
- background:linear-gradient(to top, #212121 70%, transparent);
139
- padding:20px calc(50% - 390px + 130px) 12px;
140
- z-index:100;
 
 
141
  }
 
142
  #input-container {
143
- display:flex; flex-direction:column;
144
- background:#2f2f2f; border:1px solid #424242;
145
- border-radius:16px; overflow:hidden;
146
- transition:border-color .2s;
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
- #input-container:focus-within { border-color:#666; }
149
- #input-container #msg-box { flex:1; background:transparent; border:none !important; box-shadow:none !important; }
150
  #input-container #msg-box textarea {
151
- background:transparent !important; border:none !important;
152
- box-shadow:none !important; outline:none !important;
153
- color:#ececf1 !important; font-size:0.93rem !important;
154
- padding:12px 16px 4px 16px !important; resize:none !important;
155
- min-height:44px !important;
 
 
 
 
 
 
 
 
 
 
156
  }
157
- #input-container #msg-box textarea::placeholder { color:#555 !important; }
158
  #input-bottom {
159
- display:flex; align-items:center; justify-content:space-between;
160
- padding:4px 10px 8px 10px;
 
 
 
 
 
 
 
 
 
161
  }
162
- .input-left { display:flex; align-items:center; gap:8px; }
163
  .add-btn {
164
- width:28px; height:28px; border-radius:50%;
165
- background:#3a3a3a; border:1px solid #4a4a4a;
166
- color:#888; font-size:1rem; cursor:pointer;
167
- display:flex; align-items:center; justify-content:center;
 
 
 
 
 
 
 
 
168
  }
169
- .add-btn:hover { background:#444; color:#ccc; }
170
  .mcp-pill {
171
- display:flex; align-items:center; gap:5px;
172
- background:#3a3a3a; border:1px solid #4a4a4a;
173
- border-radius:20px; padding:3px 10px;
174
- font-size:0.74rem; color:#aaa; cursor:pointer;
175
- }
176
- .mcp-pill:hover { background:#444; }
177
- .mcp-dot { width:7px; height:7px; border-radius:50%; background:#FF9D00; }
178
- .input-right { display:flex; align-items:center; gap:6px; }
179
- .mic-btn {
180
- width:32px; height:32px; border-radius:50%;
181
- background:transparent; border:none;
182
- color:#555; font-size:1rem; cursor:pointer;
183
- display:flex; align-items:center; justify-content:center;
184
- }
185
- .mic-btn:hover { color:#888; }
186
- #send-btn { display:none !important; }
 
 
 
 
 
 
187
  .send-visual-btn {
188
- width:32px; height:32px; border-radius:50%;
189
- background:#FF9D00; border:none;
190
- color:#fff; font-size:1rem; font-weight:700;
191
- cursor:pointer; display:flex; align-items:center; justify-content:center;
192
- transition:background .15s;
 
 
 
 
 
 
 
 
 
193
  }
194
- .send-visual-btn:hover { background:#e68c00; }
195
  #input-note {
196
- text-align:center; font-size:0.68rem; color:#3a3a3a;
197
- padding:4px 0 8px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
 
1
+ :root {
2
+ --bg: #0f1117;
3
+ --panel: #151926;
4
+ --panel-2: #1c2130;
5
+ --line: #2a3144;
6
+ --text: #e8edf8;
7
+ --muted: #9ca6bd;
8
+ --accent: #fbbf24;
9
+ --accent-strong: #f59e0b;
10
+ }
11
+
12
+ html,
13
+ body {
14
+ margin: 0 !important;
15
+ padding: 0 !important;
16
+ overflow: hidden !important;
17
+ height: 100% !important;
18
+ background: var(--bg);
19
+ color: var(--text);
20
+ }
21
+
22
+ footer {
23
+ display: none !important;
24
+ }
25
+
26
  #sidebar {
27
+ position: fixed;
28
+ left: 0;
29
+ top: 0;
30
+ bottom: 0;
31
+ width: 272px;
32
+ background: linear-gradient(180deg, #101420 0%, #0f1117 100%);
33
+ border-right: 1px solid var(--line);
34
+ display: flex;
35
+ flex-direction: column;
36
+ padding: 10px;
37
+ box-sizing: border-box;
38
+ z-index: 200;
39
  }
40
+
41
  .sb-top {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: 8px;
45
+ margin-bottom: 12px;
46
  }
47
+
48
+ .sb-logo {
49
+ font-size: 0.9rem;
50
+ font-weight: 650;
51
+ color: #dce4f7;
52
+ }
53
+
54
+ .sb-icon-btn,
55
+ .sb-new-chat,
56
+ .sb-item,
57
+ .sb-bottom-item {
58
+ border: 1px solid transparent;
59
+ background: transparent;
60
+ color: var(--muted);
61
+ cursor: pointer;
62
+ transition: all 0.15s ease;
63
+ }
64
+
65
  .sb-icon-btn {
66
+ width: 34px;
67
+ height: 34px;
68
+ border-radius: 9px;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
  }
73
+
74
+ .sb-icon-btn:hover {
75
+ color: var(--text);
76
+ background: var(--panel-2);
77
+ border-color: var(--line);
78
+ }
79
+
80
  .sb-new-chat {
81
+ width: 100%;
82
+ display: flex;
83
+ align-items: center;
84
+ gap: 8px;
85
+ padding: 10px;
86
+ border-radius: 10px;
87
+ font-size: 0.85rem;
88
+ margin-bottom: 8px;
89
+ text-align: left;
90
+ }
91
+
92
+ .sb-new-chat svg {
93
+ width: 16px;
94
+ height: 16px;
95
+ }
96
+
97
+ .sb-new-chat:hover {
98
+ color: var(--text);
99
+ background: var(--panel-2);
100
+ border-color: var(--line);
101
  }
102
+
 
103
  .sb-section-label {
104
+ color: #7f8aa5;
105
+ font-size: 0.72rem;
106
+ text-transform: uppercase;
107
+ letter-spacing: 0.06em;
108
+ margin: 8px 8px 4px;
109
  }
110
+
111
  .sb-item {
112
+ width: 100%;
113
+ text-align: left;
114
+ padding: 9px 10px;
115
+ border-radius: 9px;
116
+ font-size: 0.83rem;
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ white-space: nowrap;
120
+ }
121
+
122
+ .sb-item:hover,
123
+ .sb-item.is-active {
124
+ color: var(--text);
125
+ background: var(--panel-2);
126
+ border-color: var(--line);
127
+ }
128
+
129
+ .sb-spacer {
130
+ flex: 1;
131
+ }
132
+
133
+ .sb-bottom {
134
+ display: grid;
135
+ gap: 6px;
136
+ }
137
+
138
+ .sb-bottom-item {
139
+ width: 100%;
140
+ text-align: left;
141
+ padding: 9px 10px;
142
+ border-radius: 9px;
143
+ font-size: 0.8rem;
144
+ }
145
+
146
+ .sb-bottom-item:hover {
147
+ color: var(--text);
148
+ background: var(--panel-2);
149
+ border-color: var(--line);
150
+ }
151
+
152
  #main-col {
153
+ position: fixed !important;
154
+ top: 0;
155
+ bottom: 0;
156
+ left: 272px;
157
+ right: 0;
158
+ display: flex;
159
+ flex-direction: column;
160
+ background: radial-gradient(circle at 20% 0%, #151a2b 0%, #0f1117 45%);
161
+ overflow: hidden;
162
+ padding: 0 !important;
163
+ margin: 0 !important;
164
  }
165
 
 
166
  #welcome {
167
+ flex: 1;
168
+ min-height: 0;
169
+ display: flex;
170
+ flex-direction: column;
171
+ align-items: center;
172
+ justify-content: center;
173
+ gap: 10px;
174
+ padding: 0 24px 150px;
175
+ }
176
+
177
+ #welcome-kicker {
178
+ margin: 0;
179
+ color: #f6d88e;
180
+ font-size: 0.84rem;
181
+ letter-spacing: 0.05em;
182
+ text-transform: uppercase;
183
+ }
184
+
185
+ #welcome-title {
186
+ margin: 0;
187
+ color: #f5f7fd;
188
+ font-size: clamp(1.5rem, 2.7vw, 2.2rem);
189
+ font-weight: 680;
190
+ text-align: center;
191
+ }
192
+
193
+ #welcome-sub {
194
+ margin: 0;
195
+ color: var(--muted);
196
+ font-size: 0.92rem;
197
+ text-align: center;
198
+ }
199
+
200
+ #pills-row {
201
+ margin-top: 10px;
202
+ max-width: 760px;
203
+ display: flex;
204
+ flex-wrap: wrap;
205
+ justify-content: center;
206
+ gap: 8px;
207
+ }
208
+
209
  .pill {
210
+ background: rgba(28, 33, 48, 0.92);
211
+ border: 1px solid var(--line);
212
+ border-radius: 999px;
213
+ padding: 8px 14px;
214
+ color: #d1d9eb;
215
+ font-size: 0.82rem;
216
+ cursor: pointer;
217
+ }
218
+
219
+ .pill:hover {
220
+ background: #22283a;
221
+ border-color: #39445f;
222
  }
 
223
 
 
224
  #chatbot {
225
+ flex: 1;
226
+ min-height: 0;
227
+ overflow-y: auto;
228
+ border: none !important;
229
+ border-radius: 0 !important;
230
+ box-shadow: none !important;
231
+ background: transparent !important;
232
+ padding-bottom: 170px !important;
233
+ }
234
+
235
+ #chatbot > div {
236
+ max-width: 860px;
237
+ margin: 0 auto;
238
+ padding: 20px 14px;
239
+ background: transparent !important;
240
+ }
241
+
242
+ #chatbot .bubble-wrap {
243
+ background: transparent !important;
244
+ }
245
+
246
+ #chatbot [data-testid="user"] > div {
247
+ background: #1c2130 !important;
248
+ border: 1px solid var(--line);
249
+ border-radius: 14px !important;
250
+ }
251
+
252
+ #chatbot [data-testid="assistant"] > div {
253
+ background: transparent !important;
254
+ }
255
+
256
+ #chatbot .prose {
257
+ color: #e7ecf7 !important;
258
+ line-height: 1.55;
259
+ }
260
+
261
+ #chatbot img {
262
+ border-radius: 12px;
263
+ margin-top: 8px;
264
+ border: 1px solid var(--line);
265
+ }
266
+
267
  #steps-box {
268
+ max-width: 860px;
269
+ width: 100%;
270
+ margin: 0 auto 8px;
271
+ background: transparent !important;
272
+ border: none !important;
273
+ padding: 0 14px !important;
274
  }
275
+
276
  .steps-toggle {
277
+ background: none;
278
+ border: none;
279
+ color: #7f8aa5;
280
+ font-size: 0.73rem;
281
+ cursor: pointer;
282
+ padding: 3px 2px;
283
+ display: flex;
284
+ align-items: center;
285
+ gap: 4px;
286
  }
287
+
288
+ .steps-toggle:hover {
289
+ color: #abb6cf;
290
+ }
291
+
292
  .steps-content {
293
+ display: none;
294
+ margin-top: 6px;
295
+ background: #151927;
296
+ border: 1px solid var(--line);
297
+ border-radius: 10px;
298
+ padding: 11px 12px;
299
+ color: #c8d1e5;
300
+ font-size: 0.78rem;
301
  }
302
+
303
  .steps-content pre {
304
+ margin: 0;
305
+ background: #1d2434;
306
+ border: 1px solid #303b55;
307
+ border-radius: 8px;
308
+ padding: 7px 8px;
309
+ color: #dce5f8;
310
+ white-space: pre-wrap;
311
  }
312
+
313
  .step-tool {
314
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
315
+ background: #29314a;
316
+ border: 1px solid #3a4665;
317
+ color: #f7d794;
318
+ border-radius: 7px;
319
+ padding: 2px 6px;
320
+ margin-left: 8px;
321
+ font-size: 0.72rem;
322
  }
323
 
 
324
  #input-bar {
325
+ position: fixed !important;
326
+ left: 272px;
327
+ right: 0;
328
+ bottom: 0;
329
+ z-index: 110;
330
+ padding: 20px clamp(14px, calc(50% - 430px), 110px) 12px;
331
+ background: linear-gradient(to top, #0f1117 74%, rgba(15, 17, 23, 0));
332
  }
333
+
334
  #input-container {
335
+ display: flex;
336
+ flex-direction: column;
337
+ border-radius: 16px;
338
+ background: #161b29;
339
+ border: 1px solid #2f3850;
340
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
341
+ }
342
+
343
+ #input-container:focus-within {
344
+ border-color: #4a5980;
345
+ }
346
+
347
+ #input-container #msg-box {
348
+ border: none !important;
349
+ box-shadow: none !important;
350
+ background: transparent;
351
  }
352
+
 
353
  #input-container #msg-box textarea {
354
+ min-height: 48px !important;
355
+ max-height: 160px !important;
356
+ padding: 14px 16px 6px !important;
357
+ border: none !important;
358
+ outline: none !important;
359
+ box-shadow: none !important;
360
+ background: transparent !important;
361
+ color: var(--text) !important;
362
+ font-size: 0.95rem !important;
363
+ line-height: 1.4;
364
+ resize: none !important;
365
+ }
366
+
367
+ #input-container #msg-box textarea::placeholder {
368
+ color: #73809f !important;
369
  }
370
+
371
  #input-bottom {
372
+ display: flex;
373
+ align-items: center;
374
+ justify-content: space-between;
375
+ padding: 0 10px 10px;
376
+ }
377
+
378
+ .input-left,
379
+ .input-right {
380
+ display: flex;
381
+ align-items: center;
382
+ gap: 8px;
383
  }
384
+
385
  .add-btn {
386
+ width: 30px;
387
+ height: 30px;
388
+ border-radius: 8px;
389
+ border: 1px solid #394560;
390
+ background: #20273a;
391
+ color: #bcc7e2;
392
+ font-size: 1rem;
393
+ cursor: pointer;
394
+ }
395
+
396
+ .add-btn:hover {
397
+ background: #27304a;
398
  }
399
+
400
  .mcp-pill {
401
+ display: flex;
402
+ align-items: center;
403
+ gap: 6px;
404
+ border-radius: 999px;
405
+ border: 1px solid #394560;
406
+ background: #20273a;
407
+ padding: 4px 10px;
408
+ color: #c7d2ec;
409
+ font-size: 0.75rem;
410
+ }
411
+
412
+ .mcp-dot {
413
+ width: 7px;
414
+ height: 7px;
415
+ border-radius: 999px;
416
+ background: #34d399;
417
+ }
418
+
419
+ #send-btn {
420
+ display: none !important;
421
+ }
422
+
423
  .send-visual-btn {
424
+ width: 34px;
425
+ height: 34px;
426
+ border-radius: 10px;
427
+ border: none;
428
+ background: var(--accent);
429
+ color: #1b1300;
430
+ display: flex;
431
+ align-items: center;
432
+ justify-content: center;
433
+ cursor: pointer;
434
+ }
435
+
436
+ .send-visual-btn:hover {
437
+ background: var(--accent-strong);
438
  }
439
+
440
  #input-note {
441
+ text-align: center;
442
+ color: #73809f;
443
+ font-size: 0.7rem;
444
+ padding: 5px 0 7px;
445
+ }
446
+
447
+ @media (max-width: 880px) {
448
+ #sidebar {
449
+ width: 76px;
450
+ padding: 10px 8px;
451
+ }
452
+
453
+ .sb-logo,
454
+ .sb-section-label,
455
+ .sb-item,
456
+ .sb-bottom-item,
457
+ .sb-new-chat span {
458
+ display: none;
459
+ }
460
+
461
+ .sb-new-chat {
462
+ justify-content: center;
463
+ }
464
+
465
+ #main-col,
466
+ #input-bar {
467
+ left: 76px;
468
+ }
469
+ }
470
+
471
+ @media (max-width: 620px) {
472
+ #sidebar {
473
+ display: none;
474
+ }
475
+
476
+ #main-col,
477
+ #input-bar {
478
+ left: 0;
479
+ }
480
+
481
+ #input-bar {
482
+ padding-left: 10px;
483
+ padding-right: 10px;
484
+ }
485
+
486
+ #chatbot > div {
487
+ padding-left: 10px;
488
+ padding-right: 10px;
489
+ }
490
+
491
+ .mcp-pill {
492
+ display: none;
493
+ }
494
  }
templates.py CHANGED
@@ -16,7 +16,6 @@ function fillInput(text) {
16
  ta.dispatchEvent(new Event('input', { bubbles: true }));
17
  }
18
 
19
- // Force viewport-locked layout (fixes HF Spaces iframe height issue)
20
  function lockViewportHeight() {
21
  const vh = window.innerHeight;
22
  document.documentElement.style.setProperty('height', vh + 'px', 'important');
@@ -25,7 +24,7 @@ function lockViewportHeight() {
25
  document.body.style.setProperty('height', vh + 'px', 'important');
26
  document.body.style.setProperty('max-height', vh + 'px', 'important');
27
  document.body.style.setProperty('overflow', 'hidden', 'important');
28
- // Also constrain the gradio container
29
  const gc = document.querySelector('.gradio-container');
30
  if (gc) {
31
  gc.style.setProperty('height', vh + 'px', 'important');
@@ -42,49 +41,40 @@ setTimeout(lockViewportHeight, 1000);
42
  SIDEBAR_HTML = """
43
  <div id="sidebar">
44
  <div class="sb-top">
45
- <div class="sb-logo">
46
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
47
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/>
48
- </svg>
49
- SO Analyst
50
- </div>
51
  <button class="sb-icon-btn" onclick="document.getElementById('new-chat-btn').click()" title="New chat">
52
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
53
  <path d="M12 5v14M5 12h14"/>
54
  </svg>
55
  </button>
 
56
  </div>
57
 
58
  <button class="sb-new-chat" onclick="document.getElementById('new-chat-btn').click()">
59
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
60
- <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>
61
  </svg>
62
- New chat
63
  </button>
64
 
65
- <div class="sb-section-label">TODAY</div>
66
- <div class="sb-item">Sub-options per question</div>
67
  <div class="sb-item">Distribution by question type</div>
68
  <div class="sb-item">Questions above average</div>
69
 
70
  <div class="sb-spacer"></div>
71
- <hr class="sb-divider">
72
 
73
  <div class="sb-bottom">
74
- <div class="sb-user">
75
- <div class="sb-avatar">S</div>
76
- <span class="sb-username">sitsope</span>
77
- <span class="sb-dots">···</span>
78
- </div>
79
  </div>
80
  </div>
81
  """
82
 
83
  WELCOME_HTML = """
84
  <div id="welcome">
85
- <div id="welcome-logo">📊</div>
86
- <p id="welcome-title">Stack Overflow Analyst</p>
87
- <p id="welcome-sub">Ask anything about the survey data charts generated automatically.</p>
88
  <div id="pills-row">
89
  {pills}
90
  </div>
@@ -97,12 +87,16 @@ WELCOME_HTML = """
97
  INPUT_HTML = """
98
  <div id="input-bottom">
99
  <div class="input-left">
100
- <button class="add-btn">+</button>
101
- <div class="mcp-pill"><span class="mcp-dot"></span> MCP (2)</div>
102
  </div>
103
  <div class="input-right">
104
- <button class="mic-btn">🎤</button>
105
- <button class="send-visual-btn" onclick="document.getElementById('send-btn').click()">↑</button>
 
 
 
 
106
  </div>
107
  </div>
108
  """
@@ -112,7 +106,7 @@ def steps_to_html(agent_steps: list) -> str:
112
  return ""
113
  rows = "".join(f"""
114
  <div style="margin-bottom:10px">
115
- <span style="font-size:0.72rem;color:#888">Step {i}</span>
116
  <span class="step-tool">{name}</span>
117
  <pre style="margin:4px 0 2px 0">{inp}</pre>
118
  <pre style="margin:0">{obs}</pre>
@@ -122,7 +116,7 @@ def steps_to_html(agent_steps: list) -> str:
122
  <button class="steps-toggle"
123
  onclick="var c=this.nextElementSibling;c.style.display=c.style.display==='block'?'none':'block';
124
  this.querySelector('span').textContent=c.style.display==='block'?'▾':'▸'">
125
- · reasoning steps <span>▸</span>
126
  </button>
127
  <div class="steps-content">{rows}</div>
128
  </div>"""
 
16
  ta.dispatchEvent(new Event('input', { bubbles: true }));
17
  }
18
 
 
19
  function lockViewportHeight() {
20
  const vh = window.innerHeight;
21
  document.documentElement.style.setProperty('height', vh + 'px', 'important');
 
24
  document.body.style.setProperty('height', vh + 'px', 'important');
25
  document.body.style.setProperty('max-height', vh + 'px', 'important');
26
  document.body.style.setProperty('overflow', 'hidden', 'important');
27
+
28
  const gc = document.querySelector('.gradio-container');
29
  if (gc) {
30
  gc.style.setProperty('height', vh + 'px', 'important');
 
41
  SIDEBAR_HTML = """
42
  <div id="sidebar">
43
  <div class="sb-top">
 
 
 
 
 
 
44
  <button class="sb-icon-btn" onclick="document.getElementById('new-chat-btn').click()" title="New chat">
45
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
46
  <path d="M12 5v14M5 12h14"/>
47
  </svg>
48
  </button>
49
+ <div class="sb-logo">SO Analyst</div>
50
  </div>
51
 
52
  <button class="sb-new-chat" onclick="document.getElementById('new-chat-btn').click()">
53
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
54
+ <path d="M12 5v14M5 12h14"/>
55
  </svg>
56
+ <span>New chat</span>
57
  </button>
58
 
59
+ <div class="sb-section-label">Recents</div>
60
+ <div class="sb-item is-active">Sub-options per question</div>
61
  <div class="sb-item">Distribution by question type</div>
62
  <div class="sb-item">Questions above average</div>
63
 
64
  <div class="sb-spacer"></div>
 
65
 
66
  <div class="sb-bottom">
67
+ <button class="sb-bottom-item">Explore assistants</button>
68
+ <button class="sb-bottom-item">Settings</button>
 
 
 
69
  </div>
70
  </div>
71
  """
72
 
73
  WELCOME_HTML = """
74
  <div id="welcome">
75
+ <p id="welcome-kicker">SO Analyst</p>
76
+ <p id="welcome-title">How can I help you today?</p>
77
+ <p id="welcome-sub">Ask anything about your survey data and I will generate stats and charts.</p>
78
  <div id="pills-row">
79
  {pills}
80
  </div>
 
87
  INPUT_HTML = """
88
  <div id="input-bottom">
89
  <div class="input-left">
90
+ <button class="add-btn" title="Attach">+</button>
91
+ <div class="mcp-pill"><span class="mcp-dot"></span> MCP connected</div>
92
  </div>
93
  <div class="input-right">
94
+ <button class="send-visual-btn" onclick="document.getElementById('send-btn').click()">
95
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
96
+ <path d="M22 2L11 13"/>
97
+ <path d="M22 2L15 22L11 13L2 9L22 2Z"/>
98
+ </svg>
99
+ </button>
100
  </div>
101
  </div>
102
  """
 
106
  return ""
107
  rows = "".join(f"""
108
  <div style="margin-bottom:10px">
109
+ <span style="font-size:0.72rem;color:#7e8797">Step {i}</span>
110
  <span class="step-tool">{name}</span>
111
  <pre style="margin:4px 0 2px 0">{inp}</pre>
112
  <pre style="margin:0">{obs}</pre>
 
116
  <button class="steps-toggle"
117
  onclick="var c=this.nextElementSibling;c.style.display=c.style.display==='block'?'none':'block';
118
  this.querySelector('span').textContent=c.style.display==='block'?'▾':'▸'">
119
+ reasoning steps <span>▸</span>
120
  </button>
121
  <div class="steps-content">{rows}</div>
122
  </div>"""