Repository navigation
Conversation
tobocop2
marked this pull request as ready for review
September 27, 2026 14:38
Blur compared the input text to cfg's stored value, which is None for a field deferring to the chat model's own default. The default's text (temperature's "0.7") never equals "None", so tabbing past an untouched field wrote it into config.toml as a user value. Track what each Input and multi-line editor showed when the row was built (or last reset), and blur saves only when the text differs from that instead of from cfg.
No writable multi-line setting is nullable with a model default today, so make_multiline_editor's new marker strip has nothing live to drive it red or green through the UI. Call it directly instead.
Set the mount-display baseline only after a persist succeeds, not before attempting it, so an invalid value never poisons the baseline; a second identical invalid blur still notifies. Extract the " (model default)" marker into one constant with a strip helper, used by the producer and both strippers. List-typed and Select-backed settings now go through the same mount-baseline compare-before-save rule as scalar editors: a list's baseline comes from its cfg value at construction, and a Select's baseline from the matching choice rather than the widget's value reactive, which is not populated from the constructor argument until the widget mounts. Reading it earlier saw the pre-mount default and made every Select-backed setting look edited on its first render. Checkbox saves stay unconditional; Checkbox.Changed only fires on a user toggle.
Restore already loads the default text and persists it; add a test that blurring the field right after, unedited, does not persist again. It first edits the field so its baseline diverges from the default, so a restore that forgot to refresh the baseline would still show as a change on the next blur.
The test pressed Tab once for each of the 68 focusable widgets on the Generation tab, and every settled focus change rebuilds the footer and restyles the settings screen. That took 22 to 29 seconds on macOS and more than 60 on the Windows runner, where pytest-timeout ends the xdist worker with os._exit, which xdist reports as a crashed node. Only an Input or a ListTextArea saves on blur, so the test now moves focus through those editors alone, in one batch, and lets it settle once on a reset button. It still fails when the input blur handler compares against the stored config value instead of the shown text.
tobocop2
force-pushed
the
fix/settings-tab-model-defaults
branch
from
September 27, 2026 23:51
85c477f to
08e17a3
Compare
Owner
Author
|
This change is now part of #1003, which collects every Profiles pull request on one branch. Review and merge happen there. The branch stays in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Generation settings tab shows the chat model's own defaults, such as a temperature of 0.7. Moving focus out of a field compared the shown text with the stored config value, which is empty for a setting that defers to the model. The two never matched, so tabbing through the tab wrote every model default into
config.tomlas if the user had set it.Solution
A field now saves on blur only when its text differs from what it showed when the tab was drawn. That snapshot refreshes when a setting is reset or saved. The same rule now covers list fields, which rewrote their value on every blur, and dropdowns. Typing a new value and leaving the field still saves it.
A test tabs through the Generation tab without typing and asserts that
config.tomlis unchanged. It fails onmain.