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">
|
<div className="px-4 py-2 text-sm">
|
||||||
<NextActionCard
|
<NextActionCard
|
||||||
attemptId={taskAttempt?.id}
|
attemptId={taskAttempt?.id}
|
||||||
|
sessionId={taskAttempt?.session?.id}
|
||||||
containerRef={taskAttempt?.container_ref}
|
containerRef={taskAttempt?.container_ref}
|
||||||
failed={entry.entry_type.failed}
|
failed={entry.entry_type.failed}
|
||||||
execution_processes={entry.entry_type.execution_processes}
|
execution_processes={entry.entry_type.execution_processes}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import {
|
|||||||
|
|
||||||
type NextActionCardProps = {
|
type NextActionCardProps = {
|
||||||
attemptId?: string;
|
attemptId?: string;
|
||||||
|
sessionId?: string;
|
||||||
containerRef?: string | null;
|
containerRef?: string | null;
|
||||||
failed: boolean;
|
failed: boolean;
|
||||||
execution_processes: number;
|
execution_processes: number;
|
||||||
@@ -47,6 +48,7 @@ type NextActionCardProps = {
|
|||||||
|
|
||||||
export function NextActionCard({
|
export function NextActionCard({
|
||||||
attemptId,
|
attemptId,
|
||||||
|
sessionId,
|
||||||
containerRef,
|
containerRef,
|
||||||
failed,
|
failed,
|
||||||
execution_processes,
|
execution_processes,
|
||||||
@@ -98,13 +100,13 @@ export function NextActionCard({
|
|||||||
}, [openInEditor]);
|
}, [openInEditor]);
|
||||||
|
|
||||||
const handleViewLogs = useCallback(() => {
|
const handleViewLogs = useCallback(() => {
|
||||||
if (attemptId) {
|
if (sessionId) {
|
||||||
ViewProcessesDialog.show({
|
ViewProcessesDialog.show({
|
||||||
attemptId,
|
sessionId,
|
||||||
initialProcessId: latestDevServerProcess?.id,
|
initialProcessId: latestDevServerProcess?.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [attemptId, latestDevServerProcess?.id]);
|
}, [sessionId, latestDevServerProcess?.id]);
|
||||||
|
|
||||||
const handleOpenDiffs = useCallback(() => {
|
const handleOpenDiffs = useCallback(() => {
|
||||||
navigate({ search: '?view=diffs' });
|
navigate({ search: '?view=diffs' });
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import ProcessesTab from '@/components/tasks/TaskDetails/ProcessesTab';
|
|||||||
import { ProcessSelectionProvider } from '@/contexts/ProcessSelectionContext';
|
import { ProcessSelectionProvider } from '@/contexts/ProcessSelectionContext';
|
||||||
|
|
||||||
export interface ViewProcessesDialogProps {
|
export interface ViewProcessesDialogProps {
|
||||||
attemptId: string;
|
sessionId: string | undefined;
|
||||||
initialProcessId?: string | null;
|
initialProcessId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ViewProcessesDialogImpl = NiceModal.create<ViewProcessesDialogProps>(
|
const ViewProcessesDialogImpl = NiceModal.create<ViewProcessesDialogProps>(
|
||||||
({ attemptId, initialProcessId }) => {
|
({ sessionId, initialProcessId }) => {
|
||||||
const { t } = useTranslation('tasks');
|
const { t } = useTranslation('tasks');
|
||||||
const modal = useModal();
|
const modal = useModal();
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const ViewProcessesDialogImpl = NiceModal.create<ViewProcessesDialogProps>(
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className="h-[75vh] flex flex-col min-h-0 min-w-0">
|
<div className="h-[75vh] flex flex-col min-h-0 min-w-0">
|
||||||
<ProcessSelectionProvider initialProcessId={initialProcessId}>
|
<ProcessSelectionProvider initialProcessId={initialProcessId}>
|
||||||
<ProcessesTab attemptId={attemptId} />
|
<ProcessesTab sessionId={sessionId} />
|
||||||
</ProcessSelectionProvider>
|
</ProcessSelectionProvider>
|
||||||
</div>
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|||||||
@@ -10,17 +10,17 @@ import {
|
|||||||
} from '../ui/tooltip';
|
} from '../ui/tooltip';
|
||||||
import type { LayoutMode } from '../layout/TasksLayout';
|
import type { LayoutMode } from '../layout/TasksLayout';
|
||||||
import type { TaskWithAttemptStatus } from 'shared/types';
|
import type { TaskWithAttemptStatus } from 'shared/types';
|
||||||
import type { Workspace } from 'shared/types';
|
|
||||||
import { ActionsDropdown } from '../ui/actions-dropdown';
|
import { ActionsDropdown } from '../ui/actions-dropdown';
|
||||||
import { usePostHog } from 'posthog-js/react';
|
import { usePostHog } from 'posthog-js/react';
|
||||||
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
|
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
|
||||||
|
import { WorkspaceWithSession } from '@/types/attempt';
|
||||||
|
|
||||||
interface AttemptHeaderActionsProps {
|
interface AttemptHeaderActionsProps {
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
mode?: LayoutMode;
|
mode?: LayoutMode;
|
||||||
onModeChange?: (mode: LayoutMode) => void;
|
onModeChange?: (mode: LayoutMode) => void;
|
||||||
task: TaskWithAttemptStatus;
|
task: TaskWithAttemptStatus;
|
||||||
attempt?: Workspace | null;
|
attempt?: WorkspaceWithSession | null;
|
||||||
sharedTask?: SharedTaskRecord;
|
sharedTask?: SharedTaskRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ import { useProcessSelection } from '@/contexts/ProcessSelectionContext';
|
|||||||
import { useRetryUi } from '@/contexts/RetryUiContext';
|
import { useRetryUi } from '@/contexts/RetryUiContext';
|
||||||
|
|
||||||
interface ProcessesTabProps {
|
interface ProcessesTabProps {
|
||||||
attemptId?: string;
|
sessionId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
function ProcessesTab({ sessionId }: ProcessesTabProps) {
|
||||||
const { t } = useTranslation('tasks');
|
const { t } = useTranslation('tasks');
|
||||||
const {
|
const {
|
||||||
executionProcesses,
|
executionProcesses,
|
||||||
@@ -31,7 +31,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
|||||||
isLoading: processesLoading,
|
isLoading: processesLoading,
|
||||||
isConnected,
|
isConnected,
|
||||||
error: processesError,
|
error: processesError,
|
||||||
} = useExecutionProcesses(attemptId ?? '', { showSoftDeleted: true });
|
} = useExecutionProcesses(sessionId ?? '', { showSoftDeleted: true });
|
||||||
const { selectedProcessId, setSelectedProcessId } = useProcessSelection();
|
const { selectedProcessId, setSelectedProcessId } = useProcessSelection();
|
||||||
const [loadingProcessId, setLoadingProcessId] = useState<string | null>(null);
|
const [loadingProcessId, setLoadingProcessId] = useState<string | null>(null);
|
||||||
const [localProcessDetails, setLocalProcessDetails] = useState<
|
const [localProcessDetails, setLocalProcessDetails] = useState<
|
||||||
@@ -49,7 +49,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalProcessDetails({});
|
setLocalProcessDetails({});
|
||||||
setLoadingProcessId(null);
|
setLoadingProcessId(null);
|
||||||
}, [attemptId]);
|
}, [sessionId]);
|
||||||
|
|
||||||
const handleCopyLogs = useCallback(async () => {
|
const handleCopyLogs = useCallback(async () => {
|
||||||
if (logs.length === 0) return;
|
if (logs.length === 0) return;
|
||||||
@@ -121,7 +121,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
|||||||
|
|
||||||
// Automatically fetch process details when selectedProcessId changes
|
// Automatically fetch process details when selectedProcessId changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!attemptId || !selectedProcessId) {
|
if (!sessionId || !selectedProcessId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
|||||||
fetchProcessDetails(selectedProcessId);
|
fetchProcessDetails(selectedProcessId);
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
attemptId,
|
sessionId,
|
||||||
selectedProcessId,
|
selectedProcessId,
|
||||||
localProcessDetails,
|
localProcessDetails,
|
||||||
loadingProcessId,
|
loadingProcessId,
|
||||||
@@ -150,7 +150,7 @@ function ProcessesTab({ attemptId }: ProcessesTabProps) {
|
|||||||
|
|
||||||
const { isProcessGreyed } = useRetryUi();
|
const { isProcessGreyed } = useRetryUi();
|
||||||
|
|
||||||
if (!attemptId) {
|
if (!sessionId) {
|
||||||
return (
|
return (
|
||||||
<div className="flex-1 flex items-center justify-center text-muted-foreground">
|
<div className="flex-1 flex items-center justify-center text-muted-foreground">
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
import { MoreHorizontal } from 'lucide-react';
|
import { MoreHorizontal } from 'lucide-react';
|
||||||
import type { TaskWithAttemptStatus } from 'shared/types';
|
import type { TaskWithAttemptStatus } from 'shared/types';
|
||||||
import type { Workspace } from 'shared/types';
|
|
||||||
import { useOpenInEditor } from '@/hooks/useOpenInEditor';
|
import { useOpenInEditor } from '@/hooks/useOpenInEditor';
|
||||||
import { DeleteTaskConfirmationDialog } from '@/components/dialogs/tasks/DeleteTaskConfirmationDialog';
|
import { DeleteTaskConfirmationDialog } from '@/components/dialogs/tasks/DeleteTaskConfirmationDialog';
|
||||||
import { ViewProcessesDialog } from '@/components/dialogs/tasks/ViewProcessesDialog';
|
import { ViewProcessesDialog } from '@/components/dialogs/tasks/ViewProcessesDialog';
|
||||||
@@ -27,10 +26,11 @@ import { openTaskForm } from '@/lib/openTaskForm';
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
|
import type { SharedTaskRecord } from '@/hooks/useProjectTasks';
|
||||||
import { useAuth } from '@/hooks';
|
import { useAuth } from '@/hooks';
|
||||||
|
import { WorkspaceWithSession } from '@/types/attempt';
|
||||||
|
|
||||||
interface ActionsDropdownProps {
|
interface ActionsDropdownProps {
|
||||||
task?: TaskWithAttemptStatus | null;
|
task?: TaskWithAttemptStatus | null;
|
||||||
attempt?: Workspace | null;
|
attempt?: WorkspaceWithSession | null;
|
||||||
sharedTask?: SharedTaskRecord;
|
sharedTask?: SharedTaskRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ export function ActionsDropdown({
|
|||||||
const handleViewProcesses = (e: React.MouseEvent) => {
|
const handleViewProcesses = (e: React.MouseEvent) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (!attempt?.id) return;
|
if (!attempt?.id) return;
|
||||||
ViewProcessesDialog.show({ attemptId: attempt.id });
|
ViewProcessesDialog.show({ sessionId: attempt.session?.id });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleViewRelatedTasks = (e: React.MouseEvent) => {
|
const handleViewRelatedTasks = (e: React.MouseEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user