Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap target for channel in recipient header is shorter than header #1179

Open
gnprice opened this issue Dec 19, 2024 · 4 comments · May be fixed by #1370
Open

Tap target for channel in recipient header is shorter than header #1179

gnprice opened this issue Dec 19, 2024 · 4 comments · May be fixed by #1370
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content help wanted

Comments

@gnprice
Copy link
Member

gnprice commented Dec 19, 2024

(chris edit: added screenshot and "Related issues" and "Implementation" sections)

When a channel message appears in a multi-channel narrow (like the combined feed), the recipient header has the channel name as well as topic.

Expected: Tapping anywhere in the channel part of the header (highlighted below) should lead to the channel narrow:

Image

Actual: Tapping directly on the text of the channel name leads to the channel narrow. But tapping slightly above or below leads instead to the topic narrow.

Related issues

This will also be relevant for the channel action sheet, which will be offered on long-press in this area:

Implementation

I believe the bug can be fixed by adding a line to the relevant GestureDetector:

diff --git lib/widgets/message_list.dart lib/widgets/message_list.dart
index 48c0d70b5..7d51d6fbd 100644
--- lib/widgets/message_list.dart
+++ lib/widgets/message_list.dart
@@ -1080,6 +1080,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
         ?? zulipLocalizations.unknownChannelName; // TODO(log)
 
       streamWidget = GestureDetector(
+        behavior: HitTestBehavior.opaque,
         onTap: () => Navigator.push(context,
           MessageListPage.buildRoute(context: context,
             narrow: ChannelNarrow(message.streamId))),

We also need a widget test for the fix; we won't merge a PR without this. The test should pass after the fix and fail before the fix.

@gnprice gnprice added help wanted a-msglist The message-list screen, except what's label:a-content labels Dec 19, 2024
@gnprice gnprice added this to the M6: Post-launch milestone Dec 19, 2024
@aurora500
Copy link

I would like to contribute to this issue,kindly assign me

The problem is that the entire recipient header (including the channel area) is wrapped in a single GestureDetector that navigates to the topic narrow. We need to properly separate the gesture areas for the channel and topic sections.

@aurora500

This comment has been minimized.

@gnprice

This comment has been minimized.

@E-m-i-n-e-n-c-e
Copy link
Contributor

E-m-i-n-e-n-c-e commented Feb 22, 2025

Hi I have worked on this. Please see #1370 and this comment

E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Feb 23, 2025
Set gesture detecter behavior of streamWidget to HitTestBehavior.opaque
to handle taps in empty space around the header.

Also added a test that checks if tapping empty space in channel header
area correctly navigates to the channel feed.

Fixes zulip#1179.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-msglist The message-list screen, except what's label:a-content help wanted
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants