refactor(ui): supprime le popup de reprise par cellule (#177)

Retire la surface utilisateur de reprise par cellule :
- supprime ResumeConversationPopup et son test (resumeConversationPopup.test.tsx)
- débranche l'appel dans LayoutGrid et retire l'export terminals/index
- ajuste les tests dépendants (libellé « Terminé » dans LayoutGrid.chat.test, refitEpoch)
- commentaire affiné dans ResumeProjectPanel

La reprise implicite éventuelle sera rediscutée ultérieurement (objectif immédiat : retirer la surface).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-11 12:24:57 +02:00
parent 30442d05fe
commit 215bc16f21
7 changed files with 4 additions and 562 deletions

View File

@ -1,120 +0,0 @@
/**
* Resume-conversation popup (T7). Shown for an agent cell whose PTY session is
* dead but which carries a persisted `conversationId`, **before** the automatic
* Resume launch fires. It lets the user choose between resuming the previous CLI
* conversation or starting a fresh one.
*
* Pure presentation: it receives the status + best-effort details + the two
* action callbacks. It never calls a gateway / `invoke()` itself — the parent
* (`LayoutGrid`'s `LeafView`) wires it to the {@link AgentGateway} ports. The
* status ("en cours" / "clot") is derived **only** from `agentWasRunning` (the
* universal close-time flag), never from the inspector — a missing inspector
* just hides the enriched topic/token lines (degraded mode).
*/
import type { ConversationDetails } from "@/ports";
interface ResumeConversationPopupProps {
/**
* Whether the agent process was running when the cell was last closed
* (`agentWasRunning`). `true` ⇒ "en cours"; `false`/absent ⇒ "clot". This is
* the universal status; it is NOT derived from the inspector.
*/
agentWasRunning: boolean;
/**
* Best-effort enriched details (last topic + token indicator). `null` while
* loading; an empty object once loaded with no details available (degraded
* mode: only the status + the resume affordance are shown).
*/
details: ConversationDetails | null;
/** Resume the previous conversation (keeps the conversation id ⇒ Resume). */
onResume: () => void;
/** Start a fresh conversation (clears the conversation id ⇒ Assign). */
onNewConversation: () => void;
}
export function ResumeConversationPopup({
agentWasRunning,
details,
onResume,
onNewConversation,
}: ResumeConversationPopupProps) {
const statusLabel = agentWasRunning ? "en cours" : "clot";
return (
<div
data-testid="resume-conversation-popup"
role="dialog"
aria-label="Reprise de conversation"
style={{
position: "absolute",
inset: 0,
zIndex: 5,
display: "flex",
alignItems: "center",
justifyContent: "center",
background: "rgba(0, 0, 0, 0.55)",
}}
>
<div
style={{
minWidth: 260,
maxWidth: 360,
padding: "16px 18px",
background: "var(--color-surface, #1e1e1e)",
color: "var(--color-content, #e0e0e0)",
border: "1px solid var(--color-border, #3a3a3a)",
borderRadius: 6,
boxShadow: "0 8px 24px rgba(0, 0, 0, 0.5)",
fontSize: 13,
}}
>
<p style={{ margin: "0 0 8px", fontWeight: 600 }}>
Reprise de conversation
</p>
<p style={{ margin: "0 0 6px" }}>
Statut :{" "}
<span data-testid="resume-status">{statusLabel}</span>
</p>
{details?.lastTopic && (
<p style={{ margin: "0 0 6px" }} data-testid="resume-last-topic">
Dernier sujet : {details.lastTopic}
</p>
)}
{details?.tokenCount !== undefined && (
<p style={{ margin: "0 0 10px" }} data-testid="resume-token-count">
Tokens : {details.tokenCount}
</p>
)}
<div style={{ display: "flex", gap: 8, marginTop: 12 }}>
<button
type="button"
onClick={onResume}
style={{
flex: 1,
padding: "6px 10px",
cursor: "pointer",
}}
>
Reprendre la dernière conversation
</button>
<button
type="button"
onClick={onNewConversation}
style={{
flex: 1,
padding: "6px 10px",
cursor: "pointer",
}}
>
Nouvelle conversation
</button>
</div>
</div>
</div>
);
}

View File

@ -2,6 +2,5 @@
export { TerminalView } from "./TerminalView";
export type { TerminalInputApi } from "./TerminalView";
export { ResumeConversationPopup } from "./ResumeConversationPopup";
export { useWritePortal } from "./useWritePortal";
export type { UseWritePortalResult } from "./useWritePortal";