mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat(frontend): add simple chat mode (#190)
* loop: simple-chat-mode completed after 1 iterations * feat(frontend): add simple chat mode for user messages and clean up redundant optimistic filtering * refactor(frontend): consolidate status indicators and simplify simple chat mode - Merge MiniScanner and CompactStatusIndicator into SessionStatusIndicator with size and showLabel props - Hide step-finish cost/token display in simpleChatMode - Update SessionCard and PromptInput to use unified SessionStatusIndicator - Add tests for step-finish rendering in simpleChatMode
This commit is contained in:
1 parent
b61a3c83d1
commit
adf77516e5
12 files changed
+493
-221
No files matched your search
@@ -331,23 +331,22 @@ export const useSendPrompt = (opcodeUrl: string | null | undefined, directory?:
|
||||
},
|
||||
onSuccess: async (data, variables) => {
|
||||
const { sessionID } = variables;
|
||||
const { optimisticUserID, response } = data;
|
||||
const { response } = data;
|
||||
const messagesQueryKey = ["opencode", "messages", opcodeUrl, sessionID, directory];
|
||||
|
||||
queryClient.setQueryData<MessageWithParts[]>(
|
||||
messagesQueryKey,
|
||||
(old) => {
|
||||
if (!old) return old;
|
||||
const withoutOptimistic = old.filter((msgWithParts) => msgWithParts.info.id !== optimisticUserID);
|
||||
|
||||
const existingIdx = withoutOptimistic.findIndex(m => m.info.id === response.info.id);
|
||||
|
||||
const existingIdx = old.findIndex(m => m.info.id === response.info.id);
|
||||
if (existingIdx >= 0) {
|
||||
const updated = [...withoutOptimistic];
|
||||
const updated = [...old];
|
||||
updated[existingIdx] = { info: response.info, parts: response.parts };
|
||||
return updated;
|
||||
}
|
||||
|
||||
return [...withoutOptimistic, { info: response.info, parts: response.parts }];
|
||||
|
||||
return [...old, { info: response.info, parts: response.parts }];
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user