Skip to content

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

Open
@gnprice

Description

@gnprice

(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.

Metadata

Metadata

Assignees

Labels

a-msglistThe message-list screen, except what's label:a-contenthelp wanted

Type

No type

Projects

  • Status

    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions