Pointf5ive commited on
Commit
7af990b
·
1 Parent(s): 3379782

Center run analysis button above intake cards

Browse files
Files changed (1) hide show
  1. app.py +92 -6
app.py CHANGED
@@ -158,6 +158,69 @@ footer { display: none !important; }
158
  display: none !important;
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  #path-panel {
162
  display: none !important;
163
  }
@@ -1360,6 +1423,20 @@ HEAD = """
1360
  }
1361
  };
1362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1363
  const bindSidebarCodexLinks = () => {
1364
  const bindings = [
1365
  { selector: '.js-open-dashboard', handler: switchToDashboardTab },
@@ -1388,20 +1465,20 @@ HEAD = """
1388
 
1389
  const observer = new MutationObserver(() => {
1390
  bindSidebarCodexLinks();
1391
- mountIntakeRow();
1392
  });
1393
  observer.observe(document.documentElement, { childList: true, subtree: true });
1394
 
1395
  if (document.readyState === 'loading') {
1396
  document.addEventListener('DOMContentLoaded', () => {
1397
  bindSidebarCodexLinks();
1398
- mountIntakeRow();
1399
  });
1400
  } else {
1401
  bindSidebarCodexLinks();
1402
- mountIntakeRow();
1403
  }
1404
- setInterval(mountIntakeRow, 1000);
1405
  })();
1406
  </script>
1407
  """
@@ -1780,7 +1857,6 @@ def render_status_row(state: dict) -> str:
1780
  return f"""
1781
  <section class="totem-status-row state-{css_state}">
1782
  <div>{message}</div>
1783
- <button class="totem-run-btn" type="button" aria-label="Run TOTEM Analysis visual button">Run TOTEM Analysis</button>
1784
  </section>
