Lzy01241010 commited on
Commit
d551235
·
1 Parent(s): 48d0150

Memory Strategy: replace buggy Dropdown with Radio (4 stacked options); slider value text centered

Browse files
Files changed (1) hide show
  1. app.py +45 -10
app.py CHANGED
@@ -674,14 +674,49 @@ gradio-app > div {
674
  padding: 0 !important;
675
  border-radius: 0 !important;
676
  }
677
- /* But keep the actual interactive control visible (the dropdown's select
678
- container needs to keep its own border so users can see the box). */
679
- #quest-memory-strategy [data-testid="dropdown"],
680
- #quest-memory-strategy .gradio-dropdown {
681
- background: var(--q-paper) !important;
682
- border: 1px solid var(--q-line-strong) !important;
683
- border-radius: var(--q-radius-md) !important;
684
- min-height: 46px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
686
 
687
  /* Slider head input (the "[6 ↺]" / "[1 ↺]" pill next to the slider track):
@@ -697,7 +732,7 @@ gradio-app > div {
697
  padding: 0 !important;
698
  min-height: 0 !important;
699
  height: auto !important;
700
- text-align: right !important;
701
  width: 3.5em !important;
702
  font-weight: 600 !important;
703
  color: var(--q-text) !important;
@@ -1873,7 +1908,7 @@ with gr.Blocks(
1873
  value=QUEST_MODEL_ID,
1874
  interactive=False,
1875
  )
1876
- memory_strategy = gr.Dropdown(
1877
  label="Memory Strategy",
1878
  choices=list(MEMORY_STRATEGIES),
1879
  value="condenser",
 
674
  padding: 0 !important;
675
  border-radius: 0 !important;
676
  }
677
+ /* Memory Strategy radio: stack vertically, terracotta-tinted check state. */
678
+ #quest-memory-strategy .wrap,
679
+ #quest-memory-strategy fieldset,
680
+ #quest-memory-strategy [data-testid="radio"] {
681
+ display: flex !important;
682
+ flex-direction: column !important;
683
+ gap: 6px !important;
684
+ background: transparent !important;
685
+ border: 0 !important;
686
+ padding: 0 !important;
687
+ }
688
+ #quest-memory-strategy label {
689
+ background: transparent !important;
690
+ border: 1px solid var(--q-line) !important;
691
+ border-radius: 8px !important;
692
+ padding: 8px 12px !important;
693
+ cursor: pointer !important;
694
+ font-weight: 500 !important;
695
+ font-size: 0.95rem !important;
696
+ color: var(--q-text) !important;
697
+ text-transform: none !important;
698
+ letter-spacing: 0 !important;
699
+ display: flex !important;
700
+ align-items: center !important;
701
+ gap: 10px !important;
702
+ transition: border-color 120ms ease, background 120ms ease;
703
+ }
704
+ #quest-memory-strategy label:hover {
705
+ border-color: var(--q-accent-line) !important;
706
+ background: var(--q-accent-soft) !important;
707
+ }
708
+ #quest-memory-strategy input[type="radio"] {
709
+ accent-color: var(--q-accent) !important;
710
+ width: 16px !important;
711
+ height: 16px !important;
712
+ }
713
+ #quest-memory-strategy label.selected,
714
+ #quest-memory-strategy input[type="radio"]:checked + span,
715
+ #quest-memory-strategy label:has(input[type="radio"]:checked) {
716
+ border-color: var(--q-accent) !important;
717
+ background: var(--q-accent-soft) !important;
718
+ color: var(--q-text) !important;
719
+ font-weight: 600 !important;
720
  }
721
 
722
  /* Slider head input (the "[6 ↺]" / "[1 ↺]" pill next to the slider track):
 
732
  padding: 0 !important;
733
  min-height: 0 !important;
734
  height: auto !important;
735
+ text-align: center !important;
736
  width: 3.5em !important;
737
  font-weight: 600 !important;
738
  color: var(--q-text) !important;
 
1908
  value=QUEST_MODEL_ID,
1909
  interactive=False,
1910
  )
1911
+ memory_strategy = gr.Radio(
1912
  label="Memory Strategy",
1913
  choices=list(MEMORY_STRATEGIES),
1914
  value="condenser",