Pointf5ive commited on
Commit
88f2930
·
1 Parent(s): 3c0529c

Make dashboard intake windows compact branded upload controls

Browse files
Files changed (1) hide show
  1. app.py +62 -53
app.py CHANGED
@@ -604,30 +604,33 @@ TOTEM_CSS = """
604
  #totem-intake-mount #intake-row {
605
  display: grid !important;
606
  grid-template-columns: repeat(2, minmax(280px, 1fr));
607
- gap: 16px;
608
  margin: 0;
609
  }
610
 
611
  #totem-intake-mount #intake-row > .gr-column {
612
  border: 1px solid rgba(236, 130, 214, 0.48);
613
- border-radius: 16px;
614
  background:
615
- radial-gradient(520px 190px at 100% 0%, rgba(126, 72, 196, 0.32), transparent 70%),
616
- radial-gradient(420px 220px at 0% 100%, rgba(43, 69, 154, 0.22), transparent 72%),
617
- linear-gradient(180deg, rgba(17, 20, 63, 0.96), rgba(10, 14, 42, 0.96));
618
  box-shadow:
619
- inset 0 0 0 1px rgba(255, 212, 123, 0.16),
620
- 0 8px 22px rgba(4, 6, 22, 0.48);
621
- padding: 12px 14px 14px !important;
622
- min-height: 172px;
 
 
 
623
  }
624
 
625
  #totem-intake-mount #intake-row .intake-card-head {
626
  display: flex;
627
  align-items: center;
628
  justify-content: space-between;
629
- gap: 10px;
630
- margin-bottom: 10px;
631
  }
632
 
633
  #totem-intake-mount #intake-row .intake-brand {
@@ -637,9 +640,9 @@ TOTEM_CSS = """
637
  }
638
 
639
  #totem-intake-mount #intake-row .intake-brand img {
640
- width: 40px;
641
- height: 40px;
642
- border-radius: 10px;
643
  object-fit: cover;
644
  box-shadow: 0 0 0 1px rgba(255, 220, 170, 0.14);
645
  }
@@ -647,45 +650,57 @@ TOTEM_CSS = """
647
  #totem-intake-mount #intake-row .intake-brand strong {
648
  display: block;
649
  color: #f4ece2;
650
- font-size: 34px;
651
- line-height: 1.05;
 
 
652
  margin-bottom: 2px;
653
  }
654
 
655
  #totem-intake-mount #intake-row .intake-brand span {
656
  display: block;
657
  color: rgba(215, 223, 243, 0.88);
658
- font-size: 20px;
659
- letter-spacing: 0.02em;
 
660
  }
661
 
662
  #totem-intake-mount #intake-row .intake-cloud {
663
- width: 56px;
664
- height: 56px;
665
  border-radius: 50%;
666
  border: 1px solid rgba(206, 136, 254, 0.42);
667
  display: grid;
668
  place-items: center;
669
  font-size: 26px;
670
  color: #d7b6ff;
671
- background: rgba(31, 33, 79, 0.45);
672
- }
673
-
674
- #totem-intake-mount #intake-row .gr-file {
675
- border: 1px dashed rgba(205, 135, 255, 0.5) !important;
676
- border-radius: 12px !important;
677
- background: rgba(8, 15, 44, 0.62) !important;
678
- min-height: 56px;
679
- max-height: 56px;
680
- overflow: hidden;
681
- }
682
-
683
- #totem-intake-mount #intake-row button {
684
- border-radius: 10px !important;
 
 
 
 
 
 
 
 
 
685
  }
686
 
687
- #totem-intake-mount #intake-row .gr-file .wrap {
688
- min-height: 56px !important;
689
  }
690
 
691
  @media (max-width: 1080px) {
@@ -3122,7 +3137,6 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3122
  run_button = gr.Button("Run TOTEM Analysis (Bridge v1)", variant="secondary", scale=1)
3123
 
3124
  gr.HTML("<div class='js-workbook-intake-anchor' aria-hidden='true'></div>")
3125
- gr.Markdown("### Intake Windows")
3126
  with gr.Row(elem_id="intake-row"):
3127
  with gr.Column(scale=1, elem_id="workbook-intake-panel"):
3128
  gr.HTML(
@@ -3130,23 +3144,22 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3130
  <div class="intake-card-head">
3131
  <div class="intake-brand">
3132
  <img src="/gradio_api/file=assets/Brand/excel.png" alt="Excel" />
3133
- <div><strong>Workbook</strong><span>Drop .xlsx</span></div>
3134
  </div>
3135
  <div class="intake-cloud">☁</div>
3136
  </div>
3137
  """
3138
  )
3139
- dashboard_workbook_file = gr.File(
3140
- label="Workbook (.xlsx or .xlsm)",
3141
  file_types=[".xlsx", ".xlsm"],
3142
  type="filepath",
3143
- show_label=False,
3144
  )
