HAHAHA97 commited on
Commit
782e67d
·
1 Parent(s): 0cd5b9d

update UI

Browse files
Files changed (2) hide show
  1. app.py +16 -16
  2. src/display/css_html_js.py +60 -90
app.py CHANGED
@@ -195,7 +195,7 @@ def _render_info_panels(group: dict) -> None:
195
  gr.Markdown(group["ranking"], elem_classes="markdown-text")
196
 
197
 
198
- def _render_submit_section(task_names: list[str], page_title: str) -> None:
199
  submit_enabled = bool(task_names)
200
  multiple_tasks = len(task_names) > 1
201
  if submit_enabled:
@@ -217,8 +217,8 @@ def _render_submit_section(task_names: list[str], page_title: str) -> None:
217
  display_input = gr.Textbox(
218
  show_label=False,
219
  placeholder="Awesome Team",
220
- elem_classes="clean-input",
221
- elem_id="submit-display-name",
222
  container=False,
223
  interactive=submit_enabled,
224
  )
@@ -230,16 +230,16 @@ def _render_submit_section(task_names: list[str], page_title: str) -> None:
230
  choices=task_choices,
231
  value=default_task,
232
  interactive=True,
233
- elem_classes="clean-input",
234
- elem_id="submit-subtask",
235
  container=False,
236
  )
237
  else:
238
  task_input = gr.Textbox(
239
  show_label=False,
240
  value=task_display_name,
241
- elem_classes="clean-input",
242
- elem_id="submit-subtask",
243
  container=False,
244
  interactive=False,
245
  )
@@ -250,8 +250,8 @@ def _render_submit_section(task_names: list[str], page_title: str) -> None:
250
  dataset_input = gr.Textbox(
251
  show_label=False,
252
  placeholder="userA/my-results",
253
- elem_classes="clean-input",
254
- elem_id="submit-user-dataset",
255
  container=False,
256
  interactive=submit_enabled,
257
  )
@@ -262,8 +262,8 @@ def _render_submit_section(task_names: list[str], page_title: str) -> None:
262
  "Submit",
263
  variant="primary",
264
  size="lg",
265
- elem_classes="primary-action",
266
- elem_id="submit-action-button",
267
  interactive=submit_enabled,
268
  )
269
  with gr.Column(scale=1):
@@ -278,7 +278,7 @@ def _render_submit_section(task_names: list[str], page_title: str) -> None:
278
  return display_input, task_input, dataset_input, submit_button, submit_message
279
 
280
 
281
- def _render_queue_section(task_names: list[str]) -> gr.components.Component | None:
282
  submit_enabled = bool(task_names)
283
  _section_divider()
284
 
@@ -292,8 +292,8 @@ def _render_queue_section(task_names: list[str]) -> gr.components.Component | No
292
  refresh_queue = gr.Button(
293
  "Refresh",
294
  size="sm",
295
- elem_classes="secondary-action",
296
- elem_id="queue-refresh-button",
297
  interactive=submit_enabled,
298
  )
299
 
