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
@@ -7,6 +7,7 @@ import { MessageError } from './MessageError'
|
||||
import type { Message, Part, MessageWithParts } from '@/api/types'
|
||||
import { useSessionStatusForSession } from '@/stores/sessionStatusStore'
|
||||
import { useSessionTodos } from '@/stores/sessionTodosStore'
|
||||
import { useSettings } from '@/hooks/useSettings'
|
||||
import type { components } from '@/api/opencode-types'
|
||||
import type { Todo } from '@/components/message/SessionTodoDisplay'
|
||||
import type { OpenCodeError } from '@/lib/opencode-errors'
|
||||
@@ -78,6 +79,7 @@ interface MessageRowProps {
|
||||
handleStartEditUserMessage: (userMessageId: string, assistantMessageId: string) => void
|
||||
handleCancelEdit: () => void
|
||||
model?: string
|
||||
simpleChatMode: boolean
|
||||
}
|
||||
|
||||
const MessageRow = memo(function MessageRow({
|
||||
@@ -98,6 +100,7 @@ const MessageRow = memo(function MessageRow({
|
||||
handleStartEditUserMessage,
|
||||
handleCancelEdit,
|
||||
model,
|
||||
simpleChatMode,
|
||||
}: MessageRowProps) {
|
||||
const msg = msgWithParts.info
|
||||
const parts = msgWithParts.parts
|
||||
@@ -185,6 +188,12 @@ const MessageRow = memo(function MessageRow({
|
||||
onClick={() => handleStartEditUserMessage(msg.id, nextAssistantMsg.id)}
|
||||
isEditable={false}
|
||||
/>
|
||||
) : msg.role === 'user' && simpleChatMode ? (
|
||||
<ClickableUserMessage
|
||||
content={messageTextContent}
|
||||
onClick={() => {}}
|
||||
isEditable={false}
|
||||
/>
|
||||
) : parts.length > 0 ? (
|
||||
parts.map((part: Part, partIndex: number) => (
|
||||
<div key={`${msg.id}-${part.id}-${partIndex}`}>
|
||||
@@ -222,6 +231,8 @@ export const MessageThread = memo(function MessageThread({
|
||||
const [editingUserMessageId, setEditingUserMessageId] = useState<string | null>(null)
|
||||
const [editingForAssistantId, setEditingForAssistantId] = useState<string | null>(null)
|
||||
const sessionStatus = useSessionStatusForSession(sessionID)
|
||||
const { preferences } = useSettings()
|
||||
const simpleChatMode = preferences?.simpleChatMode ?? false
|
||||
|
||||
const pendingAssistantId = useMemo(() => {
|
||||
if (!messages) return undefined
|
||||
@@ -316,6 +327,7 @@ export const MessageThread = memo(function MessageThread({
|
||||
handleStartEditUserMessage={handleStartEditUserMessage}
|
||||
handleCancelEdit={handleCancelEdit}
|
||||
model={model}
|
||||
simpleChatMode={simpleChatMode}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user