Fix settings refresh lag / 优化设置保存响应#4680
Merged
SivanCola merged 1 commit intoJun 17, 2026
Merged
Conversation
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
Fixes #4663.
After the v1.9.0 desktop/global config path consolidation, Settings saves could feel delayed even for lightweight UI-only actions such as display mode, status bar, or appearance changes.
The provider/MCP visibility side of this report is covered by the synced
main-v2migration work. This PR focuses on the remaining Settings interaction lag.Root Cause
SettingsPanelreloadedapp.Settings()after every save, then notified the parent with a genericonChanged()callback. Because the parent did not receive the freshly loadedSettingsView, it immediately performed additional fullapp.Settings()reads to refresh desktop preferences and the IM sidebar.That made a single Settings save perform redundant config reads on the critical UI path. Those reads now include global/project config merge and provider credential projection, so the extra work is visible as a small but noticeable "half beat" after clicking Settings controls.
Fix
SettingsViewfrom the panel reload path.onChanged(settings)after foreground and background Settings mutations.Appto refresh desktop preferences and IM sidebar state without re-reading full Settings.Cache impact
None. This is desktop Settings refresh plumbing only. It does not change provider request serialization, prompt prefixes, tool schemas, model resolution, or chat cache-sensitive surfaces.
Verification
corepack pnpm exec tsx src/__tests__/settings-refresh-snapshot.test.tsxcorepack pnpm run test:allcorepack pnpm run buildgo test ./...cd desktop && go test ./...go vet ./...cd desktop && go vet ./...gofmt -l .git diff --check