@@ -444,9 +444,9 @@ with gr.Blocks(
444
  _render_intro(group)
445
  _render_info_panels(group)
446
  display_input, task_input, dataset_input, submit_button, submit_message = _render_submit_section(
447
- group["tasks"], group["title"]
448
  )
449
- queue_table = _render_queue_section(group["tasks"])
450
  _render_subtasks(group["tasks"], group["title"])
451
  _wire_submit_if_available(
452
  group["tasks"],
 
195
  gr.Markdown(group["ranking"], elem_classes="markdown-text")
196
 
197
 
198
+ def _render_submit_section(task_names: list[str], page_title: str, group_slug: str) -> None:
199
  submit_enabled = bool(task_names)
200
  multiple_tasks = len(task_names) > 1
201
  if submit_enabled:
 
217
  display_input = gr.Textbox(
218
  show_label=False,
219
  placeholder="Awesome Team",
220
+ elem_classes=["clean-input", "submit-display-name"],
221
+ elem_id=f"{group_slug}-submit-display-name",
222
  container=False,
223
  interactive=submit_enabled,
224
  )
 
230
  choices=task_choices,
231
  value=default_task,
232
  interactive=True,
233
+ elem_classes=["clean-input", "submit-subtask"],
234
+ elem_id=f"{group_slug}-submit-subtask",
235
  container=False,
236
  )
237
  else:
238
  task_input = gr.Textbox(
239
  show_label=False,
240
  value=task_display_name,
241
+ elem_classes=["clean-input", "submit-subtask"],
242
+ elem_id=f"{group_slug}-submit-subtask",
243
  container=False,
244
  interactive=False,
245
  )
 
250
  dataset_input = gr.Textbox(
251
  show_label=False,
252
  placeholder="userA/my-results",
253
+ elem_classes=["clean-input", "submit-user-dataset"],
254
+ elem_id=f"{group_slug}-submit-user-dataset",
255
  container=False,
256
  interactive=submit_enabled,
257
  )
 
262
  "Submit",
263
  variant="primary",
264
  size="lg",
265
+ elem_classes=["primary-action", "submit-action-button"],
266
+ elem_id=f"{group_slug}-submit-action-button",
267
  interactive=submit_enabled,
268
  )
269
  with gr.Column(scale=1):
 
278
  return display_input, task_input, dataset_input, submit_button, submit_message
279
 
280
 
281
+ def _render_queue_section(task_names: list[str], group_slug: str) -> gr.components.Component | None:
282
  submit_enabled = bool(task_names)
283
  _section_divider()
284
 
 
292
  refresh_queue = gr.Button(
293
  "Refresh",
294
  size="sm",
295
+ elem_classes=["secondary-action", "queue-refresh-button"],
296
+ elem_id=f"{group_slug}-queue-refresh-button",
297
  interactive=submit_enabled,
298
  )
299
 
 
444
  _render_intro(group)
445
  _render_info_panels(group)
446
  display_input, task_input, dataset_input, submit_button, submit_message = _render_submit_section(
447
+ group["tasks"], group["title"], group["slug"]
448
  )
449
+ queue_table = _render_queue_section(group["tasks"], group["slug"])
450
  _render_subtasks(group["tasks"], group["title"])
