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

refresh 'diff' view in DAG window only when hash of the viewed commit changes #724

Closed
jsilhan opened this Issue Sep 2, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@jsilhan

jsilhan commented Sep 2, 2017

Hi, my use case is to look at my commits through "Git DAG" window and clean code before I push it to my repo. It seems that every time I make any changes to the files in git directory (without committing) the the "diff" view renders again and jumps to the top of diff. Then I have to scroll back where was the code I recently reviewed. Is it possible to refresh the diff view only when hash of currently viewed commit changes, please?

This happens in version 2.10 and in the upstream (73408a0)

You have done a great job on git-cola - it is the fastest GUI git tool with clean design and fixing this issue can improve UX a bit. I could make a patch myself if you point me to the file of the change. Thanks.

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Sep 3, 2017

Member

A quick workaround is to disable inotify support. Maybe we should add a way to disable it for the dag only.

Most of the code is in cola/widges/dag.py as well as around. The way this gets triggered is the cola/fsmonitor.py registers for inotify events and sends a (probably overly-general) "update" signal that triggers cola/cmds..py's Refresh class to issue a refresh command, triggering a GUI refresh.

You can disable inotify by doing git config --global cola.inotiy false. It would be good to fix this, though. Having the UI automatically see new commits might be more of a usability burden than the use case you described -- I often hit it myself.

Member

davvid commented Sep 3, 2017

A quick workaround is to disable inotify support. Maybe we should add a way to disable it for the dag only.

Most of the code is in cola/widges/dag.py as well as around. The way this gets triggered is the cola/fsmonitor.py registers for inotify events and sends a (probably overly-general) "update" signal that triggers cola/cmds..py's Refresh class to issue a refresh command, triggering a GUI refresh.

You can disable inotify by doing git config --global cola.inotiy false. It would be good to fix this, though. Having the UI automatically see new commits might be more of a usability burden than the use case you described -- I often hit it myself.

davvid added a commit to davvid/git-cola that referenced this issue Sep 5, 2017

diff: save and restore the scrollbar when setting the diff text
Make it so that the DAG's diff display saves and restore the scrollbar
across updates.  This minimizes disruption when viewing a large diff
while an external event triggers an update since the viewport will now
remain unchanged.

Related-to: git-cola#724
Reported-by: Jan Šilhan <jsilhan@redhat.com>
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue Sep 5, 2017

doc/relnotes/v3.0: mention git-cola#620 and git-cola#724 in the relea…
…se notes

Add a blurb about the improved DAG refresh behavior.

Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit to davvid/git-cola that referenced this issue Sep 5, 2017

Merge branch 'dag-refresh'
* dag-refresh:
  doc/relnotes/v3.0: mention git-cola#620 and git-cola#724 in the release notes
  diff: save and restore the scrollbar when setting the diff text
  dag: do not redraw when object IDs have not changed
  dag: use itertools.count() instead of count()
  core: add OID_LENGTH constant
  doc: add Jan to the credits

Closes git-cola#620
Closes git-cola#724
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in 8276a1a Sep 5, 2017

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Sep 5, 2017

Member

Thanks for reporting this issue. The usability should be much improved now.

Not only do we now detect when the hash/object IDs change, but we also keep the scrollbars where they are, so that the diff viewport stays stable when a refresh does occur.

Member

davvid commented Sep 5, 2017

Thanks for reporting this issue. The usability should be much improved now.

Not only do we now detect when the hash/object IDs change, but we also keep the scrollbars where they are, so that the diff viewport stays stable when a refresh does occur.

@jsilhan

This comment has been minimized.

Show comment
Hide comment
@jsilhan

jsilhan Sep 6, 2017

Confirming it works as expected. Even when new commit is added while browsing the old commits it stays in the same state.

Thanks @davvid for fixing this, you're awesome!

jsilhan commented Sep 6, 2017

Confirming it works as expected. Even when new commit is added while browsing the old commits it stays in the same state.

Thanks @davvid for fixing this, you're awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment