Bit-Trading-Company commited on
Commit
e5eae78
·
verified ·
1 Parent(s): c425891

CI deploy af874966

Browse files
Files changed (2) hide show
  1. app.py +11 -8
  2. src/ui/theme.py +6 -18
app.py CHANGED
@@ -475,14 +475,17 @@ def build_app() -> gr.Blocks:
475
  action_trigger = gr.Button("", elem_id=TRIGGER_ELEMENT_ID,
476
  visible=True, variant="secondary")
477
 
478
- # The header is a Row so a real `gr.LoginButton` can sit inside the
479
- # bar. That component is also what makes Gradio mount the OAuth routes
480
- # at all -- without it, /login/huggingface is a 404.
481
- with gr.Row(elem_classes="bit-headerbar"):
482
- top_html = gr.HTML(render_top(boot, None))
483
- if ON_SPACE:
484
- gr.LoginButton(value="Sign in with Hugging Face", size="sm",
485
- elem_classes="bit-login-btn", scale=0)
 
 
 
486
 
487
  with gr.Row(elem_classes="bit-zones", equal_height=False):
488
  # Strategy Builder belongs to the Backtest tab only.
 
475
  action_trigger = gr.Button("", elem_id=TRIGGER_ELEMENT_ID,
476
  visible=True, variant="secondary")
477
 
478
+ top_html = gr.HTML(render_top(boot, None))
479
+
480
+ # `gr.LoginButton`, plain and unwrapped. It is what makes Gradio mount
481
+ # the OAuth routes at all -- without it /login/huggingface is a 404 --
482
+ # and it is deliberately NOT nested in a custom sticky flex row or
483
+ # given layout overrides. Dressing it up is what coincided with the
484
+ # redirect loop, and a sign-in that works is worth more than one that
485
+ # sits perfectly in the header bar.
486
+ if ON_SPACE:
487
+ with gr.Row(elem_classes="bit-loginrow"):
488
+ gr.LoginButton(value="Sign in with Hugging Face", size="sm")
489
 
490
  with gr.Row(elem_classes="bit-zones", equal_height=False):
491
  # Strategy Builder belongs to the Backtest tab only.
src/ui/theme.py CHANGED
@@ -464,24 +464,12 @@ html, body{ height:auto !important; min-height:0 !important; }
464
  max-height:560px !important;
465
  }
466
 
467
- /* The header is a Gradio Row wrapping the design's <header> plus the real
468
- LoginButton, so it must not add spacing of its own. */
469
- .bit-headerbar{
470
- position:sticky; top:0; z-index:var(--z-header);
471
- gap:0 !important; align-items:stretch !important; flex-wrap:nowrap !important;
472
- background:var(--bg-panel); border-bottom:1px solid var(--border-default);
473
- }
474
- .bit-headerbar > *:first-child{ flex:1 1 auto; min-width:0; }
475
- .bit-headerbar header{ position:static !important; border-bottom:0 !important; }
476
- .bit-login-btn{
477
- align-self:center; margin-right:12px !important; flex:0 0 auto !important;
478
- background:var(--accent-amber) !important; color:var(--stone-950) !important;
479
- border:1px solid var(--accent-amber) !important;
480
- font-family:var(--font-mono) !important; font-size:var(--text-2xs) !important;
481
- padding:3px 8px !important; white-space:nowrap;
482
- }
483
- .bit-login-btn:hover{
484
- background:var(--stone-950) !important; color:var(--accent-amber) !important;
485
  }
486
 
487
  /* ================= header help tooltip =================
 
464
  max-height:560px !important;
465
  }
466
 
467
+ /* The sign-in row sits directly under the header. Colour only -- no layout,
468
+ positioning or pointer overrides on the OAuth control itself. */
469
+ .bit-loginrow{
470
+ padding:6px 12px !important; gap:0 !important;
471
+ background:var(--bg-panel);
472
+ border-bottom:1px solid var(--border-default);
 
 
 
 
 
 
 
 
 
 
 
 
473
  }
474
 
475
  /* ================= header help tooltip =================