Skip to content

Refactor layout and scrolling for chat and welcome screens #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,7 @@ export default function App() {

return (
<div className="flex h-screen bg-neutral-800 text-neutral-100 font-sans antialiased">
<main className="flex-1 flex flex-col overflow-hidden max-w-4xl mx-auto w-full">
<div
className={`flex-1 overflow-y-auto ${
thread.messages.length === 0 ? "flex" : ""
}`}
>
<main className="h-full w-full max-w-4xl mx-auto">
{thread.messages.length === 0 ? (
<WelcomeScreen
handleSubmit={handleSubmit}
Expand Down Expand Up @@ -188,7 +183,6 @@ export default function App() {
historicalActivities={historicalActivities}
/>
)}
</div>
</main>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/ChatMessagesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ export function ChatMessagesView({
}
};
return (
<div className="flex flex-col h-full overflow-hidden">
<ScrollArea className="flex-1 min-h-0" ref={scrollAreaRef}>
<div className="p-4 md:p-6 pb-2 space-y-2 max-w-4xl mx-auto">
<div className="flex flex-col h-full">
<ScrollArea className="flex-1 overflow-y-auto" ref={scrollAreaRef}>
<div className="p-4 md:p-6 space-y-2 max-w-4xl mx-auto pt-16">
{messages.map((message, index) => {
const isLast = index === messages.length - 1;
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/WelcomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const WelcomeScreen: React.FC<WelcomeScreenProps> = ({
onCancel,
isLoading,
}) => (
<div className="flex flex-col items-center justify-center text-center px-4 flex-1 w-full max-w-3xl mx-auto gap-4">
<div className="h-full flex flex-col items-center justify-center text-center px-4 flex-1 w-full max-w-3xl mx-auto gap-4">
<div>
<h1 className="text-5xl md:text-6xl font-semibold text-neutral-100 mb-3">
Welcome.
Expand Down