3145
- dashboard_set_workbook = gr.Button("Set Active Workbook", variant="primary")
3146
  workbook_home_display = gr.Textbox(
3147
  label="Active workbook home path",
3148
  value=str(_preferred_workbook_path()),
3149
  interactive=False,
 
3150
  )
3151
 
3152
  with gr.Column(scale=1, elem_id="codex-panel"):
@@ -3155,27 +3168,23 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3155
  <div class="intake-card-head">
3156
  <div class="intake-brand">
3157
  <img src="/gradio_api/file=assets/Brand/word.png" alt="Word" />
3158
- <div><strong>Manuscript</strong><span>Drop .docx</span></div>
3159
  </div>
3160
  <div class="intake-cloud">☁</div>
3161
  </div>
3162
  """
3163
  )
3164
- dashboard_manuscript_file = gr.File(
3165
- label="Manuscript (.txt, .docx, or .pdf)",
3166
- file_types=[".txt", ".docx", ".pdf"],
3167
  type="filepath",
3168
- show_label=False,
3169
- )
3170
- dashboard_manuscript_analyze = gr.Button(
3171
- "Analyze Manuscript (No Auto-Score)",
3172
- variant="primary",
3173
  )
3174
  dashboard_manuscript_status = gr.Textbox(
3175
  label="Pipeline status",
3176
  interactive=False,
3177
  lines=2,
3178
  value="Ready.",
 
3179
  )
3180
 
3181
  with gr.Accordion("Bridge Diagnostics", open=False):
@@ -3351,7 +3360,7 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3351
  # demo.load removed: user triggers load via Run TOTEM Analysis button
3352
  workbook_upload.upload(load_uploaded, inputs=[workbook_upload],
3353
  outputs=[active_path, dashboard, log_state, score_status])
3354
- dashboard_set_workbook.click(
3355
  set_active_workbook,
3356
  inputs=[dashboard_workbook_file],
3357
  outputs=[workbook_home_display, path_input, active_path, dashboard, log_state, score_status],
@@ -3363,7 +3372,7 @@ with gr.Blocks(title="TOTEM Studio") as demo:
3363
  )
3364
  path_button.click(load_local_path, inputs=[path_input],
3365
  outputs=[active_path, dashboard, log_state, score_status])
3366
- dashboard_manuscript_analyze.click(
3367
  analyze_manuscript_for_dashboard,
3368
  inputs=[dashboard_manuscript_file, active_path],
3369
  outputs=[
 
604
  #totem-intake-mount #intake-row {
605
  display: grid !important;
606
  grid-template-columns: repeat(2, minmax(280px, 1fr));
607
+ gap: 12px;
608
  margin: 0;
609
  }
610
 
611
  #totem-intake-mount #intake-row > .gr-column {
612
  border: 1px solid rgba(236, 130, 214, 0.48);
613
+ border-radius: 8px;
614
  background:
615
+ radial-gradient(150px 72px at 98% 18%, rgba(126, 72, 196, 0.32), transparent 72%),
616
+ radial-gradient(220px 100px at 0% 0%, rgba(132, 53, 151, 0.18), transparent 64%),
617
+ linear-gradient(180deg, rgba(13, 13, 43, 0.98), rgba(8, 10, 33, 0.98));
618
  box-shadow:
619
+ inset 0 0 0 1px rgba(255, 214, 112, 0.16),
620
+ 0 0 24px rgba(179, 86, 245, 0.12);
621
+ min-height: 88px;
622
+ max-height: 88px;
623
+ padding: 10px 12px !important;
624
+ position: relative;
625
+ overflow: hidden;
626
  }
627
 
628
  #totem-intake-mount #intake-row .intake-card-head {
629
  display: flex;
630
  align-items: center;
631
  justify-content: space-between;
632
+ gap: 12px;
633
+ height: 68px;
634
  }
635
 
636
  #totem-intake-mount #intake-row .intake-brand {
 
640
  }
641
 
642
  #totem-intake-mount #intake-row .intake-brand img {
643
+ width: 48px;
644
+ height: 48px;
645
+ border-radius: 8px;
646
  object-fit: cover;
647
  box-shadow: 0 0 0 1px rgba(255, 220, 170, 0.14);
648
  }
 
650
  #totem-intake-mount #intake-row .intake-brand strong {
651
  display: block;
652
  color: #f4ece2;
653
+ font-family: var(--font-display);
654
+ font-size: 20px;
655
+ line-height: 1.1;
656
+ font-weight: 500;
657
  margin-bottom: 2px;
658
  }
659
 
660
  #totem-intake-mount #intake-row .intake-brand span {
661
  display: block;
662
  color: rgba(215, 223, 243, 0.88);
663
+ font-size: 13px;
664
+ line-height: 1.2;
665
+ letter-spacing: 0;
666
  }
667
 
668
  #totem-intake-mount #intake-row .intake-cloud {
669
+ width: 64px;
670
+ height: 64px;
671
  border-radius: 50%;
672
  border: 1px solid rgba(206, 136, 254, 0.42);
673
  display: grid;
674
  place-items: center;
675
  font-size: 26px;
676
  color: #d7b6ff;
677
+ background: rgba(22, 19, 58, 0.68);
678
+ }
679
+
680
+ #totem-intake-mount #intake-row .intake-fileline {
681
+ width: 118px;
682
+ height: 2px;
683
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent);
684
+ margin-top: 7px;
685
+ }
686
+
687
+ #totem-intake-mount #intake-row .gradio-button {
688
+ position: absolute !important;
689
+ left: 170px;
690
+ bottom: 18px;
691
+ min-width: 78px !important;
692
+ min-height: 28px !important;
693
+ padding: 0 18px !important;
694
+ border-radius: 4px !important;
695
+ border: 1px solid rgba(171, 100, 239, 0.72) !important;
696
+ background: linear-gradient(180deg, rgba(60, 32, 106, 0.95), rgba(36, 20, 76, 0.95)) !important;
697
+ color: rgba(238, 226, 255, 0.98) !important;
698
+ font-size: 13px !important;
699
+ box-shadow: 0 0 10px rgba(140, 78, 255, 0.22) !important;
700
  }
701
 
702
+ #totem-intake-mount #intake-row .hidden-intake-field {
703
+ display: none !important;
704
  }
705
 
706
  @media (max-width: 1080px) {
 
3137
  run_button = gr.Button("Run TOTEM Analysis (Bridge v1)", variant="secondary", scale=1)
3138
 
3139
  gr.HTML("<div class='js-workbook-intake-anchor' aria-hidden='true'></div>")
 
3140
  with gr.Row(elem_id="intake-row"):
3141
  with gr.Column(scale=1, elem_id="workbook-intake-panel"):
3142
  gr.HTML(
 
3144
  <div class="intake-card-head">
3145
  <div class="intake-brand">
3146
  <img src="/gradio_api/file=assets/Brand/excel.png" alt="Excel" />
3147
+ <div><strong>Workbook</strong><span>Drop .xlsx</span><div class="intake-fileline"></div></div>
3148
  </div>
3149
  <div class="intake-cloud">☁</div>
3150
  </div>
3151
  """
