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:
Chris Scott authored and GitHub committed 2026-04-23 11:37:24 -04:00
1 parent b61a3c83d1
commit adf77516e5
12 files changed
+493 -221

No files matched your search

+6 -7
View File
@@ -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 }];
},
);