-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Show file changes as a tree in Source Control view #7505
Conversation
I have not looked at code, only played a bit with it. I really like this feature, it makes code reviews so easier by checking what kind of extensions PR is addressing. Thank you ❤️ I've noticed that:
Here how changes of this PR look in VS Code for the minimal icon theme: |
That was actually deliberate design. If there was only a single file in a folder then the file is shown with the folder as the path. This might have been more obvious if the full path was not shown in the version you looked at. However, to avoid confusion I have changed this so that folders are always shown in the tree, just like VS Code.
I think that has now been fixed. I can tab from the commit line then cursor around the tree.
This logic for cursor keys is implemented in tree-widget. To fix the key cursors I only had to remove the original key cursor code that was in the old Source Control view. I have not re-implemented anything from ViewContainer.
This PR is not intended to change the styling. The height of the group headers has not been changed. The original components are used for the group headers and resource rows. |
@eclipse-theia/ecd-theia-committers please help with testing. We need to test that all features are working in tree and flat modes on different levels (header section, folder, sub folder, a file). We should also make sure that:
|
Filed #7581. If someone is up to open another PR against this PR which adds integration tests (as it was done during Monaco migration) please do. It does not mean that we should automate everything now, but maybe add some test for regressions. For instance this PR (in the current state) breaks how we handle left/right keys to navigate through all changes. |
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.
A couple of things I noticed quickly, I'll do more testing as I go:
- the
changes
section is quite large compared to master and needs to be fixed:
- the icons for folders are incorrect (we should either not display icons like in vscode for folder nodes, or we should apply the correct icon by using the filestat which is able to determine if a resource is a folder). The alignment of nodes is also off (when using the seti icon theme for example).
- the ordering of changes is inconsistent with vscode, we should follow the same ordering behavior as the explorer:
- with the changes, I am unable to select the
ellipsis
toolbar item to display the context menu of actions
I've removed the 5px margin that had been there.
A FileStat is now used, as you suggested, to get the icon from the label provider. It now shows as a folder icon.
Now sorted the same as vs-code with folders first then files
Yes, I saw this too. However I have also seen it on the master branch. I will need to investigate this. |
OK. I have put back the code that uses the left-right cursor keys to move through the changes within a file. However I integrated it with the implementation in tree-widget so the keys also go in and out of folders as they do in the explorer. It does not work very well, IMO, but then neither does it work well in the existing Source Control view. We need to decide how the keys should work first as this is not at all clear to me.
That is outside my area of expertise. I can run it by our UX team if that helps?
Surely headers should not look the same? As long as extenders can style headers as they wish then I suppose that would be ok. I have, however, removed the 5px margin from the group headers.
This is caused by bvaughn/react-virtualized#610
A FileStat is now passed instead of URI to LabelProvider as per Vince's suggestion. This should fix this.
Done
vs-code loses tree state too. However vs-code expands the tree by default whereas this PR collapses by default. Perhaps I will run this by our UX team.
I missed this comment, still need to fix it...
Yes, more work is needed here, though the details of how this is expected to work is not clear to me. Currently the selected change in each file is separately remembered, so as one cursors right down the file tree and into the file, it is very confusing.
This has now been removed
|
I think it is good idea. I can check then your proposal with @svenefftinge and we decide? Although could not we just align it as it on master, i.e. it should iterate through file changes, if a file does not have anymore changes, then jump to next/previous file. The tree should only reflect it. It is important for us in Gitpod in the PR context. It does not seem to work like that with the recent changes as well. It only iterates only changes in a single file. |
Can we do something about it? It looks very disturbing.
Let's expand i then. |
I cannot open diff editors with enter always. |
I've changed this so that the enter is processed by TreeWidget when on folder (opens folder) and opens diff when on file resource (as Source Control view previously did). |
I removed the css for the group header that controlled the height of the header (which was carried over from the original Source Control view). By making the height the same the jump is no longer seen. If extenders were to customize the header rows to have a different height then they can turn off react-virtualized.
Now expanded by default. I have put in an option so it is easy for extenders to collapse by default (as one of the reasons for implementing this PR was because large change sets created too many rows which locked things up) |
I think it now works as well as can be. See comments in code for scm-tree-widget handleLeft and handleRight. I presume to be a bug the issue where cursor left and right between files goes not to first/last chuck in next/previous file as one would expect but goes to the current chunk selection in that file. This is the behavior on master so I have left it as is. It can be changed in another PR if necessary. |
@westbury It works quite well for me now. I've noticed 2 things only so far: |
@@ -190,8 +198,6 @@ | |||
} | |||
|
|||
.theia-scm .scmItem:hover { | |||
background-color: var(--theia-list-hoverBackground); |
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 did we remove VS Code theming? Did you check that VS Code don't apply it? The same for scm-theia-header:hover
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.
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.
Could you file a follow-up issue? We need to double check how it should be applied and do it. But I don't want to hinder this PR with it.
@@ -107,14 +105,4 @@ export class ScmService { | |||
return repository; | |||
} | |||
|
|||
protected updateContextKeys(): void { |
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.
Did you test VS Code extensions? I.e. that commands are available in the command palette properly. The PR seems to change the semantic when we assign it. We need to test that it still confirms to VS Code extensions' expectations.
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 seems to work. I had to hack the builtin I built myself to check the new menu location but it would be good to see the folder menu working when the 1.39 builtin works. I left the 'string' URI though I don't know if it is used.
@westbury in master it displays the warning message and also doesn't work |
What is the summary? We don't test vs-code built-in git support for now or someone to test https://registry.npmjs.org/@theia/vscode-builtin-git/-/vscode-builtin-git-0.2.1.tgz at least? @westbury Do you know this yellow box warning was coming from our widget? |
@akosyakov from #7505 (comment) I see that VS Code built-in git extension, which is currently used by Che, works w/o any regression with this PR changes. |
Yes. This is shown when there is no selected repository. In this case we are not getting any repositories found by any providers because the builtin, for whatever unknown reason, is not finding any. |
@westbury I meant this box is displayed on master, but not with this branch. I think it is caused by #7505 (comment) Could you have a look at comments please? I've tested today the diff view as well. It does not seem to be affected as well. |
That was because the notification-count-container, when in a tree-widget, was explicitely hidden by css in search-in-workspace. I assume that the intent was that it should only have been hidden for search-in-workspace, not globally, so I've refined the rule with an additional class.
Sorry. Last minute cleanup that broke it. I reverted that. The code in scm-contribution to get the ScmWidget from the ViewContainer is necessary because it is not otherwise passed on to ScmWidget without changing ViewContainer. |
@westbury I will wait till next release is through and then test again (hope last time). I believe the release should be tomorrow evening. @marcdumais-work ? |
btw the build does not compile on travis for any platform |
packages/plugin-ext/src/main/browser/menus/menus-contribution-handler.ts
Show resolved
Hide resolved
Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
I have not been able to reproduce this. |
@westbury It seems something was cached in my browser, cleaning caches and reload helped. |
Is there a preference to configure it? If I want to enable tree mode for my user always? It would be good to reuse from VS Code: https://github.com/microsoft/vscode/blob/8dff64169dfc8170e28ee59f0131001ad6e43954/src/vs/workbench/contrib/scm/browser/scm.contribution.ts#L138 |
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.
Thank you, that's very cool feature! ❤️ Hope we will have it for the diff view one day too.
Thank you @akosyakov for reviewing this. Based also on Eclipse Che's testing of the builtins (#7505 (comment)), I'm merging. |
@westbury Could you file a follow-up for #7505 (comment) please? |
Replaces file change list in Source Control view with tree view. This fixes #4835
What it does
The change lists are replaced by a single tree that uses TreeWidget. A toggle button has been added so the user can toggle between a flat view and a tree view.
What will not be covered by this PR
The diff widget
How to test
Try out the Source Control view. This is the only view that should have changed. The 'flat' mode should look mostly the same but even in flat mode it is now in a tree, with each group (staged, unstaged etc) being collapsable. Test with both the Git vs-code built-in and with the native Git extension.
Review checklist
Reminder for reviewers