Skip to content

ADFA-3070 Turns off nested scrolling for the chat list. #1013

Open
hal-eisen-adfa wants to merge 1 commit intostagefrom
ADFA-3070-The-agent-chat-is-not-scrollable-in-landscape
Open

ADFA-3070 Turns off nested scrolling for the chat list. #1013
hal-eisen-adfa wants to merge 1 commit intostagefrom
ADFA-3070-The-agent-chat-is-not-scrollable-in-landscape

Conversation

@hal-eisen-adfa
Copy link
Collaborator

The list still scrolls normally, but it no longer dispatches nested scroll events to the CoordinatorLayout, so the app bar and the rest of the editor UI stay fixed.

…normally, but it no longer dispatches nested scroll events to the CoordinatorLayout, so the app bar and the rest of the editor UI stay fixed.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Release Notes

Chat List Scrolling Improvements

  • Disabled nested scrolling on the chat RecyclerView to prevent the app bar and editor toolbar from scrolling when users interact with the chat list
  • Implemented touch event interception to ensure the chat list has priority over parent container scrolling (e.g., bottom sheet), allowing independent scrolling behavior in landscape mode

⚠️ Risks and Best Practice Concerns

  • Aggressive Touch Interception: The implementation recursively calls requestDisallowInterceptTouchEvent(true) on all parent ViewGroups. While intentional for this use case, this is a forceful approach that could prevent other parent containers from legitimately intercepting touch events in the future
  • Blunt Nested Scrolling Disablement: Setting setNestedScrollingEnabled(false) completely disables nested scrolling coordination. This is a broad workaround that may affect other coordinated scrolling behaviors and toolbar animations if they rely on nested scroll events
  • Incomplete Touch Event Handling: The OnItemTouchListener only handles ACTION_DOWN. Consider whether ACTION_UP or ACTION_CANCEL events should also be handled to restore proper interception state when the user releases or cancels the touch
  • Multiple Touch Listeners: The RecyclerView now has multiple touch listeners (one for keyboard dismissal at line 272, one for touch interception at lines 241-261) which could potentially conflict

Walkthrough

This PR modifies ChatFragment's touch handling behavior by disabling nested scrolling on the chat RecyclerView and attaching an OnItemTouchListener to prevent parent containers from intercepting touch events. This allows the chat list to scroll independently without triggering parent view interactions.

Changes

Cohort / File(s) Summary
Chat Fragment Scroll Behavior
app/src/main/java/com/itsaky/androidide/agent/fragments/ChatFragment.kt
Disables nested scrolling on RecyclerView and adds OnItemTouchListener to intercept ACTION_DOWN events, preventing parent containers from intercepting touch events. New imports added for ViewGroup and ViewCompat support.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • itsaky-adfa
  • jomen-adfa
  • Daniel-ADFA

Poem

🐰 Whiskers twitch with delight,
Scrolling smooth, oh what a sight!
No more fighting with parent views,
Chat bubbles float, no more blues,
A gentle touch, the list glides free,
Nested scrolling? No, not for thee!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: disabling nested scrolling for the chat list, which directly matches the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining that nested scrolling is disabled on the chat list so the app bar and editor UI remain fixed while the list scrolls.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ADFA-3070-The-agent-chat-is-not-scrollable-in-landscape

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
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/agent/fragments/ChatFragment.kt (1)

257-259: Clean up empty override blocks flagged by detekt.

Line 257 and Line 259 are empty blocks (EmptyFunctionBlock). Consider expression bodies to keep the intent explicit and silence warnings.

Suggested cleanup
-				override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) {}
+				override fun onTouchEvent(rv: RecyclerView, e: MotionEvent) = Unit

-				override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {}
+				override fun onRequestDisallowInterceptTouchEvent(disallowIntercept: Boolean) = Unit
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/itsaky/androidide/agent/fragments/ChatFragment.kt`
around lines 257 - 259, Convert the empty override blocks in ChatFragment to
explicit no-op expression bodies to satisfy detekt: replace the empty function
bodies of the RecyclerView touch callbacks (onTouchEvent(rv: RecyclerView, e:
MotionEvent) and onRequestDisallowInterceptTouchEvent(disallowIntercept:
Boolean)) with expression bodies that return Unit (e.g., use = Unit) so the
intent is explicit and EmptyFunctionBlock warnings are silenced; keep the method
signatures and class (ChatFragment) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/main/java/com/itsaky/androidide/agent/fragments/ChatFragment.kt`:
- Around line 257-259: Convert the empty override blocks in ChatFragment to
explicit no-op expression bodies to satisfy detekt: replace the empty function
bodies of the RecyclerView touch callbacks (onTouchEvent(rv: RecyclerView, e:
MotionEvent) and onRequestDisallowInterceptTouchEvent(disallowIntercept:
Boolean)) with expression bodies that return Unit (e.g., use = Unit) so the
intent is explicit and EmptyFunctionBlock warnings are silenced; keep the method
signatures and class (ChatFragment) unchanged.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfd32a0 and 06c09a8.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/agent/fragments/ChatFragment.kt

Copy link
Collaborator

@jatezzz jatezzz left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants