fix(FN-7344): keep planner chat empty state at top

This commit is contained in:
gsxdsm
2026-07-01 00:13:47 -07:00
parent 35d37d603d
commit 411f46a5ea
3 changed files with 15 additions and 1 deletions

View File

@@ -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;

View File

@@ -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]);

View File

@@ -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;");