Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ function DisplayConversationEntry({
<div className="px-4 py-2 text-sm">
<NextActionCard
attemptId={taskAttempt?.id}
sessionId={taskAttempt?.session?.id}
containerRef={taskAttempt?.container_ref}
failed={entry.entry_type.failed}
execution_processes={entry.entry_type.execution_processes}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {

type NextActionCardProps = {
attemptId?: string;
sessionId?: string;
containerRef?: string | null;
failed: boolean;
execution_processes: number;
Expand All @@ -47,6 +48,7 @@ type NextActionCardProps = {

export function NextActionCard({
attemptId,
sessionId,
containerRef,
failed,
execution_processes,
Expand Down Expand Up @@ -98,13 +100,13 @@ export function NextActionCard({
}, [openInEditor]);

const handleViewLogs = useCallback(() => {
if (attemptId) {
if (sessionId) {
ViewProcessesDialog.show({
attemptId,
sessionId,
initialProcessId: latestDevServerProcess?.id,
});
}
}, [attemptId, latestDevServerProcess?.id]);
}, [sessionId, latestDevServerProcess?.id]);

const handleOpenDiffs = useCallback(() => {
navigate({ search: '?view=diffs' });
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/dialogs/tasks/ViewProcessesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import ProcessesTab from '@/components/tasks/TaskDetails/ProcessesTab';
import { ProcessSelectionProvider } from '@/contexts/ProcessSelectionContext';

export interface ViewProcessesDialogProps {
attemptId: string;
sessionId: string | undefined;
initialProcessId?: string | null;
}

const ViewProcessesDialogImpl = NiceModal.create<ViewProcessesDialogProps>(
({ attemptId, initialProcessId }) => {
({ sessionId, initialProcessId }) => {
const { t } = useTranslation('tasks');
const modal = useModal();

Expand Down Expand Up @@ -46,7 +46,7 @@ const ViewProcessesDialogImpl = NiceModal.create<ViewProcessesDialogProps>(
</DialogHeader>
<div className="h-[75vh] flex flex-col min-h-0 min-w-0">
<ProcessSelectionProvider initialProcessId={initialProcessId}>
<ProcessesTab attemptId={attemptId} />
<ProcessesTab sessionId={sessionId} />
</ProcessSelectionProvider>
</div>
</DialogContent>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/panels/AttemptHeaderActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import {
} from '../ui/tooltip';
import type { LayoutMode } from '../layout/TasksLayout';
import type { TaskWithAttemptStatus } from 'shared/types';
import type { Workspace } from 'shared/types';
import { ActionsDropdown } from '../ui/actions-dropdown';
import { usePostHog } from 'posthog-js/react';
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
import { WorkspaceWithSession } from '@/types/attempt';

interface AttemptHeaderActionsProps {
onClose: () => void;
mode?: LayoutMode;
onModeChange?: (mode: LayoutMode) => void;
task: TaskWithAttemptStatus;
attempt?: Workspace | null;
attempt?: WorkspaceWithSession | null;
sharedTask?: SharedTaskRecord;
}

Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/tasks/TaskDetails/ProcessesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ import { useProcessSelection } from '@/contexts/ProcessSelectionContext';
import { useRetryUi } from '@/contexts/RetryUiContext';

interface ProcessesTabProps {
attemptId?: string;
sessionId?: string;
}

function ProcessesTab({ attemptId }: ProcessesTabProps) {
function ProcessesTab({ sessionId }: ProcessesTabProps) {
const { t } = useTranslation('tasks');
const {
executionProcesses,
executionProcessesById,
isLoading: processesLoading,
isConnected,
error: processesError,
} = useExecutionProcesses(attemptId ?? '', { showSoftDeleted: true });
} = useExecutionProcesses(sessionId ?? '', { showSoftDeleted: true });
const { selectedProcessId, setSelectedProcessId } = useProcessSelection();
const [loadingProcessId, setLoadingProcessId] = useState<string | null>(null);
const [localProcessDetails, setLocalProcessDetails] = useState<
Expand All @@ -49,7 +49,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
useEffect(() => {
setLocalProcessDetails({});
setLoadingProcessId(null);
}, [attemptId]);
}, [sessionId]);

const handleCopyLogs = useCallback(async () => {
if (logs.length === 0) return;
Expand Down Expand Up @@ -121,7 +121,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {

// Automatically fetch process details when selectedProcessId changes
useEffect(() => {
if (!attemptId || !selectedProcessId) {
if (!sessionId || !selectedProcessId) {
return;
}

Expand All @@ -132,7 +132,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
fetchProcessDetails(selectedProcessId);
}
}, [
attemptId,
sessionId,
selectedProcessId,
localProcessDetails,
loadingProcessId,
Expand All @@ -150,7 +150,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {

const { isProcessGreyed } = useRetryUi();

if (!attemptId) {
if (!sessionId) {
return (
<div className="flex-1 flex items-center justify-center text-muted-foreground">
<div className="text-center">
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/ui/actions-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '@/components/ui/dropdown-menu';
import { MoreHorizontal } from 'lucide-react';
import type { TaskWithAttemptStatus } from 'shared/types';
import type { Workspace } from 'shared/types';
import { useOpenInEditor } from '@/hooks/useOpenInEditor';
import { DeleteTaskConfirmationDialog } from '@/components/dialogs/tasks/DeleteTaskConfirmationDialog';
import { ViewProcessesDialog } from '@/components/dialogs/tasks/ViewProcessesDialog';
Expand All @@ -27,10 +26,11 @@ import { openTaskForm } from '@/lib/openTaskForm';
import { useNavigate } from 'react-router-dom';
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
import { useAuth } from '@/hooks';
import { WorkspaceWithSession } from '@/types/attempt';

interface ActionsDropdownProps {
task?: TaskWithAttemptStatus | null;
attempt?: Workspace | null;
attempt?: WorkspaceWithSession | null;
sharedTask?: SharedTaskRecord;
}

Expand Down Expand Up @@ -84,7 +84,7 @@ export function ActionsDropdown({
const handleViewProcesses = (e: React.MouseEvent) => {
e.stopPropagation();
if (!attempt?.id) return;
ViewProcessesDialog.show({ attemptId: attempt.id });
ViewProcessesDialog.show({ sessionId: attempt.session?.id });
};

const handleViewRelatedTasks = (e: React.MouseEvent) => {
Expand Down