ljlmike commited on
Commit
8cc7903
Β·
1 Parent(s): b91582f
Files changed (1) hide show
  1. app.py +15 -17
app.py CHANGED
@@ -44,7 +44,7 @@ SHEET_LOCK = threading.Lock()
44
 
45
  def _save_vote(choice: str, query: str, lf_json: Dict[str, Any], ls_json: List[Dict[str, Any]]) -> gr.Textbox:
46
  if not choice:
47
- return gr.update(value="⚠️ Please pick a system.", visible=True)
48
  payload = {
49
  "lean_finder": lf_json,
50
  "lean_search": ls_json,
@@ -57,7 +57,7 @@ def _save_vote(choice: str, query: str, lf_json: Dict[str, Any], ls_json: List[D
57
  ]
58
  with SHEET_LOCK:
59
  worksheet.append_row(row, value_input_option="RAW")
60
- return gr.update(value="βœ… Vote recorded β€” thanks!", visible=True)
61
 
62
  # Rendering contents
63
  def _render_leanfinder(res: List[Dict[str, Any]]) -> str:
@@ -111,14 +111,16 @@ code{background:#f8f8f8;border:1px solid #eee;border-radius:4px;padding:2px 4px;
111
 
112
  /* ---------- arena voting controls ---------- */
113
  #vote_area{
114
- margin-top:1.5rem; /* a bit more breathing room */
115
  align-items:center;
116
- justify-content:center; /* ← NEW: centre the whole block */
117
  gap:1rem;
118
  flex-wrap:wrap;
 
 
119
  }
120
 
121
- #vote_radio_col{ /* ← NEW selector: vertical stack */
122
  display:flex;
123
  flex-direction:column;
124
  align-items:center;
@@ -127,7 +129,7 @@ code{background:#f8f8f8;border:1px solid #eee;border-radius:4px;padding:2px 4px;
127
 
128
  #vote_radio .gr-radio{display:flex;gap:0.75rem;}
129
  #vote_radio label{
130
- padding:4px 14px; /* slightly wider pills */
131
  border:1px solid #ccc;
132
  border-radius:8px;
133
  cursor:pointer;
@@ -139,17 +141,11 @@ code{background:#f8f8f8;border:1px solid #eee;border-radius:4px;padding:2px 4px;
139
  }
140
 
141
  #submit_btn button{
142
- padding:0.65rem 1.6rem; /* button under the radios */
143
  font-weight:600;font-size:1rem;border-radius:8px;
144
  }
145
 
146
- #vote_status textarea{
147
- border:none;
148
- background:#fafafa;
149
- color:#333;
150
- font-weight:600;
151
- text-align:center; /* centre the confirmation text */
152
- }
153
  """
154
 
155
 
@@ -177,11 +173,13 @@ with gr.Blocks(title="Lean Finder Retrieval", css=CUSTOM_CSS) as demo:
177
  elem_id="submit_btn",
178
  variant="primary"
179
  )
180
- vote_status = gr.Textbox(
181
- "", interactive=False,
182
- visible=False, elem_id="vote_status", max_lines=1
 
183
  )
184
 
 
185
  # internal state: stored per browser session
186
  st_query = gr.State("")
187
  st_lf_js = gr.State({})
 
44
 
45
  def _save_vote(choice: str, query: str, lf_json: Dict[str, Any], ls_json: List[Dict[str, Any]]) -> gr.Textbox:
46
  if not choice:
47
+ return gr.update(value="**Please pick a system.**", visible=True)
48
  payload = {
49
  "lean_finder": lf_json,
50
  "lean_search": ls_json,
 
57
  ]
58
  with SHEET_LOCK:
59
  worksheet.append_row(row, value_input_option="RAW")
60
+ return gr.update(value="**Vote recorded β€” thanks!**", visible=True)
61
 
62
  # Rendering contents
63
  def _render_leanfinder(res: List[Dict[str, Any]]) -> str:
 
111
 
112
  /* ---------- arena voting controls ---------- */
113
  #vote_area{
114
+ margin-top:1.5rem;
115
  align-items:center;
116
+ justify-content:center;
117
  gap:1rem;
118
  flex-wrap:wrap;
119
+ border:none!important; /* ← NEW */
120
+ box-shadow:none!important; /* ← NEW */
121
  }
122
 
123
+ #vote_radio_col{
124
  display:flex;
125
  flex-direction:column;
126
  align-items:center;
 
129
 
130
  #vote_radio .gr-radio{display:flex;gap:0.75rem;}
131
  #vote_radio label{
132
+ padding:4px 14px;
133
  border:1px solid #ccc;
134
  border-radius:8px;
135
  cursor:pointer;
 
141
  }
142
 
143
  #submit_btn button{
144
+ padding:0.65rem 1.6rem;
145
  font-weight:600;font-size:1rem;border-radius:8px;
146
  }
147
 
148
+ #vote_status{margin-top:0.5rem;text-align:center;} /* works for Markdown */
 
 
 
 
 
 
149
  """
150
 
151
 
 
173
  elem_id="submit_btn",
174
  variant="primary"
175
  )
176
+ vote_status = gr.Markdown(
177
+ "",
178
+ visible=False,
179
+ elem_id="vote_status"
180
  )
181
 
182
+
183
  # internal state: stored per browser session
184
  st_query = gr.State("")
185
  st_lf_js = gr.State({})