refactor: remove unused actionRunner prop from components

This commit is contained in:
KevIsDev 2025-06-17 23:50:21 +01:00
parent 5b18e7678a
commit 665029dc1d
3 changed files with 3 additions and 15 deletions

View File

@ -25,7 +25,6 @@ import ChatAlert from './alerts/ChatAlert';
import type { ModelInfo } from '~/shared/lib/providers/types';
import ProgressCompilation from './ProgressCompilation';
import type { ProgressAnnotation } from '~/shared/types/context';
import type { ActionRunner } from '~/shared/lib/runtime/action-runner';
import { SupabaseChatAlert } from '~/chat/components/alerts/SupabaseAlert';
import { expoUrlAtom } from '~/shared/workbench/stores/qrCodeStore';
import { useStore } from '@nanostores/react';
@ -71,7 +70,6 @@ interface BaseChatProps {
deployAlert?: DeployAlert;
clearDeployAlert?: () => void;
data?: JSONValue[] | undefined;
actionRunner?: ActionRunner;
chatMode?: 'discuss' | 'build';
setChatMode?: (mode: 'discuss' | 'build') => void;
append?: (message: Message) => void;
@ -116,7 +114,6 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
supabaseAlert,
clearSupabaseAlert,
data,
actionRunner,
chatMode,
setChatMode,
append,
@ -483,12 +480,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
</div>
<ClientOnly>
{() => (
<Workbench
actionRunner={actionRunner ?? ({} as ActionRunner)}
chatStarted={chatStarted}
isStreaming={isStreaming}
setSelectedElement={setSelectedElement}
/>
<Workbench chatStarted={chatStarted} isStreaming={isStreaming} setSelectedElement={setSelectedElement} />
)}
</ClientOnly>
</div>

View File

@ -5,7 +5,6 @@ import { memo, useCallback, useEffect, useState, useMemo } from 'react';
import { toast } from 'react-toastify';
import { Popover, Transition } from '@headlessui/react';
import { diffLines, type Change } from 'diff';
import { ActionRunner } from '~/shared/lib/runtime/action-runner';
import { getLanguageFromExtension } from '~/shared/utils/getLanguageFromExtension';
import type { FileHistory } from '~/shared/types/actions';
import { DiffView } from './ui/DiffView';
@ -32,7 +31,6 @@ import type { ElementInfo } from './ui/Inspector';
interface WorkspaceProps {
chatStarted?: boolean;
isStreaming?: boolean;
actionRunner: ActionRunner;
metadata?: {
gitUrl?: string;
};
@ -281,7 +279,7 @@ const FileModifiedDropdown = memo(
);
export const Workbench = memo(
({ chatStarted, isStreaming, actionRunner, metadata, updateChatMestaData, setSelectedElement }: WorkspaceProps) => {
({ chatStarted, isStreaming, metadata, updateChatMestaData, setSelectedElement }: WorkspaceProps) => {
renderLogger.trace('Workbench');
const [isSyncing, setIsSyncing] = useState(false);
@ -486,7 +484,7 @@ export const Workbench = memo(
initial={{ x: '100%' }}
animate={{ x: selectedView === 'diff' ? '0%' : selectedView === 'code' ? '100%' : '-100%' }}
>
<DiffView fileHistory={fileHistory} setFileHistory={setFileHistory} actionRunner={actionRunner} />
<DiffView fileHistory={fileHistory} setFileHistory={setFileHistory} />
</View>
<View initial={{ x: '100%' }} animate={{ x: selectedView === 'preview' ? '0%' : '100%' }}>
<Preview setSelectedElement={setSelectedElement} />

View File

@ -7,7 +7,6 @@ import { diffLines, type Change } from 'diff';
import { getHighlighter } from 'shiki';
import '~/styles/diff-view.css';
import { diffFiles, extractRelativePath } from '~/shared/utils/diff';
import { ActionRunner } from '~/shared/lib/runtime/action-runner';
import type { FileHistory } from '~/shared/types/actions';
import { getLanguageFromExtension } from '~/shared/utils/getLanguageFromExtension';
import { themeStore } from '~/shared/stores/theme';
@ -664,7 +663,6 @@ const InlineDiffComparison = memo(({ beforeCode, afterCode, filename, language }
interface DiffViewProps {
fileHistory: Record<string, FileHistory>;
setFileHistory: React.Dispatch<React.SetStateAction<Record<string, FileHistory>>>;
actionRunner: ActionRunner;
}
export const DiffView = memo(({ fileHistory, setFileHistory }: DiffViewProps) => {