-
Notifications
You must be signed in to change notification settings - Fork 250
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
Reset position in FactTree only when needed #648
Conversation
At first glance, this fix looks good. But I tested this by scrolling down and then adding a new fact, which seems to also reset the scroll. Is that intended? Looking at the code, you added a Also, maybe |
Yeah, I noticed something was fishy yesterday, that's why I moved it back to WIP until I could investigate what's wrong. I'll try out your suggested change and update the PR. |
Right now FactTree.set_facts() is always resetting the position of the view, bringing the user back to the top but this function is called regularly to update with the latest data even when the user has not changed anything in the selection widget... which is really annoying when you are reviewing the list of facts. Let's distinguish between both cases with a "scroll_to_top=True" attribute that we use when we generate an entirely new set of facts to be displayed. This makes projecthamster#623 obsolete. Thanks to @mwilck for the initial analysis. Fixes projecthamster#594
So here's the updated commit which also adds But contrary to what you suggested, I only passed scroll_to_top=True in two locations: in So I believe this is now ready to be merged. |
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.
So on_facts_changed, on_row_delete_called and on_timeout (and init) are not resetting the position. The on_timeout was the most important one to not update since it's the one that gets triggered every 60 seconds to update the figure for the currently running activity...
I wasn't sure about when delete triggered, I now see it happens when you delete a fact with the delete button, so makes sens to not reset the scroll.
As for timeout, I missed that one, agreed that it definitely should not reset the scrolling :-)
With these changes, I agree this can be merged. @mwilck, agreed?
This merits a comment in NEWS.md! Something like
|
Yeah, I was thinking to just generate NEWS entries for all relevant merges on release, but having one prepared is a good idea. As for the actual entry, I'd make it a bit more explicit:
|
Yeah, I find it better to generate them at release time otherwise you generate conflicts on open merge requests for no real gain. Maybe we could add the text in the commit message so that it's just copy & paste, or could even be scripted. I'm not changing anything to the MR right now but let me know if you want me to change something related to this. |
See #607 for previous discussion of exactly this. |
Lacking further response from other maintainers, I've gone ahead and merged this. |
Right now FactTree.set_facts() is always resetting the position of the
view, bringing the user back to the top but this function is called
regularly to update with the latest data even when the user has not
changed anything in the selection widget... which is really annoying
when you are reviewing the list of facts.
Let's distinguish between both cases with a "reset=True" attribute that
we use when we generate an entirely new set of facts to be displayed.
This makes #623 obsolete. Thanks to @mwilck for the initial analysis.
Fixes #594