feat: presentation demo mode — one-click private demo patient, screening on/off switch
CI / ruff · pytest (pull_request) Failing after 2m33s
CI / ruff · pytest (pull_request) Failing after 2m33s
- POST /auth/demo/fresh + «Демо: войти как Андрей» on the welcome screen: every sign-in gets a fresh private copy of veteran Andrey (consent, prescription, ЕМИАС record) and lands in the chat — no codes, nobody's crisis or half-done questionnaire leaks into another viewer. - Initial screening switch: SCREENING_ENABLED env default + /demo/settings + a toggle in the demo console; off → after consent straight to the chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,20 @@ w.render_connect_hero()
|
||||
w.show_flash()
|
||||
st.sidebar.caption(f"API: {w.get_api().base_url}")
|
||||
|
||||
# One switch for the presentation: initial questionnaires after consent on/off (off → straight to the chat).
|
||||
try:
|
||||
_screening = bool(w.get_api().demo_settings().get("screening_enabled", True))
|
||||
_wanted = st.sidebar.toggle(
|
||||
"Начальный тест (скрининг)",
|
||||
value=_screening,
|
||||
help="Выключено: после согласия пациент сразу попадает в чат, без опросников.",
|
||||
)
|
||||
if _wanted != _screening:
|
||||
w.get_api().set_screening(_wanted)
|
||||
st.sidebar.success("Начальный тест " + ("включён" if _wanted else "выключен"))
|
||||
except Exception: # noqa: BLE001 — the switch must never break the console
|
||||
st.sidebar.caption("Переключатель теста недоступен (API)")
|
||||
|
||||
with st.container(border=True, key="panel-console-clock"):
|
||||
w.render_clock_bar(persona, key="console-clock")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user