-
Notifications
You must be signed in to change notification settings - Fork 226
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
msglist: In single-conversation view, make recipient headers not tappable. #1193
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It needs tests, and the commit message should say "Fixes" with the issue number. Also see two substantive comments below.
59f7f42
to
eb6a565
Compare
@chrisbobbe Please have a look on the changes now. Added tests as well. But getting the CI/check fails, showing
Please let me know how can I fix them, as I have the good internet connectivity still getting this. |
eb6a565
to
1b99395
Compare
@chrisbobbe , the checks have also been fixed now. Please review it once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Small comments below.
Also a commit-message nit:
msglist: In single-conversation view, make recipient headers not tappable.
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.
Fixes: #1171
The paragraph isn't needed; it doesn't add anything that isn't already easy to see from the code change, or implied by the Fixes: #1171
line.
1b99395
to
a671aee
Compare
a671aee
to
83b47de
Compare
Hello, @chrisbobbe I have done the requested changes. Please have a look on them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Small comments below.
onTap: !inTopicNarrow ? () => Navigator.push(context, | ||
MessageListPage.buildRoute(context: context, | ||
narrow: TopicNarrow.ofMessage(message))), | ||
narrow: TopicNarrow.ofMessage(message))) : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put the "?" and ":" at the start of new lines:
onTap: !inTopicNarrow
? /* … */
: /* … */
to make it easier to read. (Here and below.)
@@ -922,6 +922,37 @@ void main() { | |||
await tester.pump(); | |||
tester.widget(find.text('new stream name')); | |||
}); | |||
|
|||
testWidgets('does not navigate on tapping topic in TopicNarrow', (tester) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a test before this, if there isn't one already, that it does navigate if you tap the header in an interleaved view (i.e. a channel narrow or the combined feed, not a topic narrow), to check that the implementation doesn't accidentally remove the tap-to-navigate interaction there.
Similarly for the DM-message case, below. (DMs can appear in the combined feed.)
Pull Request Description
Summary
This PR updates the behavior of recipient headers in the single-conversation view to make them non-tappable.
Related Issue: #1171
Changes:
Adjusted GestureDetector logic:
Updated the logic to conditionally enable navigation only when relevant.
Simplified ColoredBox structure:
Streamlined the layout for non-tappable headers to ensure consistent behavior and appearance.
Video Demonstration:
WhatsApp.Video.2024-12-20.at.10.39.41.PM.mp4