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

FileViewer: ViewMode to track what is currently displayed #8496

Merged
1 commit merged into from Oct 3, 2020

Conversation

gerhardol
Copy link
Member

@gerhardol gerhardol commented Sep 29, 2020

There is at least one issue discussing this that I cannot find right now...

Proposed changes

  • Replace a couple of booleans tracking current information in the file viewer with an enum
  • Hide actions in GitHub view pull request form that have no functionality
  • Refresh Patch and GitHub file viewer pull requests when changing the syntax highlight

This will also be used for the presentation part of #8471 that adds more internal changes as well as for #7825 when unifying code from FormCommit/RevDiff (FileStatusList will be required too then).
A CommitDiff mode can remove some duplicated code from FormCommit

Screenshots

Note that the title bar is not following the normal style, same for all plugins.

Before

image

image

After

image

image

Test methodology

Manual


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned gerhardol Sep 29, 2020
@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #8496 into master will decrease coverage by 0.15%.
The diff coverage is 59.42%.

@@            Coverage Diff             @@
##           master    #8496      +/-   ##
==========================================
- Coverage   55.29%   55.14%   -0.16%     
==========================================
  Files         894      900       +6     
  Lines       64150    64492     +342     
  Branches    11450    11529      +79     
==========================================
+ Hits        35473    35563      +90     
- Misses      25958    26204     +246     
- Partials     2719     2725       +6     
Flag Coverage Δ
#production 42.01% <59.42%> (-0.11%) ⬇️
#tests 94.79% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@RussKie
Copy link
Member

RussKie commented Sep 30, 2020

Are there any screenshots to see what's changing? I've never actually used that form...

@gerhardol
Copy link
Member Author

Are there any screenshots to see what's changing? I've never actually used that form...

There are no visual changes

This affects all file viewers

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Reviewers should start with the diff of the Reset function.

GitUI/Editor/FileViewer.cs Show resolved Hide resolved
GitUI/Editor/FileViewer.cs Outdated Show resolved Hide resolved
GitUI/Editor/FileViewer.cs Outdated Show resolved Hide resolved
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments

GitUI/Editor/FileViewer.cs Outdated Show resolved Hide resolved
GitUI/Editor/FileViewer.cs Outdated Show resolved Hide resolved
GitUI/Editor/FileViewer.cs Outdated Show resolved Hide resolved
GitUI/Editor/FileViewer.cs Show resolved Hide resolved
@gerhardol
Copy link
Member Author

Are there any screenshots to see what's changing? I've never actually used that form...

I apologize, this does change the GitHub PR, I added screenshots.
Also using FixedDiff in the ViewPatch form as well as FormVerify (recover lost objects) (could not get a lost object there, no screenshots and only manual review).

Refactor to handle the different "modes" like diff/text in a simpler way

Add a FixedDiff mode to display patched with fixed comments that will not be
changed by i.e. whitespace changes.
Refresh when changing highlighting.
 * ViewPullRequestsForm (GitHub PR)
 * FormViewPatch
 * FormVerify
@gerhardol
Copy link
Member Author

@msftbot merge in 24 hours

@ghost ghost added the status: auto merge label Oct 2, 2020
@ghost
Copy link

ghost commented Oct 2, 2020

Hello @gerhardol!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Sat, 03 Oct 2020 17:55:03 GMT, which is in 1 day

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 4f79013 into gitextensions:master Oct 3, 2020
@ghost ghost added this to the 4.0 milestone Oct 3, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants