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

Retention of scroll offset in emoji #1269

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AshutoshKhadse23
Copy link

The issue regarding retention of scroll offset in emoji is solve
Resolving issue #1175

issue.1175.mp4

@AshutoshKhadse23
Copy link
Author

Hello @chrisbobbe ,
Now it have only changes made to solve the issue ,you can review it.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a 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.

_viewModel!.query = newQuery;
// Reset scroll when query content changes
if (oldQuery.toString() != newQuery.toString() &&
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Author

@AshutoshKhadse23 AshutoshKhadse23 Mar 26, 2025

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

  1. Only substantive changes to the query trigger a scroll reset
  2. 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?

Copy link
Author

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

  1. Every time the query changes
  2. The scroll will automatically reset to the top (position 0)
  3. Regardless of how minor or significant the query change is

So, it should pass any test cases.

@gnprice
Copy link
Member

gnprice commented Feb 6, 2025

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.

@gnprice gnprice added this to the M6: Post-launch milestone Feb 6, 2025
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Feb 6, 2025
@gnprice
Copy link
Member

gnprice commented Mar 14, 2025

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

@AshutoshKhadse23
Copy link
Author

Hello @chrisbobbe,
Now it ready for review and I had revised my code to remove the confusion of .toString

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants