From 411f46a5eaab9748ff1e9b2df8f92a8b9d92035a Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 1 Jul 2026 00:13:47 -0700 Subject: [PATCH] fix(FN-7344): keep planner chat empty state at top --- .../dashboard/app/components/TaskPlannerChatTab.css | 11 ++++++++++- .../dashboard/app/components/TaskPlannerChatTab.tsx | 4 ++++ ...skDetailModal.responsive-and-dependencies.test.tsx | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/dashboard/app/components/TaskPlannerChatTab.css b/packages/dashboard/app/components/TaskPlannerChatTab.css index 596020b55d..33074b8e89 100644 --- a/packages/dashboard/app/components/TaskPlannerChatTab.css +++ b/packages/dashboard/app/components/TaskPlannerChatTab.css @@ -72,7 +72,6 @@ Planner Chat expansion should use the same in-view floating affordance as Activi .task-planner-chat-state, .task-planner-chat-empty { - margin: auto; display: flex; align-items: center; gap: var(--space-sm); @@ -80,15 +79,25 @@ Planner Chat expansion should use the same in-view floating affordance as Activi text-align: center; } +.task-planner-chat-state { + margin: auto; +} + .task-planner-chat-empty { position: relative; flex-direction: column; width: 100%; max-width: 42rem; + margin: 0 auto auto; gap: var(--space-lg); padding-top: var(--space-md); } +/* +FNXC:TaskDetailPlannerChat 2026-07-02-00:41: +An empty Planner Chat transcript should enter at the top of the chat surface instead of auto-centering or inheriting the message auto-scroll-to-bottom behavior. Once real messages exist, message streaming still scrolls to the latest entry. +*/ + .task-planner-chat-empty-copy { display: flex; flex-direction: column; diff --git a/packages/dashboard/app/components/TaskPlannerChatTab.tsx b/packages/dashboard/app/components/TaskPlannerChatTab.tsx index 5032017cf8..62389be625 100644 --- a/packages/dashboard/app/components/TaskPlannerChatTab.tsx +++ b/packages/dashboard/app/components/TaskPlannerChatTab.tsx @@ -319,6 +319,10 @@ export function TaskPlannerChatTab({ task, projectId, active, expanded = false, useEffect(() => { if (!transcriptRef.current) return; + if (messages.length === 0) { + transcriptRef.current.scrollTop = 0; + return; + } transcriptRef.current.scrollTop = transcriptRef.current.scrollHeight; }, [messages, composerState]); diff --git a/packages/dashboard/app/components/__tests__/TaskDetailModal.responsive-and-dependencies.test.tsx b/packages/dashboard/app/components/__tests__/TaskDetailModal.responsive-and-dependencies.test.tsx index 8739332d1d..e196c5046f 100644 --- a/packages/dashboard/app/components/__tests__/TaskDetailModal.responsive-and-dependencies.test.tsx +++ b/packages/dashboard/app/components/__tests__/TaskDetailModal.responsive-and-dependencies.test.tsx @@ -128,6 +128,7 @@ describe("TaskDetailModal", () => { expect(modelBlock).toContain("left: 0;"); expect(modelBlock).toContain("inline-size: calc(var(--space-2xl) - var(--space-xs));"); expect(modelBlock).not.toContain("text-overflow: ellipsis;"); + expect(css).toMatch(/\.task-planner-chat-empty\s*\{[^}]*margin:\s*0 auto auto;/); expect(composerBlock).toContain("display: flex;"); expect(composerBlock).toContain("flex-wrap: wrap;"); expect(composerBlock).toContain("align-items: stretch;");