JaydeepR commited on
Commit
ad20db7
·
1 Parent(s): 8a64f5c

Fix nested expander: show reason/snippet inline inside criteria toggle

Browse files
Files changed (1) hide show
  1. ui/tab_bidders.py +18 -20
ui/tab_bidders.py CHANGED
@@ -178,26 +178,24 @@ def render() -> None:
178
 
179
  reason = v.get("reason", "")
180
  snippet = (v.get("source") or {}).get("snippet", "")
181
- if reason or snippet:
182
- with st.expander("View reasoning & evidence", expanded=False):
183
- if reason:
184
- st.markdown(
185
- f'<div style="background:rgba(37,99,235,0.08);'
186
- f'border-left:3px solid #3B82F6;padding:10px 14px;'
187
- f'border-radius:0 8px 8px 0;font-size:0.875rem;'
188
- f'color:var(--text-color);">'
189
- f'<strong>Reason:</strong> {reason}</div>',
190
- unsafe_allow_html=True,
191
- )
192
- if snippet:
193
- st.markdown(
194
- f'<div style="background:rgba(245,158,11,0.08);'
195
- f'border-left:3px solid #F59E0B;padding:10px 14px;'
196
- f'border-radius:0 8px 8px 0;margin-top:8px;'
197
- f'font-size:0.84rem;color:var(--text-color);font-style:italic;">'
198
- f'&ldquo;{snippet}&rdquo;</div>',
199
- unsafe_allow_html=True,
200
- )
201
 
202
  st.markdown(
203
  '<hr style="margin:2px 0;border:none;'
 
178
 
179
  reason = v.get("reason", "")
180
  snippet = (v.get("source") or {}).get("snippet", "")
181
+ if reason:
182
+ st.markdown(
183
+ f'<div style="background:rgba(37,99,235,0.08);'
184
+ f'border-left:3px solid #3B82F6;padding:8px 12px;'
185
+ f'border-radius:0 6px 6px 0;font-size:0.82rem;'
186
+ f'color:var(--text-color);margin-top:2px;">'
187
+ f'<strong>Reason:</strong> {reason}</div>',
188
+ unsafe_allow_html=True,
189
+ )
190
+ if snippet:
191
+ st.markdown(
192
+ f'<div style="background:rgba(245,158,11,0.08);'
193
+ f'border-left:3px solid #F59E0B;padding:8px 12px;'
194
+ f'border-radius:0 6px 6px 0;margin-top:4px;'
195
+ f'font-size:0.81rem;color:var(--text-color);font-style:italic;">'
196
+ f'&ldquo;{snippet}&rdquo;</div>',
197
+ unsafe_allow_html=True,
198
+ )
 
 
199
 
200
  st.markdown(
201
  '<hr style="margin:2px 0;border:none;'