Client settings (#7381)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-02-21 14:26:03 +00:00
committed by GitHub
parent c543586b6f
commit 45d59be201
16 changed files with 335 additions and 233 deletions
@@ -428,20 +428,20 @@ function ToolCallView({
notifications,
isStreamingMessage = false,
}: ToolCallViewProps) {
const [responseStyle, setResponseStyle] = useState(() => localStorage.getItem('response_style'));
const [responseStyle, setResponseStyle] = useState<string>('concise');
useEffect(() => {
const handleStorageChange = () => {
setResponseStyle(localStorage.getItem('response_style'));
// Load initial value from settings
window.electron.getSetting('responseStyle').then(setResponseStyle);
const handleStyleChange = () => {
window.electron.getSetting('responseStyle').then(setResponseStyle);
};
window.addEventListener('storage', handleStorageChange);
window.addEventListener(AppEvents.RESPONSE_STYLE_CHANGED, handleStorageChange);
window.addEventListener(AppEvents.RESPONSE_STYLE_CHANGED, handleStyleChange);
return () => {
window.removeEventListener('storage', handleStorageChange);
window.removeEventListener(AppEvents.RESPONSE_STYLE_CHANGED, handleStorageChange);
window.removeEventListener(AppEvents.RESPONSE_STYLE_CHANGED, handleStyleChange);
};
}, []);