diff --git a/src/components/chat/AgentWorkspace.test.tsx b/src/components/chat/AgentWorkspace.test.tsx
index bf27416..9d6c019 100644
--- a/src/components/chat/AgentWorkspace.test.tsx
+++ b/src/components/chat/AgentWorkspace.test.tsx
@@ -216,6 +216,27 @@ describe("AgentWorkspace", () => {
expect(renderCounts.size).toBeLessThan(40);
});
+ it("preserves the flex alignment context around windowed turns", () => {
+ const messages = Array.from({ length: 41 }, (_, index): Message => ({
+ id: `message-${index}`,
+ role: index % 2 === 0 ? "user" : "assistant",
+ content: `message ${index}`,
+ }));
+
+ render(
+ ,
+ );
+
+ expect(screen.getByTestId("turn-message-0").parentElement).toHaveStyle({
+ display: "flex",
+ flexDirection: "column",
+ });
+ });
+
it("keeps visible turns mounted when crossing the windowing threshold", () => {
const messages = Array.from({ length: 41 }, (_, index): Message => ({
id: `message-${index}`,
diff --git a/src/components/chat/AgentWorkspace.tsx b/src/components/chat/AgentWorkspace.tsx
index 95f2da1..5922da4 100644
--- a/src/components/chat/AgentWorkspace.tsx
+++ b/src/components/chat/AgentWorkspace.tsx
@@ -254,7 +254,12 @@ const MeasuredTurn = ({
return (
{children}