diff --git a/frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx b/frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx index 5551634f..45ebbc62 100644 --- a/frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx +++ b/frontend/src/components/ui-new/containers/PreviewControlsContainer.tsx @@ -7,19 +7,19 @@ import { RIGHT_MAIN_PANEL_MODES, } from '@/stores/useUiPreferencesStore'; import { useWorkspaceContext } from '@/contexts/WorkspaceContext'; +import { useLogsPanel } from '@/contexts/LogsPanelContext'; interface PreviewControlsContainerProps { attemptId?: string; - onViewProcessInPanel?: (processId: string) => void; className?: string; } export function PreviewControlsContainer({ attemptId, - onViewProcessInPanel, className, }: PreviewControlsContainerProps) { const { repos } = useWorkspaceContext(); + const { viewProcessInPanel } = useLogsPanel(); const setRightMainPanelMode = useUiPreferencesStore( (s) => s.setRightMainPanelMode ); @@ -41,17 +41,14 @@ export function PreviewControlsContainer({ const { logs, error: logsError } = useLogStream(activeProcess?.id ?? ''); - const handleViewFullLogs = useCallback( - (processId?: string) => { - const targetId = processId ?? activeProcess?.id; - if (targetId && onViewProcessInPanel) { - onViewProcessInPanel(targetId); - } else { - setRightMainPanelMode(RIGHT_MAIN_PANEL_MODES.LOGS); - } - }, - [activeProcess?.id, onViewProcessInPanel, setRightMainPanelMode] - ); + const handleViewFullLogs = useCallback(() => { + const targetId = activeProcess?.id; + if (targetId) { + viewProcessInPanel(targetId); + } else { + setRightMainPanelMode(RIGHT_MAIN_PANEL_MODES.LOGS); + } + }, [activeProcess?.id, viewProcessInPanel, setRightMainPanelMode]); const handleTabChange = useCallback((processId: string) => { setActiveProcessId(processId); diff --git a/frontend/src/components/ui-new/containers/RightSidebar.tsx b/frontend/src/components/ui-new/containers/RightSidebar.tsx index 4850b213..7788dd1c 100644 --- a/frontend/src/components/ui-new/containers/RightSidebar.tsx +++ b/frontend/src/components/ui-new/containers/RightSidebar.tsx @@ -4,7 +4,6 @@ import { ProcessListContainer } from '@/components/ui-new/containers/ProcessList import { PreviewControlsContainer } from '@/components/ui-new/containers/PreviewControlsContainer'; import { GitPanelContainer } from '@/components/ui-new/containers/GitPanelContainer'; import { useChangesView } from '@/contexts/ChangesViewContext'; -import { useLogsPanel } from '@/contexts/LogsPanelContext'; import { useWorkspaceContext } from '@/contexts/WorkspaceContext'; import type { Workspace, RepoWithTargetBranch } from 'shared/types'; import { @@ -27,7 +26,6 @@ export function RightSidebar({ repos, }: RightSidebarProps) { const { selectFile } = useChangesView(); - const { viewProcessInPanel } = useLogsPanel(); const { diffs } = useWorkspaceContext(); const { setExpanded } = useExpandedAll(); @@ -81,10 +79,7 @@ export function RightSidebar({ return (