451
  _wire_submit_if_available(
452
  group["tasks"],
src/display/css_html_js.py CHANGED
@@ -29,10 +29,12 @@ code, pre, kbd, samp, textarea {
29
  }
30
 
31
  .gradio-container {
 
32
  max-width: var(--page-max) !important;
33
  margin: 0 auto !important;
34
- padding: 12px 0 40px 0 !important;
35
  color: var(--ink-1);
 
36
  scrollbar-gutter: stable both-edges;
37
  }
38
 
@@ -46,7 +48,6 @@ code, pre, kbd, samp, textarea {
46
  .gradio-container [role="tabpanel"] {
47
  width: 100% !important;
48
  max-width: 100% !important;
49
- min-width: 100% !important;
50
  box-sizing: border-box !important;
51
  }
52
 
@@ -61,14 +62,12 @@ code, pre, kbd, samp, textarea {
61
  #tab-motion_transfer {
62
  width: 100% !important;
63
  max-width: 100% !important;
64
- min-width: 100% !important;
65
  box-sizing: border-box !important;
66
  }
67
 
68
  .task-page-shell {
69
  width: 100% !important;
70
  max-width: 100% !important;
71
- min-width: 100% !important;
72
  margin: 0 !important;
73
  padding: 0 !important;
74
  background: transparent !important;
@@ -85,15 +84,6 @@ code, pre, kbd, samp, textarea {
85
  background: transparent !important;
86
  }
87
 
88
- #task-page-video_generation,
89
- #task-page-video_generation > div {
90
- width: 100% !important;
91
- max-width: 100% !important;
92
- min-width: 100% !important;
93
- display: block !important;
94
- flex: 1 1 100% !important;
95
- }
96
-
97
  .gradio-container,
98
  .gradio-container .prose,
99
  .gradio-container .prose * {
@@ -117,7 +107,7 @@ code, pre, kbd, samp, textarea {
117
 
118
  .markdown-text {
119
  font-size: 16px !important;
120
- line-height: 1.75 !important;
121
  color: var(--ink-2) !important;
122
  }
123
 
@@ -127,8 +117,8 @@ code, pre, kbd, samp, textarea {
127
  }
128
 
129
  .hero-block {
130
- padding: 10px 0 24px 0;
131
- margin-bottom: 18px;
132
  border-bottom: 1px solid var(--line-1);
133
  }
134
 
@@ -138,7 +128,7 @@ code, pre, kbd, samp, textarea {
138
 
139
  .hero-eyebrow {
140
  display: inline-block;
141
- margin-bottom: 10px;
142
  color: var(--brand);
143
  font-size: 13px;
144
  font-weight: 700;
@@ -147,7 +137,7 @@ code, pre, kbd, samp, textarea {
147
  }
148
 
149
  .hero-title {
150
- margin: 0 0 10px 0;
151
  color: var(--ink-1);
152
  font-size: 34px;
153
  line-height: 1.15;
@@ -156,15 +146,15 @@ code, pre, kbd, samp, textarea {
156
 
157
  .hero-text {
158
  margin: 0;
159
- max-width: 980px;
160
  color: var(--ink-2);
161
- font-size: 17px;
162
- line-height: 1.82;
163
  font-weight: 400;
164
  }
165
 
166
  .hero-meta {
167
- margin-top: 12px;
168
  color: var(--ink-3);
169
  font-size: 14px;
170
  line-height: 1.65;
@@ -172,7 +162,7 @@ code, pre, kbd, samp, textarea {
172
  }
173
 
174
  .section-header {
175
- margin: 16px 0 8px 0;
176
  }
177
 
178
  .section-header h3 {
@@ -187,20 +177,19 @@ code, pre, kbd, samp, textarea {
187
  margin: 4px 0 0 0;
188
  color: var(--ink-3);
189
  font-size: 14px;
190
- line-height: 1.65;
191
  }
192
 
193
  .section-divider {
194
  height: 1px;
195
- margin: 14px 0 8px 0;
196
  background: linear-gradient(90deg, var(--line-1), rgba(219, 227, 239, 0));
197
  }
198
 
199
  .info-panels-row {
200
- margin-bottom: 6px;
201
  width: 100% !important;
202
  max-width: 100% !important;
203
- min-width: 100% !important;
204
  display: flex !important;
205
  align-items: stretch !important;
206
  }
@@ -228,16 +217,19 @@ code, pre, kbd, samp, textarea {
228
  }
229
 
230
  .form-row {
231
- margin-top: 0;
232
  width: 100% !important;
233
  max-width: 100% !important;
234
- min-width: 100% !important;
235
  display: flex !important;
 
 
236
  }
237
 
238
  .form-row > div {
239
  flex: 1 1 0 !important;
240
  min-width: 0 !important;
 
 
241
  }
242
 
243
  .form-row-single > div {
@@ -245,12 +237,17 @@ code, pre, kbd, samp, textarea {
245
  }
246
 
247
  .submit-action-row {
248
- margin-top: 6px;
249
- align-items: center;
 
 
 
 
 
250
  }
251
 
252
  .queue-head-row {
253
- margin-top: 6px;
254
  align-items: end;
255
  }
256
 
@@ -263,7 +260,7 @@ code, pre, kbd, samp, textarea {
263
  }
264
 
265
  .field-label-wide {
266
- margin-top: 6px;
267
  }
268
 
269
  .clean-input,
@@ -277,16 +274,12 @@ code, pre, kbd, samp, textarea {
277
  .clean-input .label-wrap,
278
  .clean-input .single-select,
279
  .clean-input .dropdown,
280
- .clean-input .dropdown > div,
281
- #submit-display-name,
282
- #submit-subtask,
283
- #submit-user-dataset,
284
- #submit-display-name > div,
285
- #submit-subtask > div,
286
- #submit-user-dataset > div {
287
  background: transparent !important;
288
  border: 0 !important;
289
  box-shadow: none !important;
 
 
290
  }
291
 
292
  .clean-input input,
@@ -296,30 +289,23 @@ code, pre, kbd, samp, textarea {
296
  .clean-input .wrap-inner > textarea,
297
  .clean-input .single-select,
298
  .clean-input .dropdown .wrap-inner,
299
- .clean-input .dropdown .secondary-wrap,
300
- #submit-display-name input,
301
- #submit-user-dataset input,
302
- #submit-subtask input,
303
- #submit-subtask .wrap-inner,
304
- #submit-subtask .secondary-wrap,
305
- #submit-subtask .single-select {
306
- background: transparent !important;
307
  border-radius: 12px !important;
308
  border: 1px solid var(--line-2) !important;
 
309
  }
310
 
311
- #submit-display-name input,
312
- #submit-user-dataset input,
313
- #submit-subtask .wrap-inner,
314
- #submit-subtask .single-select,
315
- #submit-subtask .secondary-wrap {
316
  min-height: 48px !important;
317
  height: 48px !important;
318
  }
319
 
320
- #submit-display-name,
321
- #submit-subtask,
322
- #submit-user-dataset {
323
  margin: 0 !important;
324
  padding: 0 !important;
325
  min-height: 48px !important;
@@ -328,36 +314,21 @@ code, pre, kbd, samp, textarea {
328
  max-width: 100% !important;
329
  }
330
 
331
- #submit-subtask button,
332
- #submit-subtask span,
333
- #submit-subtask label,
334
- #submit-subtask .token,
335
- #submit-subtask [data-testid],
336
- #submit-subtask [class*="label"] {
337
- background: transparent !important;
338
- }
339
-
340
- #submit-subtask input {
341
  background: transparent !important;
342
- border: 1px solid var(--line-2) !important;
343
- border-radius: 12px !important;
344
- min-height: 48px !important;
345
- height: 48px !important;
346
  }
347
 
348
- #submit-display-name *,
349
- #submit-subtask *,
350
- #submit-user-dataset * {
351
- background-color: transparent !important;
352
- box-shadow: none !important;
353
- }
354
-
355
- #submit-display-name input,
356
- #submit-user-dataset input,
357
- #submit-subtask .wrap-inner,
358
- #submit-subtask .single-select,
359
- #submit-subtask .secondary-wrap {
360
- background: transparent !important;
361
  }
362
 
363
  .submit-placeholder-note {
@@ -368,8 +339,8 @@ code, pre, kbd, samp, textarea {
368
 
369
  .primary-action,
370
  .primary-action button,
371
- #submit-action-button,
372
- #submit-action-button button {
373
  min-width: 220px;
374
  width: 220px !important;
375
  border-radius: 12px !important;
@@ -377,8 +348,8 @@ code, pre, kbd, samp, textarea {
377
 
378
  .secondary-action,
379
  .secondary-action button,
380
- #queue-refresh-button,
381
- #queue-refresh-button button {
382
  width: auto !important;
383
  min-width: 120px;
384
  border-radius: 10px !important;
@@ -386,14 +357,14 @@ code, pre, kbd, samp, textarea {
386
 
387
  button.primary,
388
  .primary-action button,
389
- #submit-action-button button {
390
  background: var(--brand) !important;
391
  border-color: var(--brand) !important;
392
  }
393
 
394
  button.primary:hover,
395
  .primary-action button:hover,
396
- #submit-action-button button:hover {
397
  background: var(--brand-dark) !important;
398
  border-color: var(--brand-dark) !important;
399
  }
@@ -412,7 +383,6 @@ button.primary:hover,
412
  .empty-task-note {
413
  width: 100% !important;
414
  max-width: 100% !important;
415
- min-width: 100% !important;
416
  display: block !important;
417
  margin: 10px 0 !important;
418
  padding: 14px 16px !important;
 
29
  }
30
 
31
  .gradio-container {
32
+ width: 100% !important;
33
  max-width: var(--page-max) !important;
34
  margin: 0 auto !important;
35
+ padding: 10px 0 32px 0 !important;
36
  color: var(--ink-1);
37
+ box-sizing: border-box !important;
38
  scrollbar-gutter: stable both-edges;
39
  }
40
 
 
48
  .gradio-container [role="tabpanel"] {
49
  width: 100% !important;
50
  max-width: 100% !important;
 
51
  box-sizing: border-box !important;
52
  }
53
 
 
62
  #tab-motion_transfer {
63
  width: 100% !important;
64
  max-width: 100% !important;
 
65
  box-sizing: border-box !important;
66
  }
67
 
68
  .task-page-shell {
69
  width: 100% !important;
70
  max-width: 100% !important;
 
71
  margin: 0 !important;
72
  padding: 0 !important;
73
  background: transparent !important;
 
84
  background: transparent !important;
85
  }
86
 
 
 
 
 
 
 
 
 
 
87
  .gradio-container,
88
  .gradio-container .prose,
89
  .gradio-container .prose * {
 
107
 
108
  .markdown-text {
109
  font-size: 16px !important;
110
+ line-height: 1.6 !important;
111
  color: var(--ink-2) !important;
112
  }
113
 
 
117
  }
118
 
119
  .hero-block {
120
+ padding: 8px 0 18px 0;
121
+ margin-bottom: 12px;
122
  border-bottom: 1px solid var(--line-1);
123
  }
124
 
 
128
 
129
  .hero-eyebrow {
130
  display: inline-block;
131
+ margin-bottom: 8px;
132
  color: var(--brand);
133
  font-size: 13px;
134
  font-weight: 700;
 
137
  }
138
 
139
  .hero-title {
140
+ margin: 0 0 8px 0;
141
  color: var(--ink-1);
142
  font-size: 34px;
143
  line-height: 1.15;
 
146
 
147
  .hero-text {
148
  margin: 0;
149
+ max-width: 1040px;
150
  color: var(--ink-2);
151
+ font-size: 16px;
152
+ line-height: 1.65;
153
  font-weight: 400;
154
  }
155
 
156
  .hero-meta {
157
+ margin-top: 10px;
158
  color: var(--ink-3);
159
  font-size: 14px;
160
  line-height: 1.65;
 
162
  }
163
 
164
  .section-header {
165
+ margin: 14px 0 8px 0;
166
  }
167
 
168
  .section-header h3 {
 
177
  margin: 4px 0 0 0;
178
  color: var(--ink-3);
179
  font-size: 14px;
180
+ line-height: 1.5;
181
  }
182
 
183
  .section-divider {
184
  height: 1px;
185
+ margin: 16px 0 10px 0;
186
  background: linear-gradient(90deg, var(--line-1), rgba(219, 227, 239, 0));
187
  }
188
 
189
  .info-panels-row {
190
+ margin: 10px 0 6px 0;
191
  width: 100% !important;
192
  max-width: 100% !important;
 
193
  display: flex !important;
194
  align-items: stretch !important;
195
  }
 
217
  }
218
 
219
  .form-row {
220
+ margin: 10px 0 12px 0 !important;
221
  width: 100% !important;
222
  max-width: 100% !important;
 
223
  display: flex !important;
224
+ gap: 20px !important;
225
+ align-items: flex-end !important;
226
  }
227
 
228
  .form-row > div {
229
  flex: 1 1 0 !important;
230
  min-width: 0 !important;
231
+ margin: 0 !important;
232
+ padding: 0 !important;
233
  }
234
 
235
  .form-row-single > div {
 
237
  }
238
 
239
  .submit-action-row {
240
+ margin: 12px 0 0 0 !important;
241
+ align-items: center !important;
242
+ }
243
+
244
+ .submit-action-row > div {
245
+ margin: 0 !important;
246
+ padding: 0 !important;
247
  }
248
 
249
  .queue-head-row {
250
+ margin-top: 4px;
251
  align-items: end;
252
  }
253
 
 
260
  }
261
 
262
  .field-label-wide {
263
+ margin-top: 0;
264
  }
265
 
266
  .clean-input,
 
274
  .clean-input .label-wrap,
275
  .clean-input .single-select,
276
  .clean-input .dropdown,
277
+ .clean-input .dropdown > div {
 
 
 
 
 
 
278
  background: transparent !important;
279
  border: 0 !important;
280
  box-shadow: none !important;
281
+ margin: 0 !important;
282
+ padding: 0 !important;
283
  }
284
 
285
  .clean-input input,
 
289
  .clean-input .wrap-inner > textarea,
290
  .clean-input .single-select,
291
  .clean-input .dropdown .wrap-inner,
292
+ .clean-input .dropdown .secondary-wrap {
293
+ background: #ffffff !important;
 
 
 
 
 
 
294
  border-radius: 12px !important;
295
  border: 1px solid var(--line-2) !important;
296
+ box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
297
  }
298
 
299
+ .clean-input input,
300
+ .clean-input textarea,
301
+ .clean-input .wrap-inner,
302
+ .clean-input .single-select,
303
+ .clean-input .secondary-wrap {
304
  min-height: 48px !important;
305
  height: 48px !important;
306
  }
307
 
308
+ .clean-input {
 
 
309
  margin: 0 !important;
310
  padding: 0 !important;
311
  min-height: 48px !important;
 
314
  max-width: 100% !important;
315
  }
316
 
317
+ .submit-subtask button,
318
+ .submit-subtask span,
319
+ .submit-subtask label,
320
+ .submit-subtask .token,
321
+ .submit-subtask [data-testid],
322
+ .submit-subtask [class*="label"] {
 
 
 
 
323
  background: transparent !important;
 
 
 
 
324
  }
325
 
326
+ .clean-input input:disabled,
327
+ .clean-input textarea:disabled,
328
+ .clean-input [disabled] {
329
+ opacity: 1 !important;
330
+ color: var(--ink-1) !important;
331
+ -webkit-text-fill-color: var(--ink-1) !important;
 
 
 
 
 
 
 
332
  }
333
 
334
  .submit-placeholder-note {
 
339
 
340
  .primary-action,
341
  .primary-action button,
342
+ .submit-action-button,
343
+ .submit-action-button button {
344
  min-width: 220px;
345
  width: 220px !important;
346
  border-radius: 12px !important;
 
348
 
349
  .secondary-action,
350
  .secondary-action button,
351
+ .queue-refresh-button,
352
+ .queue-refresh-button button {
353
  width: auto !important;
354
  min-width: 120px;
355
  border-radius: 10px !important;
 
357
 
358
  button.primary,
359
  .primary-action button,
360
+ .submit-action-button button {
361
  background: var(--brand) !important;
362
  border-color: var(--brand) !important;
363
  }
364
 
365
  button.primary:hover,
366
  .primary-action button:hover,
367
+ .submit-action-button button:hover {
368
  background: var(--brand-dark) !important;
369
  border-color: var(--brand-dark) !important;
370
  }
 
383
  .empty-task-note {
384
  width: 100% !important;
385
  max-width: 100% !important;
 
386
  display: block !important;
387
  margin: 10px 0 !important;
388
  padding: 14px 16px !important;