refactor: add primitives, plan mode display, and new session model selector

This commit is contained in:
simosmik
2026-04-20 12:47:55 +00:00
parent 25b00b58de
commit 7763e60fb3
26 changed files with 1616 additions and 265 deletions

View File

@@ -1,6 +1,8 @@
import React, { useCallback, useEffect, useRef } from 'react';
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { useTasksSettings } from '../../../contexts/TasksSettingsContext';
import PermissionContext from '../../../contexts/PermissionContext';
import { QuickSettingsPanel } from '../../quick-settings-panel';
import type { ChatInterfaceProps, Provider } from '../types/types';
import type { LLMProvider } from '../../../types/app';
@@ -9,6 +11,7 @@ import { useChatSessionState } from '../hooks/useChatSessionState';
import { useChatRealtimeHandlers } from '../hooks/useChatRealtimeHandlers';
import { useChatComposerState } from '../hooks/useChatComposerState';
import { useSessionStore } from '../../../stores/useSessionStore';
import ChatMessagesPane from './subcomponents/ChatMessagesPane';
import ChatComposer from './subcomponents/ChatComposer';
@@ -267,6 +270,11 @@ function ChatInterface({
};
}, [resetStreamingState]);
const permissionContextValue = useMemo(() => ({
pendingPermissionRequests,
handlePermissionDecision,
}), [pendingPermissionRequests, handlePermissionDecision]);
if (!selectedProject) {
const selectedProviderLabel =
provider === 'cursor'
@@ -292,7 +300,7 @@ function ChatInterface({
}
return (
<>
<PermissionContext.Provider value={permissionContextValue}>
<div className="flex h-full flex-col">
<ChatMessagesPane
scrollContainerRef={scrollContainerRef}
@@ -410,7 +418,7 @@ function ChatInterface({
</div>
<QuickSettingsPanel />
</>
</PermissionContext.Provider>
);
}