-
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
FactTree: don't reset y position in set_facts() #623
Conversation
@matthijskooijman, please help me with the failed "code linting" test. I made just trivial modifications. It seems that "flake8" can't be run at all. I've no clue about "flake8". |
So legacy whitespace fixes. |
|
That's what I meant, my patch didn't touch any of these lines. |
Want to pull my https://github.com/markferry/hamster/tree/issue594? |
The two commits (one for fixing the issue, one for fixing the whitespace stuff) are well separated, so why not. Please send a PR to my |
Seems that flake8 was already broken in master: https://github.com/projecthamster/hamster/runs/717792799, it seems #596 broke it (I suspect that PR predates the automatic checking, so it probably did not show the failure). @markferry, care to submit the flake8 fixes as a separate PR? I looked through the commit and it looks good, so I think we could just merge that right away. |
@mwilck, I merged the flake8 fixes from @markferry, could you rebase this PR on top of master (should leave just your commit in the PR). I had a look at the commit itself, which seems simple enough, but I'm not quite sure how this stuff works. Maybe you already figured this out and can help me understand how this |
set_facts() is called every minute to update the time of the current activitiy. If the y position is reset to 0 in set_facts(), this causes the fact list to be scrolled to the top once a minute, irritating users. Fix it by simply not resetting the y position.
I figured it out so-so, by trial and error and debugging. I don't claim to understand every little detail.
It's obvious that the effect described i #594 would occur if we reset the y position once a minute. It's less obvious whether not doing so would break anything. I've tried to test test it and break it after my change, but for me it has worked well. I'd appreciate feedback from those who have reported #594. The code I changed is very old, it has existed basically since day 1 AFAICT. |
Thanks. Looking more closely, I see that Also, scrolling with pgup/pgdown updates Armed with all this knowledge, I wonder:
A broader question I have is why |
Exactly.
It happens today if the new view had less rows than necessary to fill the screen (unlikely with months, but well reproducible by using days and possibly shrinking the window a bit). But I fail to see why a reset to 0 would be mandated in the general case, where both before and after the switch there are more lines than can be displayed at one time. In general, when we switch to en entirely new view, we have zero knowlegde what the user is looking for. The user will have switched the view and will be prepared to scroll on way or the other. I see no particular reason why keeping the current position (as my patch does) would be any worse than resetting to 0. Actually, there'd be good reasons to use a different default, e.g. "50%". The only case where IMO a reset to 0 would be the natural thing to do is when the user switches from one time frame of a certain type (month, say) to the following time frame of the same type (i.e. May 2020 -> June 2020).
Do what you like, I'd prefer to keep it simple for now.
The first thing I tried was to simply skip the
Valid question, but again I'd like to keep things simple for the time being. I just provided a simple fix for the reported problem. If you have a better patch, go ahead :-) Otherwise, please play around with this patch a bit, and judge the user experience yourself. |
Yeah, that's indeed the case I was thinking about. But even there, I guess that not resetting is also reasonable, and never resetting is indeed significantly simpler than supporting two cases.
Hm, any idea why? Would be nice to understand this better and maybe add a comment with reasoning for this. OTOH, if it works, I guess that having this line without a comment is not terrible, as the scrolling code is a bit messy and underdocumented already anyway. In summary, I agree that the current patch is actually ok. I'll see if I can test it a bit as well, though I still haven't set up an easy way to build git versions (I'm using my WIP .deb package rather than manual installs, which should be able to do git builds, but I haven't entirely figured out how). I'll report back when I get this working. |
Me neither. I keep forgetting how to fix the gsettings issue... Want to know how I created this patch? I hand-edited the installed |
To get around that gsettings issue, I have used this script to run git hamster from the source tree:
|
This is nice. We should add it to the repo. I'd drop the |
|
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 projecthamster#623 obsolete. Thanks to @mwilck for the initial analysis. Fixes projecthamster#594
I submitted a new PR (#648) because I believe that we should reset the position when we display a new set of facts. I believe this PR can be closed. I'm also really annoyed by this behavior so I hope that with this supplementary change it can be merged quickly. I haven't seen any downside in my (limited) testing so far. |
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 projecthamster#623 obsolete. Thanks to @mwilck for the initial analysis. Fixes projecthamster#594
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
Closing this in favor of #648. |
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 #623 obsolete. Thanks to @mwilck for the initial analysis. Fixes #594
set_facts() is called every minute to update the time of the current
activitiy. If the y position is reset to 0 in set_facts(), this causes
the fact list to be scrolled to the top once a minute, irritating users.
Fix it by simply not resetting the y position. This Resolves #594.