Skip to content

Commit

Permalink
msglist: In single-conversation view, make recipient headers not tapp…
Browse files Browse the repository at this point in the history
…able.

Updated onTap for recipient headers in single-conversation view.
Adjusted GestureDetector logic to conditionally enable navigation.
Simplified ColoredBox structure for non-tappable recipient headers.
Improves user experience by removing unnecessary tap interactions.
  • Loading branch information
lakshya1goel committed Dec 20, 2024
1 parent d9f88f3 commit 78f4029
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1105,9 +1105,9 @@ class StreamMessageRecipientHeader extends StatelessWidget {
]));

return GestureDetector(
onTap: () => Navigator.push(context,
onTap: () => showStream? Navigator.push(context,
MessageListPage.buildRoute(context: context,
narrow: TopicNarrow.ofMessage(message))),
narrow: TopicNarrow.ofMessage(message))): null,
onLongPress: () => showTopicActionSheet(context,
channelId: message.streamId, topic: topic),
child: ColoredBox(
Expand Down Expand Up @@ -1148,29 +1148,25 @@ class DmRecipientHeader extends StatelessWidget {

final messageListTheme = MessageListTheme.of(context);

return GestureDetector(
onTap: () => Navigator.push(context,
MessageListPage.buildRoute(context: context,
narrow: DmNarrow.ofMessage(message, selfUserId: store.selfUserId))),
child: ColoredBox(
color: messageListTheme.dmRecipientHeaderBg,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 11),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Icon(
color: messageListTheme.recipientHeaderText,
size: 16,
ZulipIcons.user)),
Expanded(
child: Text(title,
style: recipientHeaderTextStyle(context),
overflow: TextOverflow.ellipsis)),
RecipientHeaderDate(message: message),
]))));
return ColoredBox(
color: messageListTheme.dmRecipientHeaderBg,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 11),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Icon(
color: messageListTheme.recipientHeaderText,
size: 16,
ZulipIcons.user)),
Expanded(
child: Text(title,
style: recipientHeaderTextStyle(context),
overflow: TextOverflow.ellipsis)),
RecipientHeaderDate(message: message),
])));
}
}

Expand Down

0 comments on commit 78f4029

Please sign in to comment.