fix: reset RoomItem press highlight after leaving a room#7464
fix: reset RoomItem press highlight after leaving a room#7464diegolmello wants to merge 1 commit into
Conversation
The room row kept its pressed highlight after entering a room and navigating back. A legacy RectButton (old gesture-handler API) was nested inside a new GestureDetector; the two arbitration systems do not cooperate, so the button's press-out (which clears the highlight) was dropped when navigation fired synchronously on press. Drop RectButton and drive the highlight from a Gesture.Tap in the same Gesture.Race tree as pan and long-press. Clear it in .onFinalize, which runs on the UI thread for every terminal outcome (success, cancel, or interrupted-by-navigation), so it can no longer get stuck.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (5)**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,jsx,ts,tsx,json}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
app/containers/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-04-30T17:07:51.020ZApplied to files:
📚 Learning: 2026-06-25T18:37:44.793ZApplied to files:
🔇 Additional comments (4)
WalkthroughTouchable.tsx replaces the previous Touch component with KeyboardFocusView and reanimated-based press styling. A new tap gesture is added alongside existing pan and long-press gestures, driving a pressed shared value that interpolates background color via a new pressAnimatedStyle. ChangesTouchable Press-State Animation
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TapGesture
participant PressedValue as pressed (shared value)
participant PressAnimatedStyle
participant Touchable as Touchable Component
User->>TapGesture: onBegin (touch down)
TapGesture->>PressedValue: set pressed = true
PressedValue->>PressAnimatedStyle: interpolate background color
PressAnimatedStyle->>Touchable: update Animated.View style
User->>TapGesture: onEnd (release, success)
TapGesture->>PressedValue: set pressed = false
TapGesture->>Touchable: schedule handlePress
PressedValue->>PressAnimatedStyle: interpolate background color
PressAnimatedStyle->>Touchable: update Animated.View style
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
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. Comment |
|
Android Build Available Rocket.Chat 4.75.0.109275 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNT1XvB4sFQkvmWDQA2YoTRwjpnbQIz6sYOEbJP-9SBT5NujMqdbB_ZKULZwpeufNa3Hu_480Cc5M2oA_B9T |
|
iOS Build Available Rocket.Chat 4.75.0.109276 |
Proposed changes
The room row in the rooms list kept its pressed highlight after opening a room and navigating back — the row stayed drawn with the grey press color indefinitely.
The cause is a legacy
RectButton(the old react-native-gesture-handler imperative API) nested inside a newGestureDetector. The two gesture-arbitration systems do not cooperate, so the button's press-out event — the one that clears the highlight — was dropped when navigation fired synchronously on press. The highlight was set on touch-down, but its reset never arrived.This removes
RectButtonfromRoomItemand drives the press highlight from aGesture.Tapplaced in the sameGesture.Racetree as the existing pan (swipe) and long-press gestures. The highlight is cleared in.onFinalize, which runs on the UI thread for every terminal outcome — success, cancel, or interruption by navigation — so it can no longer get stuck.Only
app/containers/RoomItem/Touchable.tsxchanges behaviourally; the RoomItem snapshot is regenerated to reflect the swapped touchable subtree.Issue(s)
https://rocketchat.atlassian.net/browse/NATIVE-1380
How to test or reproduce
Also confirm swipe-to-reveal (favorite / hide) and long-press still work on a row.
Screenshots
Verified on an Android emulator (API 36). The tapped row background, sampled at native resolution, reads
(255, 255, 255)both before tapping and after returning to the list; a stuck press state would read approximately(228, 231, 234). Tap navigation and swipe-to-reveal actions both continue to work.Types of changes
Checklist
Further comments
The snapshot diff is large because the RoomItem touchable subtree is serialized across every test case; the change is the
RectButtontoGesture.Tapswap repeated per case, not a change to the rows themselves.The transient press-appearance could not be captured on video:
adb screenrecordon the software-rendered emulator truncated to under a second of static frames. That was never the defect, though — the reported bug was the highlight sticking, which the before/after row sampling above disproves.Summary by CodeRabbit
New Features
Bug Fixes