fix: empty process list regression (#1896)
* fix: empty process list regression * tyecheck fix
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -38,6 +38,7 @@ import {
|
||||
|
||||
type NextActionCardProps = {
|
||||
attemptId?: string;
|
||||
sessionId?: string;
|
||||
containerRef?: string | null;
|
||||
failed: boolean;
|
||||
execution_processes: number;
|
||||
@@ -47,6 +48,7 @@ type NextActionCardProps = {
|
||||
|
||||
export function NextActionCard({
|
||||
attemptId,
|
||||
sessionId,
|
||||
containerRef,
|
||||
failed,
|
||||
execution_processes,
|
||||
@@ -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' });
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,10 @@ 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,
|
||||
@@ -31,7 +31,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
||||
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<
|
||||
@@ -49,7 +49,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
||||
useEffect(() => {
|
||||
setLocalProcessDetails({});
|
||||
setLoadingProcessId(null);
|
||||
}, [attemptId]);
|
||||
}, [sessionId]);
|
||||
|
||||
const handleCopyLogs = useCallback(async () => {
|
||||
if (logs.length === 0) return;
|
||||
@@ -121,7 +121,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
||||
|
||||
// Automatically fetch process details when selectedProcessId changes
|
||||
useEffect(() => {
|
||||
if (!attemptId || !selectedProcessId) {
|
||||
if (!sessionId || !selectedProcessId) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
||||
fetchProcessDetails(selectedProcessId);
|
||||
}
|
||||
}, [
|
||||
attemptId,
|
||||
sessionId,
|
||||
selectedProcessId,
|
||||
localProcessDetails,
|
||||
loadingProcessId,
|
||||
@@ -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">
|
||||
|
||||
@@ -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';
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user