Fixes#1018
Remove the sync useEffect that copied preferences into local state,
along with the savingRef guard that prevented mid-save overwrites.
Instead, pass key={searchSpaceId} on the LLMRoleManager component so
React remounts the form with correct initial state whenever the search
space changes — no extra re-render, no effect dependency array.
Changes:
- llm-role-manager.tsx: remove useEffect + useRef + savingRef pattern;
drop useEffect and useRef from imports (now only useCallback, useState)
- search-space-settings-dialog.tsx: add key={searchSpaceId} to
<LLMRoleManager> so the component remounts on search-space change
Before: useEffect synced preferences → assignments on each preference
update, with savingRef to avoid overwriting an in-flight save.
After: React remounts the component with correct initial state from
the preferences selector; no mid-save race possible.