-
Notifications
You must be signed in to change notification settings - Fork 861
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
Add collapse all and navigate to selected file icons to Projects view #7925
base: master
Are you sure you want to change the base?
Add collapse all and navigate to selected file icons to Projects view #7925
Conversation
Hey @s4gh nice feature. I have two things to add:
|
The buttons seems more lightweight from the UI. Looks more modern for me than the toolbar. From the UI perspective you are absolutely right, that it fits better with this toolbar. I would rather see them in the tabs area (see image) and if we have more actions which not fit, we could have the kebab menu, Just another Idea. So we don't need specific stuff for the views but we can have view specific actions but wrapped in the tabs bar. |
5a11281
to
aa30fb0
Compare
aa30fb0
to
4b8c86b
Compare
@mbien and @Chris2011
So yes, I am really trying to convince you to green light current approach because of the reasons listed above. Screenshots of different implementation in different IDEs: |
Thx for the explanation. One more thing from my side. So all in all, I like your idea I'm for it, but also for this it would be good to be consistent witht eh UI of the IDE. Either we need to change the whole UI with such buttons but it could be that it doesn't fit with all use cases or we use that, what we already have in NetBeans, toolbar or inside the tabbar. |
@Chris2011 , I don't remember seeing any additional buttons in the tab are other than "minimize" button. And minimize is not "view specific" I mean it is not related to any particular view like "Services" or "Projects" but to window management as a whole and applies to all windows. If there are any examples when some view puts a custom button in a tab area please point me to this example. I'd like to check the code to understand how this can be done. Since at the moment with my very limited knowledge of Netbeans codebase I simply do not know how to do this and if this is even possible at all. When I work in with ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java - I do not have access to the tab are. And the view can be even detached. That is why I am afraid that this may be not possible at all. Since actual view probably does not even know if it is opened as a tab or is it detached. If there are examples where this is already implemented - please help me to locate them to check the code. @mbien For me, implementation of toolbar or current approach seem much easier from the coding perspective. I've tried to explain why I like proposed approach better. And based on the recent statistic you are the most active Netbeans maintainer. What's your call on this? I mean are you ok with proposed UI changes. I hope I've addressed all other comments you've made before. |
I see. These are still "windowing generic" icons/buttons applicable to any tab/window. Right? I mean to move between tabs and to do "windowing staff". I am afraid there is no way to put something else there. So "view specific" icons in the tab are may be not possible I am afraid. |
I agree with @mbien that the general idea is good, but that the implementation should perhaps mirror the navigator panel. I have mixed feelings there - I prefer the look of this, but not the inconsistency. More importantly, the actions should be registered in the layer system. Similarly to how the current popup menu is populated. See registrations under |
These icons/actions apply only to 3 views - Projects, Files and Favorites. This PR adds these icons to Projects, Files. So it will be 100% consistent across these 2 views. If you help me to locate file which implements "Favorites" view I will try to add same icons to that view as well. So if you want consistency - it will be consistent across all view for this this can apply. If you give "Navigator" view and it's toolbar at the bottom I do not really think this is consistent with any other panel. Which other panel has "toolbar" at the bottom? For "Navigator" view buttons on the bottom panel are not "quick actions". These are more like settings - e.g. to show static members or not. You don't use them often. Nobody puts "quick actions" on the bottom of the screen. In my previous comments you can see screenshots from every other IDE and nobody puts such quick actions at the bottom from usability stand point. If PR with buttons of the top for all 3 views Projects, Files and Favorites will be accepted - please help me to locate in which file "Favorites" view is implemented. Also I will be appreciated for some examples how to register actions in layer system. This is my first PR attempt and I don't know much about Netbeans codebase yet. But more importantly if this PR will not be accepted anyway there is no sense for me to spend time trying to understand how "Favorites" view works :-) |
Debugger for one. Do a code search for
The actions are already registered. You need to reference them at some path (like a symlink). The link I previously shared shows how this is done for the popup menu. You'd add a reference at another path. Actions registered in a path can then be loaded via https://bits.netbeans.org/23/javadoc/org-openide-util-ui/org/openide/util/Utilities.html#actionsForPath-java.lang.String- They would need checking for Possibly take a look at #7171 - that loads actions from a path and converts to buttons for the editor background. Although for various reasons, the actions are registered in an XML file rather than via I can't guarantee that your PR will be accepted, but I can say that it almost certainly won't be if platform developers using these views in other applications can't override the action selection and/or remove them from view entirely. |
@neilcsmith-net in debugging panel toolbar at the bottom is for settings as well. This is not for quick actions. I personally almost never use things like "show/hide system threads" for debugger view or "show/hide static class members" for "Navigator". There are screenshots above from all other popular IDEs and nobody puts such actions at the bottom. Because these are expected to be quickly accessible near the tree for convenience. If you want just to have them somewhere - they are already in context menus across different screens. But that's the point - it is not easy and and not fast to use context menu. All other IDEs also expose them next to the tree to make it easy and fast to access them. Because these are not settings. These are quick actions. @mbien |
There are different opinions and most of the concerns are valid. It adds new features to the IDE and also to the platform which has impact of the UI too. Do all developers/users of NetBeans understands the different concepts of toolbar buttons/settings and quick actions? Does it fits in the UI or do we change the whole UI for this to fit in the tab area for example? I know that those discussions are frustrating. And also we need maybe an option for your new feature that people can say "I don't want this fancy buttons" as we often have this. And this is also fine. I made my point clear, I'm definitely for this, but I can understand the concerns and we should find a solution that fits us all or maybe most of us. |
But I will not decide anything here. |
Some uses of TapPanel could be considered quick actions, but I'm certainly not against having quick actions at the top, and totally understand why. I like the look of your proposal, while also thinking they don't quite match with other aspects of the UI. I mean, it could be a top toolbar from a usability point of view. OTOH, your proposal looks better! The blocker for me is the action registration. I for one do not want a hardcoded action to select the current file in the view - that works against the UI in my platform applications. I can think of other actions I might want there instead. What works for the IDE does not work for all uses. I also have a slight concern about the crosshair icon - looks too much like a + sign and that it should create a new project. The one in your example images has a gap in the middle. |
@neilcsmith-net I will look at the actions in more details. I am still learning how this all works. Some actions already exist. For collapse all icon for "Files" and "Projects" there is already registered action. There is no need to register new one. I am not calling this functionality via "action" because this action is in the same file as my other code. So I simply can call same method which is used by action. So, in this case there is no code duplication, corresponding action already exists and I use the same method which is used by this action. Yes sure I can spend time on looking more into how actions work and try to find where "Favorites" view is implemented and change it as well. If you know file name please share. However this PR already has a lot of comments and some of the question whether this feets Netbeans or not. I am asking for decision to know what to do next. You already see UI and screenshots from other IDEs. And if this PR will not be accepted there is no need for me to spend time on trying to work on actions and "Favorites". I absolutely respect what you do and you have complete right accept something or not. I am asking to know if it makes sense for me to continue or not. I think this is reasonable question. |
Check out the actions registered to Finds
This is where you're going wrong! The decoupling is important. You need to load the actions via a layer folder, and attach them to your buttons. The folder contains shadows (symlinks) to the actions - you are not registering a new action, but you are referencing it from somewhere else. It looks like the collapse all action relies on a String in the view root node Lookup - https://github.com/apache/netbeans/blob/master/ide/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java#L116 Seems odd to use a String. You'll probably need to use the variant of loading that allows passing in a Lookup https://bits.netbeans.org/23/javadoc/org-openide-util-ui/org/openide/util/Utilities.html#actionsForPath-java.lang.String-org.openide.util.Lookup- Probably the one from the root node of the view?? |
@s4gh it always make sense to have a look into everything what you want to change and add etc. doesn't matter one or two PRs doesn't get accepted or to much comments, etc. So please don't get this wrong. You already mentioned the IDEs and how they are doing it, but this is another whole topic, how the others are doing the other stuff and how they are look like. Let's focus on the favorites, get this done. We are trying not to fight against, we just want to find a way where most of us are aggreed with and fine with. |
this is good feature. plz merge it |
@steamboatid it is a good feature, but it is not yet in a mergeable state. Maybe you can work with @s4gh to address the concerns if you want to see this added to the IDE and platform. |
@s4gh @neilcsmith-net if adding more buttons not mergeable (yet), why not simply add new item in the "Source Files" popup menu? |
This PR adds two icons/buttons to the "Projects" and "Files" views of the IDE. One of them collapses all elements of the tree view. Another one selects an element in the tree view which corresponds to the selected file in the editor window. See screenshots below.
Previously similar functionality is available via context menus. However, context menus is more clicks and less convenience. You need to know that "collapse all" is available in context menu for the tree view while "select current file in projects tree" is available in context menu of the file editor. And not in any place but when you click on the header. So having icons in the tree view is gives access to these common features in easier and more convenient way.