components.number_input_slider: the value parameter is ignored #26

Open
opened 2026-10-06 13:48:49 +00:00 by ffrauenberger · 1 comment
Owner

Severity: low (callers cannot set a start value)

Where

  • app/components/number_input_slider.py:4-66

Problem

The function takes value and documents it as "Default value of the slider and number input field", but never passes it to st.slider or st.number_input. It also reads st.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

  1. Call number_input_slider(..., value=X) with a key that is not yet in the session state

Expected behavior

Slider and number input start at X.

Actual behavior

Both start at the minimum value.

Fix

Seed st.session_state[key] from value if the key is missing, or pass value to the widgets.


from issues/BUG-026-number-input-slider-ignores-value-parameter.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** low (callers cannot set a start value) ## Where - `app/components/number_input_slider.py:4-66` ## Problem The function takes `value` and documents it as *"Default value of the slider and number input field"*, but never passes it to `st.slider` or `st.number_input`. It also reads `st.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 1. Call `number_input_slider(..., value=X)` with a key that is not yet in the session state ### Expected behavior Slider and number input start at `X`. ### Actual behavior Both start at the minimum value. ## Fix Seed `st.session_state[key]` from `value` if the key is missing, or pass `value` to the widgets. --- from `issues/BUG-026-number-input-slider-ignores-value-parameter.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

Reviewed by Codex (GPT-6) against origin/main 6bcc646eb464.

Review: partially correct.

The ignored value parameter is confirmed: an AppTest call with range 0–10 and value=7 starts both widgets at 0. The claimed need to pre-seed session state is incorrect, though: a keyed st.slider itself initializes st.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 from value, or pass a suitable widget default while respecting an existing keyed value.

Code references: app/components/number_input_slider.py:45.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: partially correct.** The ignored `value` parameter is confirmed: an AppTest call with range 0–10 and `value=7` starts both widgets at 0. The claimed need to pre-seed session state is incorrect, though: a keyed `st.slider` itself initializes `st.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 from `value`, or pass a suitable widget default while respecting an existing keyed value. Code references: [app/components/number_input_slider.py:45](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/components/number_input_slider.py#L45).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#26
No description provided.