Skip to content

Fix settings refresh lag / 优化设置保存响应#4680

Merged
SivanCola merged 1 commit into
esengine:main-v2from
GTC2080:GTC/fix-4663-settings-refresh-lag
Jun 17, 2026
Merged

Fix settings refresh lag / 优化设置保存响应#4680
SivanCola merged 1 commit into
esengine:main-v2from
GTC2080:GTC/fix-4663-settings-refresh-lag

Conversation

@GTC2080

@GTC2080 GTC2080 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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-v2 migration work. This PR focuses on the remaining Settings interaction lag.

Root Cause

SettingsPanel reloaded app.Settings() after every save, then notified the parent with a generic onChanged() callback. Because the parent did not receive the freshly loaded SettingsView, it immediately performed additional full app.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

  • Return the normalized post-save SettingsView from the panel reload path.
  • Pass that snapshot through onChanged(settings) after foreground and background Settings mutations.
  • Reuse the snapshot in App to refresh desktop preferences and IM sidebar state without re-reading full Settings.
  • Keep the no-snapshot fallback for Settings pages such as Hooks that manage their own data.
  • Add a jsdom regression test that verifies a Settings save sends the post-save snapshot and keeps Settings reads bounded.

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.tsx
  • corepack pnpm run test:all
  • corepack pnpm run build
  • go test ./...
  • cd desktop && go test ./...
  • go vet ./...
  • cd desktop && go vet ./...
  • gofmt -l .
  • git diff --check

@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 17, 2026
@SivanCola SivanCola merged commit 5dc86b4 into esengine:main-v2 Jun 17, 2026
14 checks passed
@GTC2080 GTC2080 deleted the GTC/fix-4663-settings-refresh-lag branch June 17, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 升级1.9.0之后,之前接入的三方供应商丢失,并且操作反应慢半拍

2 participants