AaronTekle commited on
Commit
b19670f
·
verified ·
1 Parent(s): 83454bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +377 -3
app.py CHANGED
@@ -2169,11 +2169,385 @@ ul.options[role="listbox"] {
2169
  }
2170
  }
2171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2172
  '''
2173
 
2174
 
2175
  # Defines document-level metadata injected into the application page head
2176
  HEAD = '''
 
2177
  <meta name="theme-color" content="#050408">
2178
  <meta name="description" content="Agentic machine learning workspace for dataset profiling, model selection, baseline evaluation, and production-oriented pipeline generation.">
2179
  '''
@@ -2231,8 +2605,8 @@ def build_app():
2231
  gr.HTML(workflow)
2232
 
2233
  # Splits the primary workspace into a main content area and a supporting sidebar
2234
- with gr.Row(equal_height=False):
2235
- with gr.Column(scale=9, min_width=600, elem_classes=["app-panel"]):
2236
  with gr.Tabs(selected="dataset", elem_id="main-tabs"):
2237
  # Builds the dataset tab for uploads, profiling, preview, and schema inspection
2238
  with gr.Tab("01. Dataset", id="dataset"):
@@ -2352,7 +2726,7 @@ def build_app():
2352
  trace = gr.JSON(label="Agent tool calls and observations")
2353
 
2354
  # Builds the sidebar containing live workspace status, runtime information, controls, and diagnostics
2355
- with gr.Column(scale=4, min_width=335, elem_classes=["side-column"]):
2356
  status = gr.HTML(_status(None))
2357
  gr.HTML(f'''
2358
  <div class="sidebar-card">
 
2169
  }
2170
  }
2171
 
