Alex Amari commited on
Commit
d80b1a3
·
1 Parent(s): d77c610

Restyle app to match OHA branding

Browse files
__pycache__/app.cpython-312-pytest-7.4.4.pyc CHANGED
Binary files a/__pycache__/app.cpython-312-pytest-7.4.4.pyc and b/__pycache__/app.cpython-312-pytest-7.4.4.pyc differ
 
app.py CHANGED
@@ -636,11 +636,11 @@ custom_css = """
636
  /* --- Global --- */
637
  .gradio-container {
638
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
639
- max-width: 900px !important;
640
  width: 100% !important;
641
  margin: 0 auto !important;
642
- padding-left: 1rem !important;
643
- padding-right: 1rem !important;
644
  background: #FFFFFF !important;
645
  color: #212529 !important;
646
  font-size: 16px !important;
@@ -656,26 +656,23 @@ custom_css = """
656
  font-size: 0.8rem;
657
  padding: 6px 24px;
658
  letter-spacing: 0.03em;
659
- margin: -16px -1rem 0 -1rem;
660
  }
661
- .ct-gov-bar a {
662
  color: #FFFFFF !important;
663
  text-decoration: none;
664
  }
665
- .ct-gov-bar a:hover {
666
  text-decoration: underline;
667
  color: #FFFFFF !important;
668
  }
669
- .ct-gov-bar span {
670
- opacity: 0.85;
671
- }
672
 
673
  /* --- Blue Header Band --- */
674
  .oha-header {
675
  background: #003DA5;
676
  color: #FFFFFF;
677
  padding: 1.25rem 24px;
678
- margin: 0 -1rem 1rem -1rem;
679
  }
