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

File History Window #999

Merged
merged 27 commits into from Feb 13, 2019
Merged

File History Window #999

merged 27 commits into from Feb 13, 2019

Conversation

@StanleyGoldman
Copy link
Member

StanleyGoldman commented Jan 17, 2019

Building upon work started in #948 by @sambonfire

2019-01-17_14-45-50

sambonfire and others added 15 commits Nov 8, 2018
[WIP] Fixes to 961
@sambonfire
Copy link
Contributor

sambonfire commented Jan 17, 2019

holy crap this is looking awesome.

@StanleyGoldman
Copy link
Member Author

StanleyGoldman commented Jan 18, 2019

😄 Glad you like it.

@StanleyGoldman StanleyGoldman mentioned this pull request Jan 23, 2019
@StanleyGoldman
Copy link
Member Author

StanleyGoldman commented Jan 23, 2019

image

@donokuda: #961 (comment)

👋Adding a little more clarity to what I was thinking with my mock-up. For the most part, everything that is already built is kept as is (including having the file history appear as a separate window.)

The main thing was making the header feel more like the Unity inspector where we show the file's large icon in the header as well as the filename. Clicking the "Show in Project" button would highlight the file in the project pane (which is the current functionality of clicking the "GIT File history for [filepath]" link)

Something I'm not 100% sure about is whether it makes sense to show the full path or just the filename. The benefit for the full path is that it ensures that we're looking at the right file and where it's located. The downside is that we can run out of space quickly. Right now, I'm leaning towards showing just the file name since the "Show in Project" button could also be a compromise that's already built.

StanleyGoldman and others added 9 commits Jan 23, 2019
refresh asset database after revert
File history revert
@StanleyGoldman
Copy link
Member Author

StanleyGoldman commented Feb 12, 2019

Some action shots

2019-02-12_11-30-53

2019-02-12_11-32-58

@donokuda
Copy link
Member

donokuda commented Feb 12, 2019

😍This is looking so good and thanks for posting a gif of it in action! The only thing I can pick out is that the "Show in Project" button gets bumped to outside of the interface:

screen shot 2019-02-12 at 9 52 49 am

I'm assuming that it has something to do with the FlexibleSpace() pushing the BeginVerticalGroup() to the side.

I took an attempt at re-writing the DoHeaderGUI() method with something that might fix the button issue, except I haven't tested it myself locally because it's been well over a year since I've touched the project:

private void DoHeaderGUI() {
  GUILayout.BeginHorizontal(Styles.HeaderBoxStyle);
  {
    var iconWidth = 32;
    var iconHeight = 32;

    GUILayout.Label(selectedIcon, GUILayout.Height(iconWidth), GUILayout.Width(iconHeight));
    GUILayout.Space(16);

    GUILayout.BeginVertical();
    {
      GUILayout.Label(selectedObjectAssetPath, Styles.FileHistoryLogTitleStyle);

      GUILayout.BeginHorizontal();
      {
        GUILayout.FlexibleSpace();

        if (GUILayout.Button("Show in Project"))
        {
            EditorGUIUtility.PingObject(selectedObject);
        }
      }
      GUILayout.EndHorizontal();
    }
    GUILayout.EndVertical();
  }
  GUILayout.EndHorizontal();
}

Would anyone be able to push a tweak for this? If not, I can take this on, but I'll need some time to get my environment set up again.

Co-authored-by: Don Okuda <don.okuda@gmail.com>
@StanleyGoldman
Copy link
Member Author

StanleyGoldman commented Feb 13, 2019

@donokuda as always you work miracles. I also made sure you get credit for that code.

2019-02-13_08-22-17

@StanleyGoldman StanleyGoldman requested a review from shana Feb 13, 2019
@shana
shana approved these changes Feb 13, 2019
Copy link
Contributor

shana left a comment

Looks great, just a couple of comments! 👍

@StanleyGoldman
Copy link
Member Author

StanleyGoldman commented Feb 13, 2019

@sambonfire let me know if there is anything you'd like to change about this before it goes in.

@meaghanlewis
Copy link
Contributor

meaghanlewis commented Feb 13, 2019

This functionality looks good to me @StanleyGoldman 👍

@StanleyGoldman StanleyGoldman merged commit 417881b into master Feb 13, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@StanleyGoldman StanleyGoldman deleted the file-history-view branch Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.