3152
  )
3153
+ dashboard_workbook_file = gr.UploadButton(
3154
+ "Browse",
3155
  file_types=[".xlsx", ".xlsm"],
3156
  type="filepath",
 
3157
  )
 
3158
  workbook_home_display = gr.Textbox(
3159
  label="Active workbook home path",
3160
  value=str(_preferred_workbook_path()),
3161
  interactive=False,
3162
+ elem_classes=["hidden-intake-field"],
3163
  )
3164
 
3165
  with gr.Column(scale=1, elem_id="codex-panel"):
 
3168
  <div class="intake-card-head">
3169
  <div class="intake-brand">
3170
  <img src="/gradio_api/file=assets/Brand/word.png" alt="Word" />
3171
+ <div><strong>Manuscript</strong><span>Drop .docx</span><div class="intake-fileline"></div></div>
3172
  </div>
3173
  <div class="intake-cloud">☁</div>
3174
  </div>
3175
  """
3176
  )
3177
+ dashboard_manuscript_file = gr.UploadButton(
3178
+ "Browse",
3179
+ file_types=[".docx"],
3180
  type="filepath",
 
 
 
 
 
3181
  )
3182
  dashboard_manuscript_status = gr.Textbox(
3183
  label="Pipeline status",
3184
  interactive=False,
3185
  lines=2,
3186
  value="Ready.",
3187
+ elem_classes=["hidden-intake-field"],
3188
  )
3189
 
3190
  with gr.Accordion("Bridge Diagnostics", open=False):
 
3360
  # demo.load removed: user triggers load via Run TOTEM Analysis button
3361
  workbook_upload.upload(load_uploaded, inputs=[workbook_upload],
3362
  outputs=[active_path, dashboard, log_state, score_status])
3363
+ dashboard_workbook_file.upload(
3364
  set_active_workbook,
3365
  inputs=[dashboard_workbook_file],
3366
  outputs=[workbook_home_display, path_input, active_path, dashboard, log_state, score_status],
 
3372
  )
3373
  path_button.click(load_local_path, inputs=[path_input],
3374
  outputs=[active_path, dashboard, log_state, score_status])
3375
+ dashboard_manuscript_file.upload(
3376
  analyze_manuscript_for_dashboard,
3377
  inputs=[dashboard_manuscript_file, active_path],
3378
  outputs=[