Skip to content

Commit db90dff

Browse files
committed
fix: preserve chat settings ownership (#120036)
1 parent e16421d commit db90dff

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎ui/src/pages/chat/chat-send.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,13 @@ function makeHost(overrides?: MakeHostOverrides): TestChatHost | TestChatHostWit
411411
chatProgrammaticScrollTarget: 0,
412412
applySettings: vi.fn((patch: Partial<UiSettings>) => {
413413
// Chat pages own display/layout settings; active-session persistence belongs to pane bindings.
414-
Object.assign(settings, patch);
414+
const next = { ...settings, ...patch };
415+
Object.assign(settings, {
416+
chatShowThinking: next.chatShowThinking,
417+
chatShowToolCalls: next.chatShowToolCalls,
418+
chatPersistCommentary: next.chatPersistCommentary,
419+
chatSendShortcut: next.chatSendShortcut,
420+
});
415421
}),
416422
...hostOverrides,
417423
settings,

‎ui/src/pages/chat/chat-state-page.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,13 @@ export function createPageState(
264264
state.handleChatDraftChange = (next) => handleChatDraftChange(state, next);
265265
state.handleChatInputHistoryKey = (input) => handleChatInputHistoryKey(state, input);
266266
state.applySettings = (patch) => {
267-
state.settings = patchSettings(patch);
267+
const next = { ...state.settings, ...patch };
268+
state.settings = patchSettings({
269+
chatShowThinking: next.chatShowThinking,
270+
chatShowToolCalls: next.chatShowToolCalls,
271+
chatPersistCommentary: next.chatPersistCommentary,
272+
chatSendShortcut: next.chatSendShortcut,
273+
});
268274
renderLifecycle.invalidate();
269275
};
270276
state.setChatViewMenuOpen = (open, options) => {

0 commit comments

Comments
 (0)