Skip to content

fix: resolve chat UI scrolling issues with flexbox layout #31

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

Closed
wants to merge 1 commit into from

Conversation

kahirokunn
Copy link
Contributor

Description

This PR fixes the scrolling issues in the chat UI where the body element was stuck at 100vh height, causing content to scroll within a constrained container instead of naturally expanding.

Problem

  • Body height was fixed at 100vh with internal scrolling
  • UI was buggy when content exceeded viewport height
  • ScrollArea component was creating nested scrolling contexts
  • Content was hidden behind fixed-positioned InputForm

Solution

  • Replaced ScrollArea component with native overflow-y-auto
  • Implemented proper flexbox layout with h-screen on root container
  • Moved InputForm from fixed positioning to normal document flow
  • Used useRef for React-idiomatic scroll control instead of document.querySelector
  • Removed unnecessary wrapper divs and overflow-hidden constraints

Changes

App.tsx

  • Removed ScrollArea viewport query logic
  • Simplified component structure by removing wrapper div
  • Updated scroll logic to use ref directly

ChatMessagesView.tsx

  • Removed ScrollArea component import and usage
  • Added flex-1 overflow-y-auto to chat messages container
  • Placed InputForm in normal flow with border separator

Screenshots

Before

After

Testing

  • Tested with long chat conversations
  • Verified scroll-to-bottom behavior on new messages
  • Confirmed InputForm stays visible at bottom
  • Checked responsive behavior on different screen sizes

Related Issues

Fixes #[issue-number] (if applicable)

- Remove ScrollArea component in favor of native overflow-y-auto
- Implement flexbox layout with fixed height (h-screen) for proper space distribution
- Place InputForm in normal flow instead of fixed positioning
- Use useRef for React-idiomatic scroll control
- Remove unnecessary overflow-hidden and wrapper divs

This ensures the chat area scrolls properly within its container when
messages overflow, fixing the UI bugs.

Signed-off-by: kahirokunn <[email protected]>
@philschmid
Copy link
Contributor

Can you check main. I think that was fixed in another PR.

@kahirokunn
Copy link
Contributor Author

Okay. Thx.

@kahirokunn kahirokunn closed this Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants