Skip to content

Fix: device-model dropdown snapped back and never saved - #35

Merged
maun200 merged 1 commit into
mainfrom
fix/machine-model-dropdown-resets-v2
Nov 12, 2026
Merged

maun200 merged 1 commit into
mainfrom
fix/machine-model-dropdown-resets-v2

Conversation

@maun200

@maun200 maun200 commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • fillMachineModels() reset the "Model on this device" <select> to the server's last-known value on every call, not just when it rebuilt the option list.
  • The model-change handler called it first, before the new value ever reached registerMachine() — so the pick was always overwritten before saving, and the dropdown visibly snapped back with no change ever persisted.
  • Fix: only reset the value when the option list itself is actually rebuilt (allowed models changed, or first render); leave the current selection alone on every other call.

Why

Reported by the operator: picking a different model in "Modell auf diesem Gerät" immediately jumped back to the original entry, with no way to change it.

Test plan

  • pytest -q (239 passed, 3 skipped — unrelated to this change, no existing test covered this path)
  • ruff check --select E9,F63,F7,F82 .
  • Isolated Node simulation of fillMachineModels()'s logic confirms a user's fresh selection survives the handler's own re-render call (previously it did not).
  • Manual click-through in a real browser not done in this session (no GUI available here) — worth a quick confirmation in the running app before merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_014XvdYnanfEU1LisNWNpubA

fillMachineModels() unconditionally reset the <select> to the server's
last-known machine model on every call, not just when it rebuilt the
option list. The model-change handler called it first, before the new
value ever reached registerMachine()/the server - so every pick was
overwritten by the function meant to render it, and the dropdown always
snapped back with no change ever saved.

Only reset the value when the option list is actually being rebuilt
(allowed models changed or first render); leave the user's current
selection alone otherwise.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014XvdYnanfEU1LisNWNpubA
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T22:11:25.089171Z 31091ae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@maun200
maun200 merged commit 512b0cc into main Nov 12, 2026
14 checks passed
@maun200
maun200 deleted the fix/machine-model-dropdown-resets-v2 branch November 12, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant