From 4ff707bdcb357e8da9971ce2c78f69bcac5476da Mon Sep 17 00:00:00 2001 From: Nexus Dev Date: Sat, 11 Apr 2026 15:58:17 +0000 Subject: [PATCH] fix(nexus): use flex layout for assistant chat thread container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 9 used `h-[calc(100vh-320px)] min-h-[320px]` on the thread wrapper because `@tanstack/react-virtual` needs an explicit height for its virtual scroll root. The calc was brittle — any change to TopStrip or input bar sizing broke the math and let the thread overflow or collapse below 320px. Phase 16a replaces the calc with a pure flex chain: - PersonalAssistant forks its root column: when a conversation is active it renders a `flex-1 min-h-0` child that centers the message list at max-w-[760px] and delegates scroll to the list's own internal virtual scroller. When no conversation is active the old `overflow-auto` wrapper remains so the greeting and empty state still scroll. - ChatMessageList's root becomes `flex min-h-0 flex-1 flex-col`, and its inner scroll div becomes `flex-1 min-h-0 overflow-auto`. The virtualizer now measures the actual flex-derived height, which tracks input-bar size changes automatically. Tests: src/components/frame/ + src/components/assistant/ + ChatMessageList.test — 109 passed (6 todo). Co-Authored-By: Claude Opus 4.6 (1M context) --- ui/src/components/ChatMessageList.tsx | 4 +- ui/src/pages/PersonalAssistant.tsx | 54 +++++++++++++++------------ 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ui/src/components/ChatMessageList.tsx b/ui/src/components/ChatMessageList.tsx index df7d4a5f..c084ff03 100644 --- a/ui/src/components/ChatMessageList.tsx +++ b/ui/src/components/ChatMessageList.tsx @@ -138,10 +138,10 @@ export function ChatMessageList({ } return ( -
+
)} - {/* Conversation thread — full-bleed, max-width 760px centered */} -
-
- {showHomeGreeting && ( - +
+ - )} - - {hasActiveConversation && selectedConvId && ( -
- -
- )} - - {!showHomeGreeting && !selectedConvId && conversationCount === 0 && ( -

No conversations yet.

- )} +
-
+ ) : ( +
+
+ {showHomeGreeting && ( + + )} + + {!showHomeGreeting && !selectedConvId && conversationCount === 0 && ( +

No conversations yet.

+ )} +
+
+ )} {/* Phase 12 — promote-to-project overlay. Absolutely positioned so the chat canvas is covered during the animation while keeping