2172
+
2173
+ /* =========================================================
2174
+ FINAL CROSS-DISPLAY / LAPTOP RESPONSIVE OVERRIDES
2175
+ Keep controls readable on Windows PCs and macOS laptops,
2176
+ prevent label overflow, and normalize tab/button typography.
2177
+ This block intentionally comes last so it wins over older
2178
+ incremental styling rules above.
2179
+ ========================================================= */
2180
+
2181
+ html,
2182
+ body,
2183
+ .gradio-container {
2184
+ width: 100% !important;
2185
+ min-width: 0 !important;
2186
+ }
2187
+
2188
+ html,
2189
+ body {
2190
+ overflow-x: hidden !important;
2191
+ text-size-adjust: 100%;
2192
+ -webkit-text-size-adjust: 100%;
2193
+ }
2194
+
2195
+ .main-shell {
2196
+ width: 100% !important;
2197
+ max-width: 100% !important;
2198
+ padding-left: clamp(14px, 2vw, 30px) !important;
2199
+ padding-right: clamp(14px, 2vw, 30px) !important;
2200
+ }
2201
+
2202
+ /* The main workspace may shrink without forcing horizontal page overflow. */
2203
+ #workspace-row {
2204
+ width: 100% !important;
2205
+ max-width: 100% !important;
2206
+ gap: clamp(18px, 2vw, 28px) !important;
2207
+ align-items: flex-start !important;
2208
+ }
2209
+
2210
+ #workspace-row > * {
2211
+ min-width: 0 !important;
2212
+ }
2213
+
2214
+ .app-panel,
2215
+ .side-column,
2216
+ .tab-body,
2217
+ .model-controls-row,
2218
+ .model-action-row,
2219
+ #dataset-actions-row {
2220
+ min-width: 0 !important;
2221
+ max-width: 100% !important;
2222
+ }
2223
+
2224
+ /* Normalize the type size used by user-facing action buttons. */
2225
+ #load-button,
2226
+ #example-button,
2227
+ #clear-button,
2228
+ #train-button,
2229
+ #compare-button,
2230
+ #code-button,
2231
+ #agent-button,
2232
+ #load-button button,
2233
+ #example-button button,
2234
+ #clear-button button,
2235
+ #train-button button,
2236
+ #compare-button button,
2237
+ #code-button button,
2238
+ #agent-button button {
2239
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
2240
+ font-size: clamp(13px, .9vw, 15px) !important;
2241
+ font-weight: 800 !important;
2242
+ line-height: 1.25 !important;
2243
+ letter-spacing: 0 !important;
2244
+ white-space: normal !important;
2245
+ overflow-wrap: break-word !important;
2246
+ word-break: normal !important;
2247
+ text-align: center !important;
2248
+ }
2249
+
2250
+ #load-button,
2251
+ #example-button,
2252
+ #clear-button,
2253
+ #train-button,
2254
+ #compare-button,
2255
+ #code-button,
2256
+ #agent-button {
2257
+ min-height: 52px !important;
2258
+ height: auto !important;
2259
+ max-height: none !important;
2260
+ padding-top: 11px !important;
2261
+ padding-bottom: 11px !important;
2262
+ }
2263
+
2264
+ /* 01 / 02 / 03 primary navigation. */
2265
+ .app-panel {
2266
+ padding-top: 16px !important;
2267
+ }
2268
+
2269
+ #main-tabs {
2270
+ width: 100% !important;
2271
+ min-width: 0 !important;
2272
+ }
2273
+
2274
+ #main-tabs [role="tablist"] {
2275
+ display: grid !important;
2276
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr) !important;
2277
+ gap: clamp(12px, 1.25vw, 18px) !important;
2278
+ width: calc(100% - 28px) !important;
2279
+ max-width: calc(100% - 28px) !important;
2280
+ min-height: 0 !important;
2281
+ margin: 0 14px !important;
2282
+ padding: 10px !important;
2283
+ align-items: stretch !important;
2284
+ overflow: visible !important;
2285
+ border: 1px solid rgba(255,255,255,.075) !important;
2286
+ border-radius: 18px !important;
2287
+ background: linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.010)) !important;
2288
+ }
2289
+
2290
+ #main-tabs button[role="tab"] {
2291
+ width: 100% !important;
2292
+ min-width: 0 !important;
2293
+ max-width: none !important;
2294
+ min-height: 58px !important;
2295
+ height: auto !important;
2296
+ max-height: none !important;
2297
+ margin: 0 !important;
2298
+ padding: 12px 14px !important;
2299
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
2300
+ font-size: clamp(13px, .9vw, 15px) !important;
2301
+ font-weight: 800 !important;
2302
+ line-height: 1.28 !important;
2303
+ letter-spacing: 0 !important;
2304
+ white-space: normal !important;
2305
+ overflow-wrap: normal !important;
2306
+ word-break: normal !important;
2307
+ text-align: center !important;
2308
+ }
2309
+
2310
+ #main-tabs button[role="tab"] * {
2311
+ font-size: inherit !important;
2312
+ font-weight: inherit !important;
2313
+ line-height: inherit !important;
2314
+ letter-spacing: inherit !important;
2315
+ white-space: inherit !important;
2316
+ }
2317
+
2318
+ /* Recommended Pipeline / Tool Trace tabs. */
2319
+ #agent-result-tabs {
2320
+ width: 100% !important;
2321
+ min-width: 0 !important;
2322
+ margin-top: 18px !important;
2323
+ }
2324
+
2325
+ #agent-result-tabs [role="tablist"] {
2326
+ display: grid !important;
2327
+ grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
2328
+ gap: clamp(14px, 1.5vw, 20px) !important;
2329
+ width: 100% !important;
2330
+ margin: 0 !important;
2331
+ padding: 8px !important;
2332
+ border: 1px solid rgba(255,255,255,.07) !important;
2333
+ border-radius: 16px !important;
2334
+ background: rgba(255,255,255,.016) !important;
2335
+ }
2336
+
2337
+ #agent-result-tabs button[role="tab"] {
2338
+ display: flex !important;
2339
+ align-items: center !important;
2340
+ justify-content: center !important;
2341
+ width: 100% !important;
2342
+ min-width: 0 !important;
2343
+ max-width: none !important;
2344
+ min-height: 52px !important;
2345
+ height: auto !important;
2346
+ margin: 0 !important;
2347
+ padding: 12px 16px !important;
2348
+ border-radius: 12px !important;
2349
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
2350
+ font-size: clamp(13px, .9vw, 15px) !important;
2351
+ font-weight: 800 !important;
2352
+ line-height: 1.25 !important;
2353
+ letter-spacing: 0 !important;
2354
+ white-space: normal !important;
2355
+ overflow-wrap: normal !important;
2356
+ word-break: normal !important;
2357
+ text-align: center !important;
2358
+ }
2359
+
2360
+ #agent-result-tabs button[role="tab"] * {
2361
+ font-size: inherit !important;
2362
+ font-weight: inherit !important;
2363
+ line-height: inherit !important;
2364
+ }
2365
+
2366
+ /* Dataset and model action rows keep equal sizing without clipping labels. */
2367
+ #dataset-actions-row,
2368
+ .model-action-row {
2369
+ width: 100% !important;
2370
+ display: flex !important;
2371
+ flex-wrap: nowrap !important;
2372
+ gap: clamp(10px, 1.2vw, 16px) !important;
2373
+ align-items: stretch !important;
2374
+ }
2375
+
2376
+ #dataset-actions-row > *,
2377
+ .model-action-row > * {
2378
+ flex: 1 1 0 !important;
2379
+ min-width: 0 !important;
2380
+ max-width: none !important;
2381
+ }
2382
+
2383
+ #dataset-actions-row #load-button,
2384
+ #dataset-actions-row #example-button,
2385
+ #dataset-actions-row #clear-button,
2386
+ .model-action-row #train-button,
2387
+ .model-action-row #compare-button,
2388
+ .model-action-row #code-button {
2389
+ width: 100% !important;
2390
+ min-height: 56px !important;
2391
+ height: auto !important;
2392
+ max-height: none !important;
2393
+ margin: 0 !important;
2394
+ }
2395
+
2396
+ /* Let model selectors wrap before they become cramped. */
2397
+ .model-controls-row {
2398
+ width: 100% !important;
2399
+ display: flex !important;
2400
+ flex-wrap: wrap !important;
2401
+ gap: 14px !important;
2402
+ align-items: flex-start !important;
2403
+ }
2404
+
2405
+ .model-controls-row > * {
2406
+ flex: 1 1 220px !important;
2407
+ min-width: min(220px, 100%) !important;
2408
+ max-width: 100% !important;
2409
+ }
2410
+
2411
+ /* Long decorative copy should never push outside its card. */
2412
+ .eyebrow,
2413
+ .badge,
2414
+ .workflow-step,
2415
+ .hero-signal,
2416
+ .sidebar-card,
2417
+ .metric-chip {
2418
+ max-width: 100% !important;
2419
+ }
2420
+
2421
+ .eyebrow,
2422
+ .workflow-step strong,
2423
+ .workflow-step small,
2424
+ .hero-signal strong,
2425
+ .sidebar-card,
2426
+ .runtime-line strong {
2427
+ overflow-wrap: break-word !important;
2428
+ word-break: normal !important;
2429
+ }
2430
+
2431
+ .eyebrow {
2432
+ flex-wrap: wrap !important;
2433
+ line-height: 1.45 !important;
2434
+ }
2435
+
2436
+ /* Normal laptop widths: retain the three main tabs, but use less chrome. */
2437
+ @media (min-width: 801px) and (max-width: 1280px) {
2438
+ .main-shell {
2439
+ padding-left: 18px !important;
2440
+ padding-right: 18px !important;
2441
+ }
2442
+
2443
+ .hero {
2444
+ padding: 38px 34px 35px !important;
2445
+ }
2446
+
2447
+ .hero h1 {
2448
+ font-size: clamp(42px, 5vw, 60px) !important;
2449
+ }
2450
+
2451
+ #main-tabs [role="tablist"] {
2452
+ width: calc(100% - 20px) !important;
2453
+ max-width: calc(100% - 20px) !important;
2454
+ margin-left: 10px !important;
2455
+ margin-right: 10px !important;
2456
+ gap: 10px !important;
2457
+ padding: 9px !important;
2458
+ }
2459
+
2460
+ #main-tabs button[role="tab"] {
2461
+ min-height: 60px !important;
2462
+ padding-left: 10px !important;
2463
+ padding-right: 10px !important;
2464
+ font-size: 13.5px !important;
2465
+ }
2466
+
2467
+ #agent-result-tabs button[role="tab"] {
2468
+ font-size: 13.5px !important;
2469
+ }
2470
+ }
2471
+
2472
+ /* Narrow laptop / tablet windows: move the sidebar below the workspace. */
2473
+ @media (max-width: 1080px) {
2474
+ #workspace-row {
2475
+ flex-direction: column !important;
2476
+ flex-wrap: nowrap !important;
2477
+ }
2478
+
2479
+ #workspace-row > * {
2480
+ width: 100% !important;
2481
+ max-width: 100% !important;
2482
+ flex: 0 0 auto !important;
2483
+ }
2484
+
2485
+ .side-column {
2486
+ width: 100% !important;
2487
+ }
2488
+
2489
+ .workflow-strip {
2490
+ grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
2491
+ }
2492
+ }
2493
+
2494
+ /* Small screens: keep primary tabs usable with horizontal scrolling. */
2495
+ @media (max-width: 800px) {
2496
+ #main-tabs [role="tablist"] {
2497
+ display: flex !important;
2498
+ width: calc(100% - 12px) !important;
2499
+ max-width: calc(100% - 12px) !important;
2500
+ margin-left: 6px !important;
2501
+ margin-right: 6px !important;
2502
+ gap: 10px !important;
2503
+ padding: 8px !important;
2504
+ overflow-x: auto !important;
2505
+ overflow-y: hidden !important;
2506
+ scroll-snap-type: x proximity;
2507
+ }
2508
+
2509
+ #main-tabs button[role="tab"] {
2510
+ flex: 0 0 min(78vw, 260px) !important;
2511
+ min-width: min(78vw, 260px) !important;
2512
+ min-height: 54px !important;
2513
+ scroll-snap-align: start;
2514
+ }
2515
+
2516
+ #dataset-actions-row,
2517
+ .model-action-row {
2518
+ flex-direction: column !important;
2519
+ gap: 10px !important;
2520
+ }
2521
+
2522
+ #agent-result-tabs [role="tablist"] {
2523
+ gap: 10px !important;
2524
+ padding: 6px !important;
2525
+ }
2526
+
2527
+ #agent-result-tabs button[role="tab"] {
2528
+ min-height: 48px !important;
2529
+ padding: 10px 12px !important;
2530
+ font-size: 13px !important;
2531
+ }
2532
+ }
2533
+
2534
+ @media (max-width: 560px) {
2535
+ .workflow-strip,
2536
+ .metric-strip {
2537
+ grid-template-columns: 1fr !important;
2538
+ }
2539
+
2540
+ #agent-result-tabs [role="tablist"] {
2541
+ grid-template-columns: 1fr !important;
2542
+ }
2543
+ }
2544
+
2545
  '''
2546
 
2547
 
2548
  # Defines document-level metadata injected into the application page head
2549
  HEAD = '''
2550
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
2551
  <meta name="theme-color" content="#050408">
2552
  <meta name="description" content="Agentic machine learning workspace for dataset profiling, model selection, baseline evaluation, and production-oriented pipeline generation.">
2553
  '''
 
2605
  gr.HTML(workflow)
2606
 
2607
  # Splits the primary workspace into a main content area and a supporting sidebar
2608
+ with gr.Row(equal_height=False, elem_id="workspace-row"):
2609
+ with gr.Column(scale=9, min_width=0, elem_classes=["app-panel"]):
2610
  with gr.Tabs(selected="dataset", elem_id="main-tabs"):
2611
  # Builds the dataset tab for uploads, profiling, preview, and schema inspection
2612
  with gr.Tab("01. Dataset", id="dataset"):
 
2726
  trace = gr.JSON(label="Agent tool calls and observations")
2727
 
2728
  # Builds the sidebar containing live workspace status, runtime information, controls, and diagnostics
2729
+ with gr.Column(scale=4, min_width=300, elem_classes=["side-column"]):
2730
  status = gr.HTML(_status(None))
2731
  gr.HTML(f'''
2732
  <div class="sidebar-card">