feat(FN-3975): keep interview-stage missions visible in mission list
Made interview-stage missions visible in the mission list (MissionManager) and documented the behavior in the missions reference. Tests added for the new visibility logic. Fusion-Task-Id: FN-3975
This commit is contained in:
@@ -3546,7 +3546,7 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
|
||||
);
|
||||
});
|
||||
|
||||
const renderMissionListItems = () => missions.map((mission) => {
|
||||
const renderMissionListItems = (missionList: MissionWithSummary[], options?: { interviewStyle?: boolean }) => missionList.map((mission) => {
|
||||
const m = mission;
|
||||
const isSelected = selectedMission?.id === m.id;
|
||||
const statusColors = missionStatusColors[m.status as MissionStatus] || { bg: "", text: "" };
|
||||
@@ -3559,11 +3559,12 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
|
||||
const tasksFailed = health?.tasksFailed ?? 0;
|
||||
const progressPercent = health?.estimatedCompletionPercent ?? summary?.progressPercent ?? 0;
|
||||
const showSummaryBlock = hasContent || totalTasks > 0 || tasksFailed > 0 || Boolean(health?.lastActivityAt);
|
||||
const isInterviewStyle = options?.interviewStyle === true;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={m.id}
|
||||
className={`mission-list__item ${isSelected ? "mission-list__item--selected" : ""}`}
|
||||
className={`mission-list__item ${isSelected ? "mission-list__item--selected" : ""} ${isInterviewStyle ? "mission-list__item--interview" : ""}`}
|
||||
onClick={() => handleSelectMission(mission)}
|
||||
>
|
||||
<div className="mission-list__item-content">
|
||||
@@ -3589,10 +3590,17 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
|
||||
>
|
||||
{m.status}
|
||||
</span>
|
||||
{isInterviewStyle && (
|
||||
<span className="mission-status-badge mission-status-badge--sm mission-interview-status mission-interview-status--awaiting_input">
|
||||
Interview in progress
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{m.description && (
|
||||
{isInterviewStyle ? (
|
||||
<p className="mission-list__item-description">Mission interview is still in progress. Open this mission to continue planning.</p>
|
||||
) : m.description ? (
|
||||
<p className="mission-list__item-description">{m.description}</p>
|
||||
)}
|
||||
) : null}
|
||||
{showSummaryBlock && (
|
||||
<div className="mission-list__item-summary">
|
||||
{hasContent && (
|
||||
@@ -3685,6 +3693,8 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
|
||||
});
|
||||
|
||||
const renderMissionListContent = ({ hideBottomButtons = false }: { hideBottomButtons?: boolean } = {}) => {
|
||||
const persistedInterviewMissions = missions.filter((mission) => mission.interviewState === "in_progress");
|
||||
const standardMissions = missions.filter((mission) => mission.interviewState !== "in_progress");
|
||||
const showMobileTopPlanButton = isMobile && missions.length > 0 && !isCreatingMission;
|
||||
const showBottomPlanButton = !hideBottomButtons && !showMobileTopPlanButton;
|
||||
|
||||
@@ -3732,7 +3742,8 @@ export function MissionManager({ isOpen, isInline = false, onClose, addToast, pr
|
||||
)}
|
||||
|
||||
{/* Mission and interview items */}
|
||||
{renderMissionListItems()}
|
||||
{renderMissionListItems(persistedInterviewMissions, { interviewStyle: true })}
|
||||
{renderMissionListItems(standardMissions)}
|
||||
{renderInterviewSessionItems()}
|
||||
|
||||
{/* Edit mission form */}
|
||||
|
||||
@@ -76,6 +76,7 @@ const mockMissions = [
|
||||
title: "Build Auth System",
|
||||
description: "Complete authentication flow",
|
||||
status: "planning",
|
||||
interviewState: "not_started",
|
||||
milestones: [],
|
||||
createdAt: "2026-01-01T00:00:00.000Z",
|
||||
updatedAt: "2026-01-01T00:00:00.000Z",
|
||||
@@ -85,6 +86,7 @@ const mockMissions = [
|
||||
title: "API Redesign",
|
||||
description: "Redesign the REST API",
|
||||
status: "active",
|
||||
interviewState: "not_started",
|
||||
autopilotEnabled: true,
|
||||
autopilotState: "watching",
|
||||
milestones: [],
|
||||
@@ -1651,6 +1653,59 @@ describe("MissionManager", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps persisted interview-stage missions visible with interview styling and mission selection behavior", async () => {
|
||||
const missionsWithInterview = [
|
||||
{
|
||||
id: "M-INTERVIEW",
|
||||
title: "Reliability planning draft",
|
||||
description: "Should remain visible while interview planning is in progress",
|
||||
status: "planning",
|
||||
interviewState: "in_progress",
|
||||
milestones: [],
|
||||
createdAt: "2026-01-06T00:00:00.000Z",
|
||||
updatedAt: "2026-01-06T00:00:00.000Z",
|
||||
},
|
||||
...mockMissions,
|
||||
];
|
||||
|
||||
mockFetchAiSessions.mockResolvedValueOnce([]);
|
||||
|
||||
globalThis.fetch = createFetchMockWithHealth(missionsWithInterview as Array<Record<string, unknown>>, {
|
||||
...mockMissionHealthById,
|
||||
"M-INTERVIEW": {
|
||||
missionId: "M-INTERVIEW",
|
||||
status: "planning",
|
||||
tasksCompleted: 0,
|
||||
tasksFailed: 0,
|
||||
tasksInFlight: 0,
|
||||
totalTasks: 0,
|
||||
estimatedCompletionPercent: 0,
|
||||
autopilotState: "inactive",
|
||||
autopilotEnabled: false,
|
||||
},
|
||||
});
|
||||
|
||||
render(<MissionManager isOpen={true} onClose={vi.fn()} addToast={vi.fn()} />);
|
||||
|
||||
const interviewMissionTitle = await screen.findByText("Reliability planning draft");
|
||||
const interviewMissionRow = interviewMissionTitle.closest(".mission-list__item");
|
||||
expect(interviewMissionRow).toBeTruthy();
|
||||
expect(interviewMissionRow).toHaveClass("mission-list__item--interview");
|
||||
|
||||
expect(within(interviewMissionRow as HTMLElement).getByText("Interview in progress")).toBeInTheDocument();
|
||||
expect(
|
||||
within(interviewMissionRow as HTMLElement).getByText(
|
||||
"Mission interview is still in progress. Open this mission to continue planning.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(interviewMissionTitle);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText("Database Schema")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("shows in-progress interview sessions in the main mission list without footer resume duplication", async () => {
|
||||
mockFetchAiSessions.mockResolvedValueOnce([
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user