Skip to content

fix: Insights chat panel scrolls off-screen after messages load#1991

Open
octo-patch wants to merge 1 commit intoAndyMik90:developfrom
octo-patch:fix/issue-1977-insights-scroll-off-screen
Open

fix: Insights chat panel scrolls off-screen after messages load#1991
octo-patch wants to merge 1 commit intoAndyMik90:developfrom
octo-patch:fix/issue-1977-insights-scroll-off-screen

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Apr 1, 2026

Fixes #1977

Problem

The Insights chat panel becomes invisible after messages load. The content briefly flashes on screen, then scrolls off the top of the viewport because the inner flex column lacks proper height constraints.

Without min-h-0, the flex item respects its default min-height: auto, allowing it to grow taller than its parent. This causes the ScrollArea inside to also grow unconstrained, pushing content beyond the visible viewport.

Fix

Add min-h-0 overflow-hidden to the main chat area's inner flex column container in Insights.tsx:

- <div className="flex flex-1 flex-col">
+ <div className="flex flex-1 flex-col min-h-0 overflow-hidden">

This constrains the flex item's minimum height to 0, allowing the ScrollArea to properly contain its content within the available viewport space.

Notes

The second part of the original issue (scrollIntoView scrolling the wrong ancestor) has already been addressed in the current codebase — the code now uses viewportEl.scrollTop directly instead of scrollIntoView().

Test

  • Open a project with existing Insights chat history (multiple messages)
  • Navigate to the Insights view
  • Verify messages stay visible within the panel and do not scroll off-screen

Summary by CodeRabbit

  • Bug Fixes
    • Improved chat area layout and overflow handling in the Insights component to ensure content displays properly within the available vertical space.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: be599217-c166-4005-b950-6e6fd27363c6

📥 Commits

Reviewing files that changed from the base of the PR and between cba7a02 and 675fa9f.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/components/Insights.tsx

📝 Walkthrough

Walkthrough

The main chat area container in the Insights component received updated Tailwind layout classes to enforce proper flex sizing behavior. The change adds min-h-0 and overflow-hidden constraints to prevent the flex item from growing beyond its parent container's available vertical space.

Changes

Cohort / File(s) Summary
Layout Constraint Fix
apps/desktop/src/renderer/components/Insights.tsx
Added min-h-0 overflow-hidden to the main chat area container's Tailwind classes to enforce proper flex item sizing and overflow handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A flex container grew too tall and wide,
With overflow unseen, the scrolls would hide,
But min-h-0 whispered soft and low,
"Contain yourself, let the viewport show!"
Now chat flows smooth, no more out of sight,
The Insights panel beams with layout delight! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses issue #1977's primary coding requirement by adding min-h-0 overflow-hidden to constrain the flex container, though the secondary scrollIntoView fix mentioned in the issue is not included. Implement the secondary fix to target the Radix UI ScrollArea viewport directly instead of using scrollIntoView, as specified in issue #1977 to prevent scrolling the wrong ancestor.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the fix for the specific issue where the Insights chat panel scrolls off-screen after messages load.
Out of Scope Changes check ✅ Passed The single-line change to add min-h-0 overflow-hidden is directly scoped to the requirements in issue #1977 with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Insights component by adding min-h-0 and overflow-hidden to the main chat area container, which prevents flex blowout and ensures the internal scroll area functions correctly. I have no further feedback to provide.

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.

Insights chat panel scrolls off-screen after messages load

2 participants