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

Sticky header hit-tests at bottom of message list, though paints at top #327

Closed
gnprice opened this issue Oct 18, 2023 · 2 comments · Fixed by #468
Closed

Sticky header hit-tests at bottom of message list, though paints at top #327

gnprice opened this issue Oct 18, 2023 · 2 comments · Fixed by #468
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content a-sticky_header Our `sticky_header` library beta feedback Things beta users have specifically asked for
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Oct 18, 2023

In the message list, if you tap near the very bottom of the viewport, you'll get navigated to the conversation or stream corresponding to the message at the top.

(I discovered this just now while reviewing #318. It had me very confused for a while because the effect is the same as following a certain internal link would be… but the issue is pre-existing and unrelated to #318.)

From a bit of debugging, what's happening is that the GestureDetector that belongs to a recipient header is firing — specifically the one for the recipient header that's currently sticky, shown at the top of the viewport.

Presumably this is a bug in our own sticky_header.dart. It'd probably be in the implementation of hitTestChildren.

It looks like the tests I wrote don't ever attempt to tap on the list items, or the headers, to check that the gesture gets routed to the right place. They go through a comprehensive set of scenarios with the different options, and with scrolling to different positions, but only inspect the reported layout and not the response to gestures. So one thing to include in a fix for this issue will be to add some gestures to those tests.

@gnprice gnprice added the a-msglist The message-list screen, except what's label:a-content label Oct 18, 2023
@gnprice gnprice added this to the Beta milestone Oct 18, 2023
@gnprice gnprice modified the milestones: Beta 1, Beta 2 Nov 8, 2023
@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Nov 17, 2023

I assume this is the bug I've run into a few times, when trying to tap the new "Mark X as read" button from #364 (and instead of marking as read, it opens a message list). That button is at the bottom.

@gnprice
Copy link
Member Author

gnprice commented Nov 17, 2023

Yeah, sounds right. I guess that button raises the visibility of this issue. This is already probably the first issue I'll pick up myself after Beta 1 is out, so I guess this just reinforces that priority.

Until then, the workaround is that you tap on the upper half or so of the mark-as-read button — the button is taller than the recipient headers, so only the lower portion of it will be covered by this ghost of the sticky header.

@gnprice gnprice added the a-sticky_header Our `sticky_header` library label Nov 18, 2023
@gnprice gnprice added the beta feedback Things beta users have specifically asked for label Dec 23, 2023
@gnprice gnprice self-assigned this Dec 29, 2023
gnprice added a commit to gnprice/zulip-flutter that referenced this issue Dec 29, 2023
Our `hitTestChildren` implementation wasn't using `hitTestBoxChild`
correctly: it was attempting to do the job of `childMainAxisPosition`,
but `hitTestBoxChild` calls `childMainAxisPosition` for itself.

The implementation of `childMainAxisPosition` wasn't correct either.

Fix both, and add some tests; sticky_header hadn't had any tests on
its hit-test behavior.

Fixes: zulip#327
chrisbobbe pushed a commit that referenced this issue Dec 30, 2023
Our `hitTestChildren` implementation wasn't using `hitTestBoxChild`
correctly: it was attempting to do the job of `childMainAxisPosition`,
but `hitTestBoxChild` calls `childMainAxisPosition` for itself.

The implementation of `childMainAxisPosition` wasn't correct either.

Fix both, and add some tests; sticky_header hadn't had any tests on
its hit-test behavior.

Fixes: #327
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 a-sticky_header Our `sticky_header` library beta feedback Things beta users have specifically asked for
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants