fix(app): settings review — startup theme default, slider/shell input UX, dedupe accents, memoize palette
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -103,10 +103,7 @@ export function TerminalView({ surfaceId, font, palette }: { surfaceId: string;
|
||||
}, [surfaceId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
// Live re-apply font and theme when config changes without remounting.
|
||||
// palette is a new object each render so we depend on a stable key instead.
|
||||
const paletteKey = palette
|
||||
? `${palette["bg-panel"]}|${palette["text-primary"]}|${palette["search-match"]}`
|
||||
: null;
|
||||
// font and palette are memoized in App.tsx so stable identity = no spurious re-applies.
|
||||
useEffect(() => {
|
||||
const t = termRef.current;
|
||||
if (!t) return;
|
||||
@@ -116,7 +113,7 @@ export function TerminalView({ surfaceId, font, palette }: { surfaceId: string;
|
||||
}
|
||||
if (palette) t.options.theme = xtermTheme(palette);
|
||||
requestAnimationFrame(() => { try { fitRef.current?.fit(); } catch { /* ignore */ } });
|
||||
}, [font?.family, font?.size, paletteKey]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [font, palette]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return <div ref={ref} style={{ width: "100%", height: "100%" }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user