Community
Participate
Working Groups
In the headers of the "Unstaged Changes" and "Staged Changes" areas, include buttons to choose the presentation mode. Choices include "Flat" (current behavior), "Tree" (hierarchical) and "Compressed". Also include Expand/Collapse All buttons (enabled when "Flat" is not selected). I will submit a patch for review.
Patch ready for review: https://git.eclipse.org/r/12676
compressed mode: - top level files (directly under repository root) aren't sorted properly tree mode: - wrong tree structure if changes are done in different 2nd level folders under the same top level folder I will attach screenshots for these problems here both in compressed and tree mode refreshing the view closes all folders, would be nice if opening state would be preserved across refresh
Created attachment 230804 [details] screenshot staging view compressed layout, problems marked in red
Created attachment 230805 [details] screenshot staging view tree layout, problems marked in red
Thanks for trying this out. I will look into the wrong tree structure problem. Regarding the sorting problem, isn't this the same way that the same files would be sorted in the current Staging View, without the patch? (Upper case preceding lower case)
I've pushed changes that fix the tree structure problem, and preserve tree expansion state across refresh. I haven't yet done anything about the sorting of top level files because I'm not sure what behavior you'd like to see. Currently, in tree or compressed mode, the top level files appear after all the folders, which is typical sorting behavior. The sorting is case sensitive, with upper case preceding lower case, which is consistent with the way the files are sorted in the 3.0 version of the Git Staging view, without any of my changes. Would you prefer that they be sorted without regard to case? Or am I missing the actual problem that you're describing? Thanks, Steve
Some feedback from trying it out: * When the mode is "Flat", could we remove the + and - buttons instead of disabling them? They don't have any purpose then and clutter the UI. * When using compressed mode and you have two folders say "a/b" with file "1", and "a/b/c" with file "2", and you stage "a/b", "a/b/c" is also staged. It's also the case for the "Replace ..." actions. I know the reason for this (we just call AddCommand with the selection), but I already see the bug reports coming in about this. Maybe we need to special-case this and iterate over the tree elements? * A mix between tree and compressed view could also be interesting. So that projects are displayed at the top, and then below them the compressed folders. This would not necessarily have to be a new mode. * When the top section title is updated, it changes to "Staged Changes" (instead of "Unstaged Changes"). * The tree nodes have no "Show In" menu, that could be useful. Other than that, I think this will be a nice addition :).
Thanks for feedback. Comments inline. (In reply to comment #7) > Some feedback from trying it out: > > * When the mode is "Flat", could we remove the + and - buttons instead of > disabling them? They don't have any purpose then and clutter the UI. Done with latest patch set. > * When using compressed mode and you have two folders say "a/b" with file "1", > and "a/b/c" with file "2", and you stage "a/b", "a/b/c" is also staged. It's > also the case for the "Replace ..." actions. I know the reason for this (we just > call AddCommand with the selection), but I already see the bug reports coming in > about this. Maybe we need to special-case this and iterate over the tree > elements? Will come back to this one soon. > * A mix between tree and compressed view could also be interesting. So that > projects are displayed at the top, and then below them the compressed folders. > This would not necessarily have to be a new mode. I'm not sure about this one. When I'm working with a single project, as I often am, this seems to just add an unnecessary level to the tree hierarchy. > * When the top section title is updated, it changes to "Staged Changes" (instead > of "Unstaged Changes"). Done with latest patch set. > * The tree nodes have no "Show In" menu, that could be useful. Done with latest patch set. > Other than that, I think this will be a nice addition :).
(In reply to comment #8) > > * When using compressed mode and you have two folders say "a/b" with file "1", > > and "a/b/c" with file "2", and you stage "a/b", "a/b/c" is also staged. It's > > also the case for the "Replace ..." actions. I know the reason for this (we just > > call AddCommand with the selection), but I already see the bug reports coming in > > about this. Maybe we need to special-case this and iterate over the tree > > elements? > > Will come back to this one soon. > > > * A mix between tree and compressed view could also be interesting. So that > > projects are displayed at the top, and then below them the compressed folders. > > This would not necessarily have to be a new mode. > > I'm not sure about this one. When I'm working with a single project, as I > often am, this seems to just add an unnecessary level to the tree hierarchy. Maybe we chould change "Compressed" to be hierarchical but still compress the folders. Say we have the following files in the view: org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java How about showing them in a tree form, but compressing folders which only have one folder as children, like so: * org.eclipse.jgit/src/org/eclipse/jgit * api * AddCommand.java * RmCommand.java * internal * JGitText.java It's compact and does not have the problem of not being hierarchical (for Stage/Unstage). In case the files are all in the same folder, it's equivalent to the current "Compressed" presentation. In the above example, it uses one more vertical item, but does not repeat the "org.eclipse.jgit/src/org/eclipse/jgit" path twice. What do you think? By the way, the Java > Appearance preference for this call it "Fold empty packages in hierarchical layout in Package and Project Explorer".
(In reply to comment #7) > * When using compressed mode and you have two folders say "a/b" with file > "1", and "a/b/c" with file "2", and you stage "a/b", "a/b/c" is also staged. > It's also the case for the "Replace ..." actions. I know the reason for this > (we just call AddCommand with the selection), but I already see the bug > reports coming in about this. Maybe we need to special-case this and iterate > over the tree elements? Done in latest patch set.
Implementation of the idea from comment 9 here: https://git.eclipse.org/r/14952 Steve, could you try it out and give feedback? It currently replaces the "compressed" mode . Maybe it should better replace the "tree" mode instead. Or be a new mode? Hmm, 4 modes seems a bit much.
(In reply to comment #11) > Implementation of the idea from comment 9 here: > > https://git.eclipse.org/r/14952 > > Steve, could you try it out and give feedback? It currently replaces the > "compressed" mode . Maybe it should better replace the "tree" mode instead. > Or be a new mode? Hmm, 4 modes seems a bit much. In general, I prefer this new compressed mode to the previous compressed mode. I agree that 4 modes is too much, and replacing the previous compressed mode is the right approach. A few things I noticed: 1. Files in the working directory root should probably show up after all the compressed folders, the way they do in tree mode, which is consistent with Eclipse resource views. Also, I haven't figured out how to reproduce this consistently, but I'm sometimes seeing these root files listed twice, once as a root tree node, and once under a folder node that has no text (this is the one that should not show). 2. It would be nice if we could improve the preservation of expansion state when items are moved between Unstaged/Staged. For example, suppose you have the following unstaged chages: * org.eclipse.jgit/src/org/eclipse/jgit * api * AddCommand.java * RmCommand.java * internal * JGitText.java Now drag the api folder to Staged Changes. The internal folder collapses into org.eclipse.jgit/src/org/eclipse/jgit/internal and remains expanded, which is good. In the Staged section, it would be nice if org.eclipse/jgit/src/org/eclipse/jgit/api was expanded. Now expand the api folder in the Staged section and then drag it back to Unstaged. Now org.eclipse.jgit/src/org/eclipse/jgit is collapsed. It would be nicer if it fully expanded in this case.
(In reply to comment #12) > (In reply to comment #11) > > Implementation of the idea from comment 9 here: > > > > https://git.eclipse.org/r/14952 > > > > Steve, could you try it out and give feedback? It currently replaces the > > "compressed" mode . Maybe it should better replace the "tree" mode instead. > > Or be a new mode? Hmm, 4 modes seems a bit much. > > In general, I prefer this new compressed mode to the previous compressed > mode. I agree that 4 modes is too much, and replacing the previous > compressed mode is the right approach. A few things I noticed: Is it ok if I work on this by modifying your change, so that we have just 1 change? I'll add myself as "Also-by". > 1. Files in the working directory root should probably show up after all > the compressed folders, the way they do in tree mode, which is consistent > with Eclipse resource views. Also, I haven't figured out how to reproduce > this consistently, but I'm sometimes seeing these root files listed twice, > once as a root tree node, and once under a folder node that has no text > (this is the one that should not show). Thanks, will fix. > 2. It would be nice if we could improve the preservation of expansion state > when items are moved between Unstaged/Staged. For example, suppose you have > the following unstaged chages: > > * org.eclipse.jgit/src/org/eclipse/jgit > * api > * AddCommand.java > * RmCommand.java > * internal > * JGitText.java > > Now drag the api folder to Staged Changes. > > The internal folder collapses into > org.eclipse.jgit/src/org/eclipse/jgit/internal and remains expanded, which > is good. In the Staged section, it would be nice if > org.eclipse/jgit/src/org/eclipse/jgit/api was expanded. > > Now expand the api folder in the Staged section and then drag it back to > Unstaged. Now org.eclipse.jgit/src/org/eclipse/jgit is collapsed. It would > be nicer if it fully expanded in this case. Thanks. I agree, will look into it.
> Is it ok if I work on this by modifying your change, so that we have just 1 > change? I'll add myself as "Also-by". Yes, that would be great, thanks.
Ok, working on it (first problem fixed, now coming to second one). I'm thinking we should also rename "Compressed" now, as it doesn't work like before, right? The Package Explorer uses "Flat" and "Hierarchical" as presentation modes. The problem is, what would our compressed mode be named, "Compact Hierarchical"? The Search view uses "List" and "Tree". Maybe we could use "List", "Tree" and "Compact Tree"?
> The Search view uses "List" and "Tree". Maybe we could use "List", "Tree" > and "Compact Tree"? +1
Ok, second problem is also fixed and pushed as new path set to original change: https://git.eclipse.org/r/12676 Please test/review.
merged as 1ef79b6d9abed44ee7facf4c665f608d85cb67cd
Small follow-up to also expand new nodes when the user selected "Expand All": https://git.eclipse.org/r/15462