chore: goose2 UI state refactor (part 1) (#9049)

This commit is contained in:
Lifei Zhou
2026-05-07 15:52:49 +10:00
committed by GitHub
parent f98eef61f7
commit d7df3fb431
39 changed files with 2208 additions and 339 deletions
@@ -506,7 +506,7 @@ function handleShared(sessionId: string, update: SessionUpdate): void {
currentModelId;
const sessionStore = useChatSessionStore.getState();
sessionStore.updateSession(sessionId, {
sessionStore.patchSession(sessionId, {
modelId: currentModelId,
modelName: currentModelName,
});
@@ -24,7 +24,7 @@ export function handleSessionInfoUpdate(
}
const meta = isRecord(info._meta) ? info._meta : {};
const patch: Parameters<typeof sessionStore.updateSession>[1] = {};
const patch: Parameters<typeof sessionStore.patchSession>[1] = {};
if (typeof info.title === "string" && info.title && !session.userSetName) {
patch.title = info.title;
@@ -40,6 +40,6 @@ export function handleSessionInfoUpdate(
}
if (Object.keys(patch).length > 0) {
sessionStore.updateSession(sessionId, patch);
sessionStore.patchSession(sessionId, patch);
}
}
@@ -119,7 +119,9 @@
"filesTitle": "Files"
},
"notifications": {
"compactionComplete": "Conversation compacted. Older context was summarized."
"compactionComplete": "Conversation compacted. Older context was summarized.",
"moveError": "Failed to move chat",
"renameError": "Failed to rename chat"
},
"message": {
"copied": "Copied",
@@ -119,7 +119,9 @@
"filesTitle": "Archivos"
},
"notifications": {
"compactionComplete": "Conversacion compactada. El contexto anterior se resumio."
"compactionComplete": "Conversacion compactada. El contexto anterior se resumio.",
"moveError": "No se pudo mover el chat",
"renameError": "No se pudo cambiar el nombre del chat"
},
"message": {
"copied": "Copiado",
-10
View File
@@ -1,10 +0,0 @@
/** Find the last index in an array matching a predicate. */
export function findLastIndex<T>(
arr: readonly T[],
predicate: (item: T) => boolean,
): number {
for (let i = arr.length - 1; i >= 0; i--) {
if (predicate(arr[i])) return i;
}
return -1;
}