-
Notifications
You must be signed in to change notification settings - Fork 306
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
Retention of scroll offset in emoji #1269
base: main
Are you sure you want to change the base?
Retention of scroll offset in emoji #1269
Conversation
…nnecessary changes
Hello @chrisbobbe , |
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 from a quick review; also, please change the commit message to match the project style.
lib/widgets/autocomplete.dart
Outdated
_viewModel!.query = newQuery; | ||
// Reset scroll when query content changes | ||
if (oldQuery.toString() != newQuery.toString() && |
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.
What's the output of toString
?
How about using .raw
instead.
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.
Also, this logic needs tests.
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.
Hello @chrisbobbe ,
I had used this line oldQuery.toString() != newQuery.toString()
for
- Only substantive changes to the query trigger a scroll reset
- Minor or insignificant modifications don't unnecessarily reset the scroll
But by reviewing the code I understood that it not that necessary and the code without it is working fine .
So this is how the code at that section will look
if (_scrollController.hasClients) {
_scrollController.jumpTo(0);
}
So should I update the PR accordingly?
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.
And for the logic point of view
This is what my logic does
- Every time the query changes
- The scroll will automatically reset to the top (position 0)
- Regardless of how minor or significant the query change is
So, it should pass any test cases.
Thanks @AshutoshKhadse23 for picking this up! We're now focusing more strictly on launch issues until the app's launch is ready, and this is a post-launch issue. I'll leave this PR as an exception where we'll proceed with it anyway, because it looks like it may be possible for the fix to be quite small. The next step will be for you to revise it to address each of @chrisbobbe's comments above. Then we can give it a new round of review. Because we're prioritizing launch issues, this PR may wait longer for review than others. If you're interested in contributing to Zulip, I recommend taking a look also at open issues in the upcoming milestones up through M5 Launch. |
Cross-linking because I happened across it while scanning through PRs during triage: it looks like a previous iteration of this PR was @AshutoshKhadse23 as a reminder of comments you received earlier at #1232 (comment) and #1232 (comment): when revising a PR, please update the existing PR rather than sending a new one. (In any case, for this PR the next step is for you to revise it as described above.) |
Hello @chrisbobbe, |
The issue regarding retention of scroll offset in emoji is solve
Resolving issue #1175
issue.1175.mp4