680
  .oha-header a {
681
  color: #FFFFFF !important;
@@ -743,31 +740,60 @@ custom_css = """
743
  word-break: break-word;
744
  }
745
 
746
- /* --- Collapse empty Gradio wrappers --- */
747
- .gr-group:empty,
748
- .gr-block:empty,
749
- .gr-box:empty,
750
- .gr-padded:empty {
 
 
 
 
 
 
 
751
  padding: 0 !important;
752
  margin: 0 !important;
753
- min-height: 0 !important;
754
  border: none !important;
755
  box-shadow: none !important;
 
 
 
756
  }
757
- /* Hide Markdown components that have no visible text */
758
- .empty-md, .empty-md * {
 
 
 
 
759
  padding: 0 !important;
760
  margin: 0 !important;
761
  min-height: 0 !important;
762
- font-size: 0 !important;
763
- line-height: 0 !important;
764
  border: none !important;
 
 
 
765
  }
766
- /* Chat separator uses HR inside markdown — collapse its wrapper padding */
767
- .chat-divider {
768
- margin: 0.5rem 0 !important;
 
769
  padding: 0 !important;
770
- min-height: 0 !important;
 
 
 
 
 
 
 
 
 
 
 
 
771
  }
772
 
773
  /* --- Headings --- */
@@ -935,18 +961,18 @@ hr {
935
  /* --- Mobile Responsive --- */
936
  @media (max-width: 640px) {
937
  .gradio-container {
938
- padding-left: 0.5rem !important;
939
- padding-right: 0.5rem !important;
940
  }
941
  .ct-gov-bar {
942
  padding: 6px 12px;
943
- margin-left: -0.5rem;
944
- margin-right: -0.5rem;
945
  }
946
  .oha-header {
947
  padding: 1rem 12px;
948
- margin-left: -0.5rem;
949
- margin-right: -0.5rem;
950
  }
951
  .oha-header h1 {
952
  font-size: 1.35rem !important;
@@ -1018,7 +1044,7 @@ def create_interface():
1018
  )
1019
 
1020
  # Step 1: Choose path
1021
- step1 = gr.Group(visible=True)
1022
  with step1:
1023
  gr.Markdown("### How would you like to start?")
1024
  with gr.Row():
@@ -1034,7 +1060,7 @@ def create_interface():
1034
  )
1035
 
1036
  # Step 2a: Find hospital by ZIP
1037
- step2a = gr.Group(visible=False)
1038
  with step2a:
1039
  gr.Markdown("### Enter your ZIP code")
1040
  zip_input = gr.Textbox(label="ZIP Code", placeholder="e.g., 06511", max_lines=1)
@@ -1046,7 +1072,7 @@ def create_interface():
1046
  back_btn_a = gr.Button("Back", size="sm")
1047
 
1048
  # Step 2b: Select known hospital
1049
- step2b = gr.Group(visible=False)
1050
  with step2b:
1051
  gr.Markdown("### Select your hospital")
1052
  hospital_dropdown = gr.Dropdown(
@@ -1057,7 +1083,7 @@ def create_interface():
1057
  back_btn_b = gr.Button("Back", size="sm")
1058
 
1059
  # Step 3: Eligibility form
1060
- step3 = gr.Group(visible=False)
1061
  with step3:
1062
  selected_hospital_display = gr.Markdown()
1063
 
@@ -1070,7 +1096,7 @@ def create_interface():
1070
  back_btn_c = gr.Button("Back", size="sm")
1071
 
1072
  # Step 4: Results (with streaming) + follow-up chat
1073
- step4 = gr.Group(visible=False)
1074
  with step4:
1075
  results_output = gr.Markdown(elem_classes="results-area")
1076
  with gr.Row():
 
636
  /* --- Global --- */
637
  .gradio-container {
638
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
639
+ max-width: 960px !important;
640
  width: 100% !important;
641
  margin: 0 auto !important;
642
+ padding-left: 1.5rem !important;
643
+ padding-right: 1.5rem !important;
644
  background: #FFFFFF !important;
645
  color: #212529 !important;
646
  font-size: 16px !important;
 
656
  font-size: 0.8rem;
657
  padding: 6px 24px;
658
  letter-spacing: 0.03em;
659
+ margin: -16px -1.5rem 0 -1.5rem;
660
  }
661
+ .ct-gov-bar a, .ct-gov-bar a span, .ct-gov-bar a strong {
662
  color: #FFFFFF !important;
663
  text-decoration: none;
664
  }
665
+ .ct-gov-bar a:hover, .ct-gov-bar a:hover span {
666
  text-decoration: underline;
667
  color: #FFFFFF !important;
668
  }
 
 
 
669
 
670
  /* --- Blue Header Band --- */
671
  .oha-header {
672
  background: #003DA5;
673
  color: #FFFFFF;
674
  padding: 1.25rem 24px;
675
+ margin: 0 -1.5rem 1rem -1.5rem;
676
  }
677
  .oha-header a {
678
  color: #FFFFFF !important;
 
740
  word-break: break-word;
741
  }
742
 
743
+ /* --- Hide invisible step groups completely --- *
744
+ * When Gradio hides a Group, it may set display:none on the element
745
+ * itself or on a wrapper div. The white bars come from leftover
746
+ * border, padding, margin, and flex gap on those elements.
747
+ * We use .step-group elem_classes to target them precisely.
748
+ */
749
+
750
+ /* The step-group element itself when hidden */
751
+ .step-group[style*="display: none"],
752
+ .step-group[style*="display:none"],
753
+ .step-group.hidden,
754
+ .step-group.hide {
755
  padding: 0 !important;
756
  margin: 0 !important;
 
757
  border: none !important;
758
  box-shadow: none !important;
759
+ min-height: 0 !important;
760
+ max-height: 0 !important;
761
+ overflow: hidden !important;
762
  }
763
+
764
+ /* The wrapper div Gradio puts around each Group */
765
+ div:has(> .step-group[style*="display: none"]),
766
+ div:has(> .step-group[style*="display:none"]),
767
+ div:has(> .step-group.hidden),
768
+ div:has(> .step-group.hide) {
769
  padding: 0 !important;
770
  margin: 0 !important;
771
  min-height: 0 !important;
772
+ max-height: 0 !important;
773
+ gap: 0 !important;
774
  border: none !important;
775
+ box-shadow: none !important;
776
+ overflow: hidden !important;
777
+ display: none !important;
778
  }
779
+
780
+ /* Catch-all: any hidden div inside the app should fully collapse */
781
+ .gradio-container div[style*="display: none"],
782
+ .gradio-container div[style*="display:none"] {
783
  padding: 0 !important;
784
+ margin: 0 !important;
785
+ border: none !important;
786
+ box-shadow: none !important;
787
+ max-height: 0 !important;
788
+ overflow: hidden !important;
789
+ }
790
+
791
+ /* Eliminate flex gap contribution from hidden children */
792
+ .gradio-container > div {
793
+ gap: 0 !important;
794
+ }
795
+ .gradio-container > div > div {
796
+ gap: 0 !important;
797
  }
798
 
799
  /* --- Headings --- */
 
961
  /* --- Mobile Responsive --- */
962
  @media (max-width: 640px) {
963
  .gradio-container {
964
+ padding-left: 0.75rem !important;
965
+ padding-right: 0.75rem !important;
966
  }
967
  .ct-gov-bar {
968
  padding: 6px 12px;
969
+ margin-left: -0.75rem;
970
+ margin-right: -0.75rem;
971
  }
972
  .oha-header {
973
  padding: 1rem 12px;
974
+ margin-left: -0.75rem;
975
+ margin-right: -0.75rem;
976
  }
977
  .oha-header h1 {
978
  font-size: 1.35rem !important;
 
1044
  )
1045
 
1046
  # Step 1: Choose path
1047
+ step1 = gr.Group(visible=True, elem_classes="step-group")
1048
  with step1:
1049
  gr.Markdown("### How would you like to start?")
1050
  with gr.Row():
 
1060
  )
1061
 
1062
  # Step 2a: Find hospital by ZIP
1063
+ step2a = gr.Group(visible=False, elem_classes="step-group")
1064
  with step2a:
1065
  gr.Markdown("### Enter your ZIP code")
1066
  zip_input = gr.Textbox(label="ZIP Code", placeholder="e.g., 06511", max_lines=1)
 
1072
  back_btn_a = gr.Button("Back", size="sm")
1073
 
1074
  # Step 2b: Select known hospital
1075
+ step2b = gr.Group(visible=False, elem_classes="step-group")
1076
  with step2b:
1077
  gr.Markdown("### Select your hospital")
1078
  hospital_dropdown = gr.Dropdown(
 
1083
  back_btn_b = gr.Button("Back", size="sm")
1084
 
1085
  # Step 3: Eligibility form
1086
+ step3 = gr.Group(visible=False, elem_classes="step-group")
1087
  with step3:
1088
  selected_hospital_display = gr.Markdown()
1089
 
 
1096
  back_btn_c = gr.Button("Back", size="sm")
1097
 
1098
  # Step 4: Results (with streaming) + follow-up chat
1099
+ step4 = gr.Group(visible=False, elem_classes="step-group")
1100
  with step4:
1101
  results_output = gr.Markdown(elem_classes="results-area")
1102
  with gr.Row():