ror HF Staff commited on
Commit
a899859
·
1 Parent(s): 9ec4a51

Homing into right sidebar

Browse files
Files changed (2) hide show
  1. app.py +29 -23
  2. styles.css +77 -13
app.py CHANGED
@@ -247,14 +247,14 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
247
  with gr.Row():
248
  # Sidebar for model selection
249
  with gr.Column(scale=1, elem_classes=["sidebar"]):
250
- gr.Markdown("# 🤖 TCID")
251
 
252
  # Description with integrated last update time
253
  if Ci_results.last_update_time:
254
  description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (last updated: {Ci_results.last_update_time})*\n"
255
  else:
256
  description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (loading...)*\n"
257
- description_display = gr.Markdown(description_text)
258
 
259
  # Summary button at the top
260
  summary_button = gr.Button(
@@ -264,21 +264,26 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
264
  elem_classes=["summary-button"]
265
  )
266
 
267
- # Back to simple buttons that work
268
- # Model selector dropdown - much better for long lists
269
- gr.Markdown(f"**Select Model ({len(Ci_results.available_models)}):**")
270
 
271
- model_choices = [model.lower() for model in Ci_results.available_models] if Ci_results.available_models else ["auto", "bert", "clip", "llama"]
272
- model_dropdown = gr.Dropdown(
273
- choices=model_choices,
274
- value=model_choices[0] if model_choices else "auto",
275
- label="Choose Model",
276
- interactive=True,
277
- allow_custom_value=False
278
- )
 
 
 
 
 
 
279
 
280
  # CI job links at bottom of sidebar
281
- ci_links_display = gr.Markdown("🔗 **CI Jobs:** *Loading...*")
282
 
283
  # Main content area
284
  with gr.Column(scale=4, elem_classes=["main-content"]):
@@ -322,15 +327,16 @@ with gr.Blocks(title="Model Test Results Dashboard", css=load_css()) as demo:
322
  elem_classes=["failed-tests"]
323
  )
324
 
325
- # Set up change handler for dropdown
326
- model_dropdown.change(
327
- fn=lambda selected_model: plot_model_stats(selected_model),
328
- inputs=[model_dropdown],
329
- outputs=[plot_output, amd_failed_tests_output, nvidia_failed_tests_output]
330
- ).then(
331
- fn=lambda: [gr.update(visible=False), gr.update(visible=True)],
332
- outputs=[summary_display, detail_view]
333
- )
 
334
 
335
  # Summary button click handler
336
  def show_summary_and_update_links():
 
247
  with gr.Row():
248
  # Sidebar for model selection
249
  with gr.Column(scale=1, elem_classes=["sidebar"]):
250
+ gr.Markdown("# 🤖 TCID", elem_classes=["sidebar-title"])
251
 
252
  # Description with integrated last update time
253
  if Ci_results.last_update_time:
254
  description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (last updated: {Ci_results.last_update_time})*\n"
255
  else:
256
  description_text = f"**Transformer CI Dashboard**\n\n*Result overview by model and hardware (loading...)*\n"
257
+ description_display = gr.Markdown(description_text, elem_classes=["sidebar-description"])
258
 
259
  # Summary button at the top
260
  summary_button = gr.Button(
 
264
  elem_classes=["summary-button"]
265
  )
266
 
267
+ # Model selection header
268
+ gr.Markdown(f"**Select Model ({len(Ci_results.available_models)}):**", elem_classes=["model-header"])
 
269
 
270
+ # Scrollable container for model buttons
271
+ with gr.Column(scale=1, elem_classes=["model-container"]):
272
+ # Create individual buttons for each model
273
+ model_buttons = []
274
+ model_choices = [model.lower() for model in Ci_results.available_models] if Ci_results.available_models else ["auto", "bert", "clip", "llama"]
275
+
276
+ for model_name in model_choices:
277
+ btn = gr.Button(
278
+ model_name,
279
+ variant="secondary",
280
+ size="sm",
281
+ elem_classes=["model-button"]
282
+ )
283
+ model_buttons.append(btn)
284
 
285
  # CI job links at bottom of sidebar
286
+ ci_links_display = gr.Markdown("🔗 **CI Jobs:** *Loading...*", elem_classes=["sidebar-links"])
287
 
288
  # Main content area
289
  with gr.Column(scale=4, elem_classes=["main-content"]):
 
327
  elem_classes=["failed-tests"]
328
  )
329
 
330
+ # Set up click handlers for model buttons
331
+ for i, btn in enumerate(model_buttons):
332
+ model_name = model_choices[i]
333
+ btn.click(
334
+ fn=lambda selected_model=model_name: plot_model_stats(selected_model),
335
+ outputs=[plot_output, amd_failed_tests_output, nvidia_failed_tests_output]
336
+ ).then(
337
+ fn=lambda: [gr.update(visible=False), gr.update(visible=True)],
338
+ outputs=[summary_display, detail_view]
339
+ )
340
 
341
  # Summary button click handler
342
  def show_summary_and_update_links():
styles.css CHANGED
@@ -36,22 +36,82 @@ div[data-testid="column"]:has(.sidebar) {
36
  overflow-x: hidden !important;
37
  }
38
 
39
- /* Scrollbar styling for sidebar */
40
- .sidebar::-webkit-scrollbar {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  width: 8px !important;
42
  background: #111111 !important;
43
  }