1785
  """
1786
 
@@ -2006,6 +2082,9 @@ def render_dashboard(state: dict) -> str:
2006
  {render_topbar(s)}
2007
  {render_hero(s)}
2008
  {render_status_row(s)}
 
 
 
2009
  <section class="totem-intake-host">
2010
  <div id="totem-intake-mount"></div>
2011
  </section>
@@ -3194,9 +3273,16 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3194
  variant="primary",
3195
  scale=1,
3196
  )
3197
- run_button = gr.Button("Run TOTEM Analysis (Bridge v1)", variant="secondary", scale=1)
3198
 
3199
  gr.HTML("<div class='js-workbook-intake-anchor' aria-hidden='true'></div>")
 
 
 
 
 
 
 
 
3200
  with gr.Row(elem_id="intake-row"):
3201
  with gr.Column(scale=1, elem_id="workbook-intake-panel"):
3202
  gr.HTML(
 
158
  display: none !important;
159
  }
160
 
161
+ #totem-run-button-row {
162
+ display: flex !important;
163
+ justify-content: center !important;
164
+ align-items: center !important;
165
+ width: 100%;
166
+ margin: 26px 0 24px !important;
167
+ padding: 0 !important;
168
+ border: 0 !important;
169
+ background: transparent !important;
170
+ box-shadow: none !important;
171
+ }
172
+
173
+ #totem-run-button-row > .gr-column,
174
+ #totem-run-button-row .form,
175
+ #totem-run-button-row .block,
176
+ #totem-run-button-row .wrap {
177
+ display: flex !important;
178
+ justify-content: center !important;
179
+ align-items: center !important;
180
+ width: auto !important;
181
+ min-width: 0 !important;
182
+ padding: 0 !important;
183
+ margin: 0 !important;
184
+ border: 0 !important;
185
+ background: transparent !important;
186
+ box-shadow: none !important;
187
+ }
188
+
189
+ #totem-run-button-row button,
190
+ #totem-run-button-row .gradio-button {
191
+ min-width: 360px !important;
192
+ max-width: 460px !important;
193
+ min-height: 60px !important;
194
+ padding: 0 46px !important;
195
+ border-radius: 999px !important;
196
+ border: 2px solid rgba(87, 224, 255, 0.92) !important;
197
+ background:
198
+ radial-gradient(circle at 10% 0%, rgba(255, 215, 83, 0.24), transparent 32%),
199
+ radial-gradient(circle at 88% 100%, rgba(70, 221, 255, 0.24), transparent 36%),
200
+ linear-gradient(180deg, rgba(15, 14, 42, 0.98), rgba(8, 12, 31, 0.98)) !important;
201
+ color: #ffd86a !important;
202
+ font-family: var(--font-display) !important;
203
+ font-size: 30px !important;
204
+ font-weight: 600 !important;
205
+ letter-spacing: 0.01em !important;
206
+ text-shadow: 0 0 12px rgba(255, 202, 73, 0.56) !important;
207
+ box-shadow:
208
+ 0 0 0 1px rgba(255, 78, 213, 0.78),
209
+ 0 0 22px rgba(83, 224, 255, 0.48),
210
+ 0 0 28px rgba(255, 74, 205, 0.35),
211
+ inset 0 0 18px rgba(255, 218, 94, 0.12) !important;
212
+ }
213
+
214
+ #totem-run-button-row button:hover,
215
+ #totem-run-button-row .gradio-button:hover {
216
+ transform: translateY(-1px);
217
+ box-shadow:
218
+ 0 0 0 1px rgba(255, 113, 221, 0.9),
219
+ 0 0 30px rgba(83, 224, 255, 0.58),
220
+ 0 0 36px rgba(255, 74, 205, 0.42),
221
+ inset 0 0 22px rgba(255, 218, 94, 0.16) !important;
222
+ }
223
+
224
  #path-panel {
225
  display: none !important;
226
  }
 
1423
  }
1424
  };
1425
 
1426
+ const mountRunButton = () => {
1427
+ const mount = document.getElementById('totem-run-mount');
1428
+ const row = document.getElementById('totem-run-button-row');
1429
+ if (!mount || !row) return;
1430
+ if (row.parentElement !== mount) {
1431
+ mount.appendChild(row);
1432
+ }
1433
+ };
1434
+
1435
+ const mountDashboardControls = () => {
1436
+ mountRunButton();
1437
+ mountIntakeRow();
1438
+ };
1439
+
1440
  const bindSidebarCodexLinks = () => {
1441
  const bindings = [
1442
  { selector: '.js-open-dashboard', handler: switchToDashboardTab },
 
1465
 
1466
  const observer = new MutationObserver(() => {
1467
  bindSidebarCodexLinks();
1468
+ mountDashboardControls();
1469
  });
1470
  observer.observe(document.documentElement, { childList: true, subtree: true });
1471
 
1472
  if (document.readyState === 'loading') {
1473
  document.addEventListener('DOMContentLoaded', () => {
1474
  bindSidebarCodexLinks();
1475
+ mountDashboardControls();
1476
  });
1477
  } else {
1478
  bindSidebarCodexLinks();
1479
+ mountDashboardControls();
1480
  }
1481
+ setInterval(mountDashboardControls, 1000);
1482
  })();
1483
  </script>
1484
  """
 
1857
  return f"""
1858
  <section class="totem-status-row state-{css_state}">
1859
  <div>{message}</div>
 
1860
  </section>
1861
  """
1862
 
 
2082
  {render_topbar(s)}
2083
  {render_hero(s)}
2084
  {render_status_row(s)}
2085
+ <section class="totem-run-host">
2086
+ <div id="totem-run-mount"></div>
2087
+ </section>
2088
  <section class="totem-intake-host">
2089
  <div id="totem-intake-mount"></div>
2090
  </section>
 
3273
  variant="primary",
3274
  scale=1,
3275
  )
 
3276
 
3277
  gr.HTML("<div class='js-workbook-intake-anchor' aria-hidden='true'></div>")
3278
+ with gr.Row(elem_id="totem-run-button-row"):
3279
+ run_button = gr.Button(
3280
+ "✦ Run TOTEM Analysis ✦",
3281
+ variant="secondary",
3282
+ elem_id="totem-analysis-button",
3283
+ elem_classes=["totem-run-control"],
3284
+ )
3285
+
3286
  with gr.Row(elem_id="intake-row"):
3287
  with gr.Column(scale=1, elem_id="workbook-intake-panel"):
3288
  gr.HTML(