refactor: reorganize chat view components and types

This commit is contained in:
Haileyesus
2026-02-11 18:43:40 +03:00
parent 7f45540dbe
commit 189b1533b2
18 changed files with 38 additions and 38 deletions

View File

@@ -19,7 +19,7 @@ import type {
PendingPermissionRequest,
PermissionMode,
Provider,
} from '../types';
} from '../types/types';
import { useFileMentions } from './useFileMentions';
import { type SlashCommand, useSlashCommands } from './useSlashCommands';
import type { Project, ProjectSession } from '../../../types/app';

View File

@@ -1,7 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react';
import { authenticatedFetch } from '../../../utils/api';
import { CLAUDE_MODELS, CODEX_MODELS, CURSOR_MODELS } from '../../../../shared/modelConstants';
import type { PendingPermissionRequest, PermissionMode, Provider } from '../types';
import type { PendingPermissionRequest, PermissionMode, Provider } from '../types/types';
import type { ProjectSession } from '../../../types/app';
interface UseChatProviderStateArgs {

View File

@@ -2,7 +2,7 @@ import { useEffect } from 'react';
import type { Dispatch, MutableRefObject, SetStateAction } from 'react';
import { decodeHtmlEntities, formatUsageLimitText } from '../utils/chatFormatting';
import { safeLocalStorage } from '../utils/chatStorage';
import type { ChatMessage, PendingPermissionRequest, Provider } from '../types';
import type { ChatMessage, PendingPermissionRequest, Provider } from '../types/types';
import type { Project, ProjectSession } from '../../../types/app';
type PendingViewSession = {

View File

@@ -1,7 +1,7 @@
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import type { MutableRefObject } from 'react';
import { api, authenticatedFetch } from '../../../utils/api';
import type { ChatMessage, Provider } from '../types';
import type { ChatMessage, Provider } from '../types/types';
import type { Project, ProjectSession } from '../../../types/app';
import { safeLocalStorage } from '../utils/chatStorage';
import {

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { Markdown } from '../../../markdown/Markdown';
import { Markdown } from '../../../view/subcomponents/Markdown';
interface MarkdownContentProps {
content: string;

View File

@@ -1,4 +1,4 @@
import type { Project, ProjectSession, SessionProvider } from '../../types/app';
import type { Project, ProjectSession, SessionProvider } from '../../../types/app';
export type Provider = SessionProvider;

View File

@@ -1,5 +1,5 @@
import { safeJsonParse } from '../../../lib/utils.js';
import type { ChatMessage, ClaudePermissionSuggestion, PermissionGrantResult } from '../types';
import type { ChatMessage, ClaudePermissionSuggestion, PermissionGrantResult } from '../types/types.js';
import { CLAUDE_SETTINGS_KEY, getClaudeSettings, safeLocalStorage } from './chatStorage';
export function buildClaudeToolPermissionEntry(toolName?: string, toolInput?: unknown) {

View File

@@ -1,4 +1,4 @@
import type { ClaudeSettings } from '../types';
import type { ClaudeSettings } from '../types/types';
export const CLAUDE_SETTINGS_KEY = 'claude-settings';

View File

@@ -1,4 +1,4 @@
import type { ChatMessage } from '../types';
import type { ChatMessage } from '../types/types';
import { decodeHtmlEntities, unescapeWithMathProtection } from './chatFormatting';
export interface DiffLine {

View File

@@ -2,14 +2,14 @@ import React, { useCallback, useEffect, useRef } from 'react';
import QuickSettingsPanel from '../../QuickSettingsPanel';
import { useTasksSettings } from '../../../contexts/TasksSettingsContext';
import { useTranslation } from 'react-i18next';
import ChatMessagesPane from './ChatMessagesPane';
import ChatComposer from './ChatComposer';
import type { ChatInterfaceProps } from '../types';
import ChatMessagesPane from './subcomponents/ChatMessagesPane';
import ChatComposer from './subcomponents/ChatComposer';
import type { ChatInterfaceProps } from '../types/types';
import { useChatProviderState } from '../hooks/useChatProviderState';
import { useChatSessionState } from '../hooks/useChatSessionState';
import { useChatRealtimeHandlers } from '../hooks/useChatRealtimeHandlers';
import { useChatComposerState } from '../hooks/useChatComposerState';
import type { Provider } from '../types';
import type { Provider } from '../types/types';
type PendingViewSession = {
sessionId: string | null;

View File

@@ -1,7 +1,7 @@
import CommandMenu from '../../CommandMenu';
import ClaudeStatus from '../../ClaudeStatus';
import { MicButton } from '../../MicButton.jsx';
import ImageAttachment from '../input/ImageAttachment';
import CommandMenu from '../../../CommandMenu';
import ClaudeStatus from '../../../ClaudeStatus';
import { MicButton } from '../../../MicButton.jsx';
import ImageAttachment from './ImageAttachment';
import PermissionRequestsBanner from './PermissionRequestsBanner';
import ChatInputControls from './ChatInputControls';
import { useTranslation } from 'react-i18next';
@@ -17,7 +17,7 @@ import type {
SetStateAction,
TouchEvent,
} from 'react';
import type { PendingPermissionRequest, PermissionMode, Provider } from '../types';
import type { PendingPermissionRequest, PermissionMode, Provider } from '../../types/types';
interface MentionableFile {
name: string;

View File

@@ -1,10 +1,10 @@
import { useTranslation } from 'react-i18next';
import type { Dispatch, RefObject, SetStateAction } from 'react';
import SessionProviderLogo from '../../SessionProviderLogo';
import MessageComponent from '../messages/MessageComponent';
import SessionProviderLogo from '../../../SessionProviderLogo';
import MessageComponent from './MessageComponent';
import ProviderSelectionEmptyState from './ProviderSelectionEmptyState';
import type { ChatMessage, Provider } from '../types';
import type { Project, ProjectSession } from '../../../types/app';
import type { ChatMessage, Provider } from '../../types/types';
import type { Project, ProjectSession } from '../../../../types/app';
interface ChatMessagesPaneProps {
scrollContainerRef: RefObject<HTMLDivElement>;

View File

@@ -6,7 +6,7 @@ import rehypeKatex from 'rehype-katex';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { oneDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { useTranslation } from 'react-i18next';
import { normalizeInlineCodeFences } from '../utils/chatFormatting';
import { normalizeInlineCodeFences } from '../../utils/chatFormatting';
type MarkdownProps = {
children: React.ReactNode;

View File

@@ -1,13 +1,13 @@
// @ts-nocheck
import React, { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import SessionProviderLogo from '../../SessionProviderLogo';
import type { ChatMessage, Provider } from '../types';
import { Markdown } from '../markdown/Markdown';
import { formatUsageLimitText } from '../utils/chatFormatting';
import { getClaudePermissionSuggestion } from '../utils/chatPermissions';
import type { Project } from '../../../types/app';
import { ToolRenderer, shouldHideToolResult } from '../tools';
import SessionProviderLogo from '../../../SessionProviderLogo';
import type { ChatMessage, Provider } from '../../types/types';
import { Markdown } from './Markdown';
import { formatUsageLimitText } from '../../utils/chatFormatting';
import { getClaudePermissionSuggestion } from '../../utils/chatPermissions';
import type { Project } from '../../../../types/app';
import { ToolRenderer, shouldHideToolResult } from '../../tools';
type DiffLine = {
type: string;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import type { PendingPermissionRequest } from '../types';
import { buildClaudeToolPermissionEntry, formatToolInputForDisplay } from '../utils/chatPermissions';
import { getClaudeSettings } from '../utils/chatStorage';
import type { PendingPermissionRequest } from '../../types/types';
import { buildClaudeToolPermissionEntry, formatToolInputForDisplay } from '../../utils/chatPermissions';
import { getClaudeSettings } from '../../utils/chatStorage';
interface PermissionRequestsBannerProps {
pendingPermissionRequests: PendingPermissionRequest[];

View File

@@ -1,10 +1,10 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import SessionProviderLogo from '../../SessionProviderLogo';
import NextTaskBanner from '../../NextTaskBanner.jsx';
import { CLAUDE_MODELS, CURSOR_MODELS, CODEX_MODELS } from '../../../../shared/modelConstants';
import type { Provider } from '../types';
import type { ProjectSession } from '../../../types/app';
import SessionProviderLogo from '../../../SessionProviderLogo';
import NextTaskBanner from '../../../NextTaskBanner.jsx';
import { CLAUDE_MODELS, CURSOR_MODELS, CODEX_MODELS } from '../../../../../shared/modelConstants';
import type { Provider } from '../../types/types';
import type { ProjectSession } from '../../../../types/app';
interface ProviderSelectionEmptyStateProps {
selectedSession: ProjectSession | null;