44
 
45
- .sidebar::-webkit-scrollbar-track {
46
  background: #111111 !important;
47
  }
48
 
49
- .sidebar::-webkit-scrollbar-thumb {
50
  background-color: #333333 !important;
51
  border-radius: 4px !important;
52
  }
53
 
54
- .sidebar::-webkit-scrollbar-thumb:hover {
55
  background-color: #555555 !important;
56
  }
57
 
@@ -92,20 +152,25 @@ div[data-testid="column"]:has(.sidebar) {
92
  background-color: #555555 !important;
93
  }
94
 
95
- /* Force button containers to single column - DISABLED */
96
- /*
97
- .sidebar .gr-button,
98
- .sidebar button {
 
 
 
 
 
 
 
99
  display: block !important;
100
  width: 100% !important;
101
  max-width: 100% !important;
102
  margin: 2px 0 !important;
103
  flex: none !important;
104
  }
105
- */
106
 
107
- /* Model button styling - DISABLED */
108
- /*
109
  .model-button {
110
  background: linear-gradient(135deg, #2a2a2a, #1e1e1e) !important;
111
  color: white !important;
@@ -135,7 +200,6 @@ div[data-testid="column"]:has(.sidebar) {
135
  transform: translateY(-1px) !important;
136
  box-shadow: 0 2px 8px rgba(116, 185, 255, 0.2) !important;
137
  }
138
- */
139
 
140
  /*
141
  .model-button:active {
 
36
  overflow-x: hidden !important;
37
  }
38
 
39
+ /* Individual sidebar elements */
40
+ .sidebar-title {
41
+ margin-bottom: 10px !important;
42
+ }
43
+
44
+ .sidebar-description {
45
+ margin-bottom: 15px !important;
46
+ }
47
+
48
+ /* Summary button styling - distinct from model buttons */
49
+ .summary-button {
50
+ background: linear-gradient(135deg, #4a4a4a, #3e3e3e) !important;
51
+ color: white !important;
52
+ border: 2px solid #555555 !important;
53
+ margin: 0 0 15px 0 !important;
54
+ border-radius: 5px !important;
55
+ padding: 12px 10px !important;
56
+ transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
57
+ position: relative !important;
58
+ overflow: hidden !important;
59
+ box-shadow:
60
+ 0 4px 15px rgba(0, 0, 0, 0.3),
61
+ inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
62
+ font-weight: 600 !important;
63
+ font-size: 14px !important;
64
+ text-transform: uppercase !important;
65
+ letter-spacing: 0.3px !important;
66
+ font-family: monospace !important;
67
+ height: 60px !important;
68
+ display: flex !important;
69
+ flex-direction: column !important;
70
+ justify-content: center !important;
71
+ align-items: center !important;
72
+ line-height: 1.2 !important;
73
+ width: 100% !important;
74
+ max-width: 100% !important;
75
+ min-width: 0 !important;
76
+ box-sizing: border-box !important;
77
+ }
78
+
79
+ .model-header {
80
+ margin-bottom: 10px !important;
81
+ }
82
+
83
+ .model-container {
84
+ height: 300px !important;
85
+ overflow-y: auto !important;
86
+ overflow-x: hidden !important;
87
+ margin-bottom: 15px !important;
88
+ scrollbar-width: thin !important;
89
+ scrollbar-color: #333333 #111111 !important;
90
+ border: 1px solid #333 !important;
91
+ border-radius: 5px !important;
92
+ padding: 5px !important;
93
+ }
94
+
95
+ .sidebar-links {
96
+ margin-top: 15px !important;
97
+ }
98
+
99
+ /* Scrollbar styling for model container */
100
+ .model-container::-webkit-scrollbar {
101
  width: 8px !important;
102
  background: #111111 !important;
103
  }
104
 
105
+ .model-container::-webkit-scrollbar-track {
106
  background: #111111 !important;
107
  }
108
 
109
+ .model-container::-webkit-scrollbar-thumb {
110
  background-color: #333333 !important;
111
  border-radius: 4px !important;
112
  }
113
 
114
+ .model-container::-webkit-scrollbar-thumb:hover {
115
  background-color: #555555 !important;
116
  }
117
 
 
152
  background-color: #555555 !important;
153
  }
154
 
155
+ /* Target Gradio column containing model-container */
156
+ div[data-testid="column"]:has(.model-container) {
157
+ flex: 1 1 auto !important;
158
+ overflow-y: auto !important;
159
+ overflow-x: hidden !important;
160
+ max-height: calc(100vh - 350px) !important;
161
+ }
162
+
163
+ /* Force button containers to single column in model container */
164
+ .model-container .gr-button,
165
+ .model-container button {
166
  display: block !important;
167
  width: 100% !important;
168
  max-width: 100% !important;
169
  margin: 2px 0 !important;
170
  flex: none !important;
171
  }
 
172
 
173
+ /* Model button styling */
 
174
  .model-button {
175
  background: linear-gradient(135deg, #2a2a2a, #1e1e1e) !important;
176
  color: white !important;
 
200
  transform: translateY(-1px) !important;
201
  box-shadow: 0 2px 8px rgba(116, 185, 255, 0.2) !important;
202
  }
 
203
 
204
  /*
205
  .model-button:active {