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:
th-kim0823
2026-04-27 21:23:10 +09:00
parent 75aa0349ff
commit 447f067ae9

28
app.py
View File

@@ -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()