fix: preserve chat settings ownership (#120036)

This commit is contained in:
Shakker
2026-08-06 21:06:36 +01:00
parent e16421d5d1
commit db90dff139
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -411,7 +411,13 @@ function makeHost(overrides?: MakeHostOverrides): TestChatHost | TestChatHostWit
chatProgrammaticScrollTarget: 0,
applySettings: vi.fn((patch: Partial<UiSettings>) => {
// Chat pages own display/layout settings; active-session persistence belongs to pane bindings.
Object.assign(settings, patch);
const next = { ...settings, ...patch };
Object.assign(settings, {
chatShowThinking: next.chatShowThinking,
chatShowToolCalls: next.chatShowToolCalls,
chatPersistCommentary: next.chatPersistCommentary,
chatSendShortcut: next.chatSendShortcut,
});
}),
...hostOverrides,
settings,
+7 -1
View File
@@ -264,7 +264,13 @@ export function createPageState(
state.handleChatDraftChange = (next) => handleChatDraftChange(state, next);
state.handleChatInputHistoryKey = (input) => handleChatInputHistoryKey(state, input);
state.applySettings = (patch) => {
state.settings = patchSettings(patch);
const next = { ...state.settings, ...patch };
state.settings = patchSettings({
chatShowThinking: next.chatShowThinking,
chatShowToolCalls: next.chatShowToolCalls,
chatPersistCommentary: next.chatPersistCommentary,
chatSendShortcut: next.chatSendShortcut,
});
renderLifecycle.invalidate();
};
state.setChatViewMenuOpen = (open, options) => {