Skip to content

Commit 7010f8d

Browse files
authored
🤖 fix: keep ChatInput centered on ProjectPage with many archived workspaces (#1277)
Separates the ChatInput and ArchivedWorkspaces into distinct layout sections so that the ChatInput stays vertically centered in the top portion of the viewport (50vh) regardless of how many archived workspaces exist. Previously, both were in a single flex container with `justify-center`, causing the ChatInput to move away from center when there were many archived workspaces. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
1 parent 18a7d72 commit 7010f8d

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

‎src/browser/components/ProjectPage.tsx‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,8 @@ export const ProjectPage: React.FC<ProjectPageProps> = ({
6565
<ConnectionStatusIndicator />
6666
{/* Scrollable content area */}
6767
<div className="min-h-0 flex-1 overflow-y-auto">
68-
{/*
69-
IMPORTANT: Keep vertical centering off the scroll container.
70-
When a flex scroll container uses justify-center and content becomes tall,
71-
browsers can end up with a scroll origin that makes the top feel "cut off".
72-
*/}
73-
<div className="flex min-h-full flex-col items-center justify-center gap-6 p-4">
74-
{/* Chat input card */}
68+
{/* Top section: centers ChatInput in top portion of viewport */}
69+
<div className="flex min-h-[50vh] flex-col items-center justify-center p-4">
7570
<ChatInput
7671
variant="creation"
7772
projectPath={projectPath}
@@ -80,8 +75,10 @@ export const ProjectPage: React.FC<ProjectPageProps> = ({
8075
onReady={handleChatReady}
8176
onWorkspaceCreated={onWorkspaceCreated}
8277
/>
83-
{/* Archived workspaces below chat */}
84-
{archivedWorkspaces.length > 0 && (
78+
</div>
79+
{/* Archived workspaces: separate section below centered area */}
80+
{archivedWorkspaces.length > 0 && (
81+
<div className="flex justify-center px-4 pb-4">
8582
<div className="w-full max-w-3xl">
8683
<ArchivedWorkspaces
8784
projectPath={projectPath}
@@ -96,8 +93,8 @@ export const ProjectPage: React.FC<ProjectPageProps> = ({
9693
}}
9794
/>
9895
</div>
99-
)}
100-
</div>
96+
</div>
97+
)}
10198
</div>
10299
</ThinkingProvider>
103100
</ProviderOptionsProvider>

0 commit comments

Comments
 (0)