Repository navigation
fix(web): keep saved custom instruction pending until the list loads - #312
Merged
Merged
Conversation
…284) The server-preferences path applied the saved preset immediately. The select is never empty (the template ships "None" and "Auto"), so when the synced preferences arrived before loadCustomInstructions() finished, the preset was reported as not found and the pending value was dropped. The next preference save then synced the default back to the server, which spread the loss to other devices. - Only give up on a pending preset once the instruction list has loaded (FormManager sets window.__customInstructionsLoaded before dispatching customInstructionsLoaded). - While a preset is pending, save it instead of the select's placeholder value so it is never synced away. - An explicit user change of the select clears the pending value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
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.
Closes #284.
Problem
On page load, the saved custom instruction preset could be applied from the server-preferences path before
loadCustomInstructions()had filled the dropdown. The select is never empty (the template ships with "None" and "Auto"), so the preset was reported as not found and the pending value was dropped. The next preference save then synced the default back to the server, so other devices lost the preset too.Fix
FormManagersetswindow.__customInstructionsLoadedbefore dispatchingcustomInstructionsLoaded.Testing
Exercised in the browser by calling the apply and save functions directly: an early apply keeps the preset pending and it is applied when the list arrives; a preset missing from a loaded list is dropped; a save while pending keeps the preset; a manual change clears it. I did not reproduce the race through a real reload, since no presets exist in my local setup.
🤖 Generated with Claude Code