Fix terminal resize bug

Fix resize handling in TerminalView component and update related tests
This commit is contained in:
2026-07-25 14:54:57 +02:00
parent 6a87c4635f
commit da907b880e
4 changed files with 117 additions and 32 deletions

View File

@ -384,8 +384,6 @@ describe("LiveProjectPanel — cellLayoutVersion (ticket #61 web regression)", (
const archiRow = screen.getByText("Archi").closest("li")!;
fireEvent.click(within(archiRow).getByRole("button", { name: "Ouvrir" }));
await screen.findByTestId("web-agent-cell");
// First cell mounted: at least the one guaranteed fit-on-mount happened.
expect(fitSpy.mock.calls.length).toBeGreaterThan(0);
// Switch to a different agent's cell — the panel shows one cell at a time,
// so this replaces (unmounts A, mounts B) rather than adding a second.
@ -398,8 +396,9 @@ describe("LiveProjectPanel — cellLayoutVersion (ticket #61 web regression)", (
// jsdom reports a zero-size layout box, which the refit deliberately skips
// — give the freshly-mounted cell's inner xterm container a real size so
// the refitSignal-driven refit actually reaches `fit.fit()`.
const containerB = cellB.querySelector('[data-testid="terminal-view"]')!
.firstElementChild as HTMLElement;
const containerB = cellB.querySelector(
'[data-testid="terminal-xterm-container"]',
) as HTMLElement;
Object.defineProperty(containerB, "clientWidth", { value: 400, configurable: true });
Object.defineProperty(containerB, "clientHeight", { value: 200, configurable: true });