Skip to content

regression: Touchables not working on old messages in some devices#7039

Merged
diegolmello merged 1 commit intodevelopfrom
fix.inverted-list
Mar 5, 2026
Merged

regression: Touchables not working on old messages in some devices#7039
diegolmello merged 1 commit intodevelopfrom
fix.inverted-list

Conversation

@diegolmello
Copy link
Copy Markdown
Member

@diegolmello diegolmello commented Mar 5, 2026

Proposed changes

Issue(s)

Regression introduced on #6934
https://rocketchat.atlassian.net/browse/CORE-1906
https://rocketchat.atlassian.net/browse/SUP-1001
Closes #7026

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Refactor
    • Simplified the inverted scroll component implementation and public interface, reducing internal complexity while preserving existing scrolling behavior and user experience. The component now exposes a standard scroll view signature, improving maintainability without changing visible functionality.

@diegolmello diegolmello temporarily deployed to approve_e2e_testing March 5, 2026 13:56 — with GitHub Actions Inactive
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9cebb4de-1bcf-475b-9060-333cb2b4a39f

📥 Commits

Reviewing files that changed from the base of the PR and between 66d94e6 and 0366fcb.

📒 Files selected for processing (1)
  • app/views/RoomView/List/components/InvertedScrollView.tsx

Walkthrough

Replaced a custom hybrid InvertedScrollView implementation with a simplified wrapper that renders a standard ScrollView whose single child is a native InvertedScrollContentView. Removed custom ref type and internal methods; public API now mirrors a plain ScrollView forwardRef signature.

Changes

Cohort / File(s) Summary
InvertedScrollView refactor
app/views/RoomView/List/components/InvertedScrollView.tsx
Removed complex multi-API Android/JS hybrid implementation, custom refs and methods (scrollTo, scrollToEnd, flashScrollIndicators), and extra layout/style logic. Introduced NativeInvertedScrollContentView = requireNativeComponent<ViewProps>('InvertedScrollContentView') and simplified export to forwardRef<ScrollView, ScrollViewProps> with children wrapped by the native content view. Removed InvertedScrollViewRef, NativeInvertedScrollView, and related types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'regression: Touchables not working on old messages in some devices' does not match the actual changes, which focus on simplifying the InvertedScrollView component implementation. Update the title to accurately reflect the main change, such as 'refactor: Simplify InvertedScrollView component implementation' or 'fix: ScrollView wrapper for InvertedScrollView'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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.

@diegolmello diegolmello changed the title fix: ScrollView wrapper regression: Touchables not working on old messages in some devices Mar 5, 2026
@diegolmello diegolmello temporarily deployed to experimental_ios_build March 5, 2026 14:00 — with GitHub Actions Inactive
@diegolmello diegolmello had a problem deploying to official_android_build March 5, 2026 14:00 — with GitHub Actions Failure
@diegolmello diegolmello temporarily deployed to experimental_android_build March 5, 2026 14:00 — with GitHub Actions Inactive
Copy link
Copy Markdown
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/views/RoomView/List/components/InvertedScrollView.tsx (1)

4-4: The native component InvertedScrollContentView is Android-only (confirmed by native module registration in InvertedScrollContentViewManager.java). On iOS, requireNativeComponent will throw a runtime error. However, this component is only used in one location (List.tsx:47), where it already has a platform guard (isIOS ? undefined : props => <InvertedScrollView {...props} />), so there is no active risk.

If you want additional defensive programming, consider adding a platform guard at the component level:

import { Platform } from 'react-native';

if (Platform.OS === 'ios') {
  throw new Error('InvertedScrollView is only supported on Android');
}

This would catch any accidental imports in the future, though the current guard at the usage site is sufficient.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/views/RoomView/List/components/InvertedScrollView.tsx` at line 4, The
module currently calls requireNativeComponent('InvertedScrollContentView') via
NativeInvertedScrollContentView which is Android-only and will throw on iOS if
imported; add a platform guard at the top of InvertedScrollView (use
Platform.OS) to throw a clear Error (e.g., "InvertedScrollView is only supported
on Android") or export a no-op on iOS so accidental imports fail fast; ensure
you reference NativeInvertedScrollContentView and any exported component names
(e.g., InvertedScrollView) when applying the guard so the requireNativeComponent
is never executed on iOS.
🤖 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/views/RoomView/List/components/InvertedScrollView.tsx`:
- Line 4: The module currently calls
requireNativeComponent('InvertedScrollContentView') via
NativeInvertedScrollContentView which is Android-only and will throw on iOS if
imported; add a platform guard at the top of InvertedScrollView (use
Platform.OS) to throw a clear Error (e.g., "InvertedScrollView is only supported
on Android") or export a no-op on iOS so accidental imports fail fast; ensure
you reference NativeInvertedScrollContentView and any exported component names
(e.g., InvertedScrollView) when applying the guard so the requireNativeComponent
is never executed on iOS.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6fbc6aab-49c1-4e65-a7be-90b545243eac

📥 Commits

Reviewing files that changed from the base of the PR and between dbba268 and 66d94e6.

📒 Files selected for processing (1)
  • app/views/RoomView/List/components/InvertedScrollView.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🔇 Additional comments (3)
app/views/RoomView/List/components/InvertedScrollView.tsx (3)

1-2: LGTM! Clean imports with proper type-only imports.

The imports are well-structured and use the type keyword for type-only imports, which is a TypeScript best practice that helps with tree-shaking and build optimization.


6-11: Excellent documentation of the component's purpose and constraints.

The JSDoc clearly explains:

  • Platform limitation (Android-only)
  • The accessibility problem being solved (TalkBack reading order)
  • What behavior is preserved (ScrollView JS-side semantics)

This helps prevent misuse and makes the component's intent clear.


12-20: No changes needed. The component is correctly implemented and compatible with FlatList usage.

The review comment identifies a non-existent concern. The listRef prop is explicitly typed as RefObject<FlatList> (definitions.ts line 7), not as a reference to InvertedScrollView. All methods called on listRef in the codebase—scrollToOffset, scrollToIndex, and scrollToEnd—are FlatList methods, which are all available. InvertedScrollView is used internally as the scroll component for FlatList (via renderScrollComponent prop), and FlatList manages this component internally. The ref forwarding in InvertedScrollView correctly forwards the ref to its internal ScrollView, which is the intended behavior.

			> Likely an incorrect or invalid review comment.

@diegolmello diegolmello had a problem deploying to upload_experimental_android March 5, 2026 14:40 — with GitHub Actions Failure
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

iOS Build Available

Rocket.Chat Experimental 4.71.0.108340

@diegolmello diegolmello merged commit b99320a into develop Mar 5, 2026
2 of 3 checks passed
@diegolmello diegolmello deleted the fix.inverted-list branch March 5, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Regression: Can't interact with older messages

2 participants