forked from SWISDATA/processintel
components.number_input_slider: the value parameter is ignored #26
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: low (callers cannot set a start value)
Where
app/components/number_input_slider.py:4-66Problem
The function takes
valueand documents it as "Default value of the slider and number input field", but never passes it tost.sliderorst.number_input. It also readsst.session_state[key]right after creating the slider, so it relies on the caller having pre-seeded the session state, which every controller currently does manually.Steps to reproduce
number_input_slider(..., value=X)with a key that is not yet in the session stateExpected behavior
Slider and number input start at
X.Actual behavior
Both start at the minimum value.
Fix
Seed
st.session_state[key]fromvalueif the key is missing, or passvalueto the widgets.from
issues/BUG-026-number-input-slider-ignores-value-parameter.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The ignored
valueparameter is confirmed: an AppTest call with range 0–10 andvalue=7starts both widgets at 0. The claimed need to pre-seed session state is incorrect, though: a keyedst.slideritself initializesst.session_state[key], so reading it immediately afterward works without a controller seed. The actual issue is the wrong default, not a missing-key requirement. Seed only an absent key fromvalue, or pass a suitable widget default while respecting an existing keyed value.Code references: app/components/number_input_slider.py:45.