fix: admin stage 진행 — radio + 적용 버튼 제거 (session_state mismatch 버그)
이전/다음 두 버튼만 유지. radio key 고정으로 stage 변경 후 session_state가 stale → 적용 버튼이 의도치 않게 뜨던 문제 제거. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
28
app.py
28
app.py
@@ -644,26 +644,22 @@ def render_admin():
|
||||
stage_order = list(VALID_STAGES) # ("intro", "topics", "vote")
|
||||
idx = stage_order.index(cur) if cur in stage_order else 0
|
||||
|
||||
sc1, sc2, sc3 = st.columns(3)
|
||||
sc1, sc2 = st.columns(2)
|
||||
with sc1:
|
||||
if st.button("← 이전 stage", disabled=(idx == 0)):
|
||||
if st.button(
|
||||
"← 이전 stage",
|
||||
disabled=(idx == 0),
|
||||
use_container_width=True,
|
||||
):
|
||||
set_stage(stage_order[idx - 1])
|
||||
st.rerun()
|
||||
with sc2:
|
||||
chosen = st.radio(
|
||||
"직접 선택",
|
||||
stage_order,
|
||||
index=idx,
|
||||
horizontal=True,
|
||||
label_visibility="collapsed",
|
||||
key="stage_radio",
|
||||
)
|
||||
if chosen != cur:
|
||||
if st.button("적용", key="stage_apply"):
|
||||
set_stage(chosen)
|
||||
st.rerun()
|
||||
with sc3:
|
||||
if st.button("다음 stage →", disabled=(idx == len(stage_order) - 1)):
|
||||
if st.button(
|
||||
"다음 stage →",
|
||||
disabled=(idx == len(stage_order) - 1),
|
||||
type="primary",
|
||||
use_container_width=True,
|
||||
):
|
||||
set_stage(stage_order[idx + 1])
|
||||
st.rerun()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user