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
RevFileTree: Blame instead of View #9424
RevFileTree: Blame instead of View #9424
Conversation
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.
👍 Feels quite natural.
Wishes for this PR:
- Improve FileTree / BlameControl updates #9437 Update / paint FileTree independent from BlameControl in order to reduce flicker
- Improve FileTree / BlameControl updates #9437 Make switching commits, e.g.
Blame previous revision
, not loose the file selection
Wishes for later:
- Improve FileTree / BlameControl updates #9437 Scroll FileTree selection to be visible when switching commits, e.g. on
Blame this / previous
- BlameControl: Make Commit Info gutter collapsible #9436 Make Commit Info gutter of BlameControl collapsible (simulating "View"; improves scrolling UX)
- Store / restore splitter position of BlameControl (there is a pending issue for
master
anyway: 13caf92)
should be done in Restore splitter persistence #9106 - BlameControl: Hide unrelated context menu item #9435 Hide unrelated context menu item
- BlameControl: Correctly align line numbers with text #9434 BlameControl: Correctly align line numbers with text
Most of these are for BlameControl should be a separate issue (#7598 is quite confusing as is...) Also if Blame is improved, there may be need for a configurable way to show Blame/View (or even Blame/Diff). Edit: The blame/view context menu control could be added to this or if requested, if that is considered a longer term solution. |
f4c28ee
to
3976a07
Compare
3976a07
to
d392820
Compare
Converted this to a draft and based it on #9425 (approved, to be merged soon) and #9426 as there are some functionality required. Some new additions:
|
390b8fa
to
34691dc
Compare
Cleaned up commits a little, adding RevDiff Blame |
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.
Wrote a few comments regarding style basically.
00f6da8
to
16b7ec4
Compare
Rebased on master to resolve MC (and master eeb8f67 is unusable, fixed in adbb410). |
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.
LGTM
this.BlameControl.Margin = new System.Windows.Forms.Padding(0); | ||
this.BlameControl.Name = "blameControl"; | ||
this.BlameControl.Size = new System.Drawing.Size(487, 303); | ||
this.BlameControl.TabIndex = 0; |
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.
Conflict with FileText.TabIndex
(although they are not displayed at the same time).
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.
That was intentional, really a need to separate them?
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.
As a general rule: no item should have identical indices. Though this is the keyboard tab order, i.e. used when tab between controls. Accessibility tools don't use it (AFAIK), and use the order in which controls are added into respective parents 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.
Do you request to change this?
16b7ec4
to
20fee19
Compare
Rebased without changes, to simplify reviews and get the build successful |
@@ -51,26 +51,29 @@ public partial class RevisionFileTreeControl : GitModuleControl | |||
private readonly Stack<string> _lastSelectedNodes = new(); | |||
private readonly IRevisionFileTreeController _revisionFileTreeController; | |||
private readonly IFullPathResolver _fullPathResolver; | |||
private readonly IFindFilePredicateProvider _findFilePredicateProvider; | |||
private readonly IFindFilePredicateProvider _findFilePredicateProvider = new FindFilePredicateProvider(); |
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.
Why is this necessary?
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.
It is not necessary for this PR, it was a change I had done (and believe should be changed) that was refactored to a separate commit
Added two more features:
|
{ | ||
_revisionGrid = revisionGrid; |
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.
I very much dislike this - this creates further coupling between various controls, and making it harder to reason about each individual control's functionality, and further complicating testing stories.
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.
This is required for BlameControl so the same as in FormFileHistory.
You can see this as a step to remove a lot of code in GE: The follow up #9445 obsoletes FormFileHistory, so this is a step to remove a complete form.
ebb38ec
to
12ce1eb
Compare
Rebased to resolve a merge conflict |
I ran it locally briefly, seems to work. Need time to form a better opinion, but overall I think it is a good change.
|
Blame/View is sticky in FileTree tab.
Do you mean H? That is not changed by this PR. |
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time, it was just used for a special case.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a line. This is is available in RevDiff and RevFileTree since gitextensions#9424. (Even if the code enabling this has existed for long time, it was just used for a special case.) The "goto line" was only used if the control had to be init, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
Blame can start presenting on a specific line. This is is available in RevDiff and RevFileTree since #9424. (Even if the code enabling this has existed for long time, it was just used for a special case.) The "goto line" was only used if the control had to be initialised, not if e.g. toggling to Diff and selecting an new diff line and then Blame again.
"RevisionFileTreeShowBlame" settings was introduced in gitextensions#9424. The issue with this settings is that whenever a file history is opened, blame is turned on for all open instances of the app, and affects the File Tree tab experience.
"RevisionFileTreeShowBlame" settings was introduced in gitextensions#9424. The issue with this settings is that whenever a file history is opened, blame is turned on for all open instances of the app, and affects the File Tree tab experience.
"RevisionFileTreeShowBlame" settings was introduced in gitextensions#9424. The issue with this settings is that whenever a file history is opened, blame is turned on for all open instances of the app, and affects the File Tree tab experience.
Resolves #10511 "RevisionFileTreeShowBlame" settings was introduced in #9424. The issue with this settings is that whenever a file history is opened, blame is turned on for all open instances of the app, and affects the File Tree tab experience. Co-authored-by: Gerhard Olsson <6248932+gerhardol@users.noreply.github.com>
Resolves #10511 "RevisionFileTreeShowBlame" settings was introduced in #9424. The issue with this settings is that whenever a file history is opened, blame is turned on for all open instances of the app, and affects the File Tree tab experience. Co-authored-by: Gerhard Olsson <6248932+gerhardol@users.noreply.github.com> (cherry picked from commit 53d608e)
Part of #7598
Closes #9435
Closes #9437
Proposed changes
Show blame for object type blobs (files), as is available in FileHistory.
Note that object type commit (submodules) are shown as text, as before.
It is possible to toggle the view to show file contents, as before.
In FileHistory the commit info is available in a header. This is excluded in RevFileTree. The info for the selected commit can be seen in Commit, Diff tabs, overview is available in tooltip for otyher commits.
This could be configurable.
A menu command existed to view the file, this as a hotkey.
Note that
T
was selected as key,F
is to be used to add the filepath to the Advanced filter in the grid.RevDiff:
B
to view Blame instead of DiffNote that this is just for the current file, selecting another (or the same) file will show Diff by default.
For artificial, HEAD is blamed, worktree/index changes cannot be shown
When blaming in RevDiff or FileTree, select the current line in fileviewer in Blame (especially useful in RevDiff)
Cancellation support in LoadBlame() (in between operations, not in methods)
Screenshots
Before
For reference - FileHistory Blame tab, unchanged by this PR
(RevDiff
B
opened FileHistory in a new instance, no screenshot.)After
Only the hotkey added
Context menu and hotkey
B
toggle Diff/Blame.Test methodology
Manual
✒️ I contribute this code under The Developer Certificate of Origin.