From bf9ec9b3580ec73117dfae65ed73d2297ee24bd4 Mon Sep 17 00:00:00 2001 From: Blomios Date: Tue, 8 Sep 2026 12:14:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(layout):=20retirer=20les=20affichages=20Bus?= =?UTF-8?q?y=20et=20Cancel=20de=20la=20cellule=20agent=20au=20lancement=20?= =?UTF-8?q?sur=20une=20t=C3=A2che=20=E2=80=94=20#277=20(retrait=20badge=20?= =?UTF-8?q?Busy,=20bouton=20Cancel/interruptCurrentTurn=20et=20layer=20z?= =?UTF-8?q?=20turnActions;=20=C3=A9tats=20inbox/t=C3=A2ches=20de=20fond=20?= =?UTF-8?q?et=20composer=20busy=20pr=C3=A9serv=C3=A9s;=20QA=20verte=20r?= =?UTF-8?q?=C3=A9-ex=C3=A9cut=C3=A9e:=2025/25=20tests=20LayoutGrid=20cellC?= =?UTF-8?q?ontrolsLayering/chat)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LayoutGrid.cellControlsLayering.test.tsx | 27 +++----- .../features/layout/LayoutGrid.chat.test.tsx | 6 +- frontend/src/features/layout/LayoutGrid.tsx | 66 +------------------ 3 files changed, 13 insertions(+), 86 deletions(-) diff --git a/frontend/src/features/layout/LayoutGrid.cellControlsLayering.test.tsx b/frontend/src/features/layout/LayoutGrid.cellControlsLayering.test.tsx index 5fe7128f..3c05f0b0 100644 --- a/frontend/src/features/layout/LayoutGrid.cellControlsLayering.test.tsx +++ b/frontend/src/features/layout/LayoutGrid.cellControlsLayering.test.tsx @@ -243,10 +243,10 @@ describe("LayoutGrid — ticket #48 cell control layering", () => { expect(screen.getByLabelText(`split ${setup.bId} columns`)).toBeTruthy(); expect(screen.getByLabelText(`split ${setup.bId} rows`)).toBeTruthy(); expect(screen.getByLabelText(`close ${setup.bId}`)).toBeTruthy(); - expect(screen.getByRole("button", { + expect(screen.queryByRole("button", { name: `cancel current turn ${setup.bId}`, - })).toBeTruthy(); - expect(screen.getByText("Busy")).toBeTruthy(); + })).toBeNull(); + expect(screen.queryByText("Busy")).toBeNull(); fireEvent.click(screen.getByLabelText(`split ${setup.bId} columns`)); await waitFor(() => @@ -276,7 +276,7 @@ describe("LayoutGrid — ticket #48 cell control layering", () => { ); }); - it("keeps busy Cancel above persistent cell controls and removes History (#151, #160)", async () => { + it("hides busy controls while keeping persistent cell controls and History removed (#277)", async () => { const setup = await makeSplitAgentGrid(); await setup.layout.mutateLayout("p1", { type: "setCellConversation", @@ -297,24 +297,13 @@ describe("LayoutGrid — ticket #48 cell control layering", () => { renderGrid(setup.gateways, { onOpenConversation: vi.fn() }); await flush(); - act(() => setup.system.emit(busy(setup.agentId, true))); - - const cancel = await screen.findByRole("button", { + expect(screen.queryByRole("button", { name: `cancel current turn ${setup.bId}`, - }); - const status = screen - .getAllByRole("status") - .find((element) => element.textContent === "Busy") as HTMLElement; + })).toBeNull(); + expect(screen.queryByText("Busy")).toBeNull(); const { controls } = controlsFor(setup.bId); - expect(status).toBeTruthy(); - expect(cancel.style.position).toBe("absolute"); - expect(status.style.top).toBe("24px"); - expect(status.style.zIndex).toBe("3"); - expect(cancel.style.top).toBe("24px"); - expect(cancel.style.right).toBe("20px"); - expect(cancel.style.zIndex).toBe("6"); - expect(Number(cancel.style.zIndex)).toBeGreaterThan(Number(controls.style.zIndex)); + expect(controls.style.zIndex).toBe("5"); expect(screen.queryByRole("button", { name: `open cell conversation ${setup.bId}`, })).toBeNull(); diff --git a/frontend/src/features/layout/LayoutGrid.chat.test.tsx b/frontend/src/features/layout/LayoutGrid.chat.test.tsx index 3f4af830..69818b2c 100644 --- a/frontend/src/features/layout/LayoutGrid.chat.test.tsx +++ b/frontend/src/features/layout/LayoutGrid.chat.test.tsx @@ -219,11 +219,11 @@ describe("LayoutGrid custom agent CLI (#147)", () => { expect(await screen.findByTestId("custom-agent-chat-view")).toBeTruthy(); expect(screen.queryByTestId("target-announcements-overlay")).toBeNull(); - expect(screen.getByText("Busy · Main")).toBeTruthy(); + expect(screen.queryByText("Busy · Main")).toBeNull(); expect(screen.getByLabelText(`agent selector ${leaf.id}`)).toBeTruthy(); - expect(screen.getByRole("button", { + expect(screen.queryByRole("button", { name: `cancel current turn ${leaf.id}`, - })).toBeTruthy(); + })).toBeNull(); await waitFor(() => expect(screen.getByLabelText(/message CLI custom/)).toHaveProperty( "disabled", diff --git a/frontend/src/features/layout/LayoutGrid.tsx b/frontend/src/features/layout/LayoutGrid.tsx index 0a5dfa68..b36b7ace 100644 --- a/frontend/src/features/layout/LayoutGrid.tsx +++ b/frontend/src/features/layout/LayoutGrid.tsx @@ -395,7 +395,6 @@ function StoppedAgentCellPanel({ * status/error 3 (in-cell status strip, launch-error banner, notices) * full-cell veils 4 (write-portal + F3 overlays; mutually exclusive) * cell controls 5 (always on top and clickable) - * turn actions 6 (busy-state actions; Cancel must stay visible) * * The terminal/chat body must create its own z-index 0 stacking context. Custom * CLI views can legitimately contain local high-z children (for example their @@ -405,7 +404,6 @@ const CELL_Z = { banner: 3, veil: 4, controls: 5, - turnActions: 6, } as const; const CUSTOM_CHAT_COMPOSER_DEFAULT_HEIGHT = 64; @@ -446,7 +444,6 @@ function LeafView({ const siblingIndex = parentSplit ? (parentSplit.index === 0 ? 1 : 0) : 0; const { agent: agentGateway, - input, profile: profileGateway, system, terminal, @@ -812,16 +809,6 @@ function LeafView({ } }, [agentId, freshRestartedSession, liveAgents]); - async function interruptCurrentTurn(): Promise { - if (!agentId || !input) return; - try { - await input.interrupt(projectId, agentId); - await refreshWorkState(); - } catch (err) { - setBusyNotice({ message: describeNotice(err) }); - } - } - function requestMode(target: AgentCellMode): void { if (!effectiveCustomCliAvailable || target === cellMode) return; if (session) setPendingModeSwitch({ target }); @@ -1323,33 +1310,7 @@ function LeafView({ )} - {agentId && busyByWorkState && ( - - )} - {agentId && (busyByWorkState || inboxDepth > 0 || completedBackgroundTasks.length > 0) && ( + {agentId && (inboxDepth > 0 || completedBackgroundTasks.length > 0) && (
- {busyByWorkState && ( - - {delegatedTicket - ? `Busy · ${delegatedTicket.requesterLabel}` - : "Busy"} - - )} {!busyByWorkState && inboxDepth > 0 && (