Skip to content

fix(agent): keep agent chat sidebar scroll container shrinkable - #18252

Open
euvre wants to merge 1 commit into
infiniflow:mainfrom
euvre:fix/agent-chat-sidebar-auto-scroll
Open

fix(agent): keep agent chat sidebar scroll container shrinkable#18252
euvre wants to merge 1 commit into
infiniflow:mainfrom
euvre:fix/agent-chat-sidebar-auto-scroll

Conversation

@euvre

@euvre euvre commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

In the agent canvas debug chat sidebar, the streaming answer area could fail to stay anchored to the bottom because the message-list scroll container (web/src/pages/agent/chat/box.tsx) was a flex-1 overflow-auto flex item without an explicit min-h-0. Both sibling chat containers already carry min-h-0 on the same pattern:

  • web/src/pages/next-chats/chat/chat-box/single-chat-box.tsx (line 86)
  • web/src/pages/agent/explore/components/session-chat.tsx (line 122)

Change

Add min-h-0 to the scroll container class list in box.tsx, so the flex item is explicitly shrinkable instead of relying on overflow:auto zeroing its automatic minimum size, keeping the auto-scroll-to-bottom behavior stable regardless of how ancestors size the flex column.

Verification

Ran the agent debug chat drawer against a ~6k-char streaming answer and sampled the scroll container every second: scrollTop + clientHeight >= scrollHeight - 25 held for every sample (atBottom true), computed min-height: 0px, and the drawer layout is unchanged.

Add min-h-0 to the message list scroll container in the agent debug
chat drawer (pages/agent/chat/box.tsx), matching the sibling chat
containers (next-chats/chat/chat-box/single-chat-box.tsx,
agent/explore/components/session-chat.tsx) which already carry it.

Without an explicit min-h-0 the flex item relies on overflow:auto
zeroing its automatic minimum size; making it explicit keeps the
streaming answer view anchored to the bottom of the sidebar regardless
of how ancestors size the flex column.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. 🧰 typescript Pull requests that update Typescript code labels Aug 13, 2026
@euvre euvre added the ci Continue Integration label Aug 13, 2026
@euvre
euvre requested a review from wangq8 August 13, 2026 21:41
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fa6b906-212f-4ec2-b775-e232711a08bc

📥 Commits

Reviewing files that changed from the base of the PR and between 423c848 and 2925bd7.

📒 Files selected for processing (1)
  • web/src/pages/agent/chat/box.tsx

📝 Walkthrough

Walkthrough

The chat message container now uses min-h-0 in its flex layout. Existing scrolling behavior and ref assignment remain unchanged.

Changes

Chat layout

Layer / File(s) Summary
Message container sizing
web/src/pages/agent/chat/box.tsx
The message container adds min-h-0 while retaining its scrollable flex behavior and ref assignment.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Mergeability Score: ⚪ Minimal · up to 2925b

This change makes the chat scroll container explicitly shrinkable to preserve streaming auto-scroll behavior without changing the drawer layout; no actionable merge-blocking risk remains.

Suggested reviewers: dcc123456

Poem

A bunny nudges the chat box low,
So messages can scroll and flow.
With min-h-0 in place,
Flex space finds its place.
Hop, hop—smooth chats now grow!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the problem, change, and verification, but it uses different headings from the repository template.
Title check ✅ Passed The title clearly and concisely describes the fix to keep the agent chat sidebar scroll container shrinkable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. Adding min-h-0 to the flex-1 overflow-auto scroll container is correct and matches the sibling chat containers (single-chat-box.tsx, session-chat.tsx). This is the canonical fix for the flex-item automatic-minimum-size issue that breaks bottom-anchored auto-scroll. LGTM.

@wangq8
wangq8 requested a review from cike8899 August 14, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants