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

Ability to contribute views containers #43645

Closed
sandy081 opened this issue Feb 14, 2018 · 52 comments
Closed

Ability to contribute views containers #43645

sandy081 opened this issue Feb 14, 2018 · 52 comments
Assignees
Labels
api feature-request Request for new features or functionality on-testplan tree-views Extension tree view issues
Milestone

Comments

@sandy081
Copy link
Member

sandy081 commented Feb 14, 2018

  • Ability to contribute views containers to the Activity bar like azure, outline etc.,
  • Contribute views to these activity groups
@sandy081
Copy link
Member Author

sandy081 commented Mar 19, 2018

An UX discussion happened and the following solution was suggested in two steps

Step 1

  • Provide an extension point to contribute activity bar group (viewlet) and allow extensions to group views.
  • If there are multiple contributions with the same group id, last one wins

Advantages:

Extension can group the views they would like to have under single viewlet. This will work well with azure views.

Disadvantages:

  • Each Extension can create its own viewlet and there could be too many icons in the activity bar. This is mitigated by our activity bar that can scale.

  • User has no control to group or ungroup views. If two extensions contribute git related views under two different viewlets, then user cannot group them into one. If an extension contribute azure and docker views under single viewlet and then it is not possible for user to make docker as a separate viewlet.

Step 2

Ability to move views across groups . This is a big discussion scopes to complete VS Code.

  • Moving across groups / panels etc.

Follow up tasks:

  • Start with Step 1: Create UI mock ups for contributing viewlets and get feedback from team and community

I would defer this to next milestone due to me being not available completely in this milestone.

@sandy081 sandy081 modified the milestones: March 2018, April 2018 Mar 19, 2018
@eamodio
Copy link
Contributor

eamodio commented Mar 19, 2018

@sandy081 how would the (default) order of views contributed into an activity be defined? Would it just be order of registration?

@eamodio
Copy link
Contributor

eamodio commented Mar 19, 2018

I would love to see the possible future ability of putting a WebView into an activity as this UI/UX/API evolves as well.

@sandy081
Copy link
Member Author

how would the (default) order of views contributed into an activity be defined? Would it just be order of registration?

@eamodio Yes, it would be based on the order of registration.

@ghost
Copy link

ghost commented Mar 20, 2018

I'd like to suggest the ability to modify the custom activity's icon through icon packs/themes!

@rozzzly
Copy link

rozzzly commented Mar 24, 2018

I'd like to see the ability to contribute views/allow users to "dock" views on the opposite side of the activity bar and in the bottom (terminal/problems/etc) bar.

I know the vs code team is reticent about allowing custom UIs so the editor can stay "light and simple" but with custom TreeView and now the new WebView coming as well, that is what will eventually happen.

Ascii Example

----------------------------------------------------
| A |           |                        |         |
| C |           |                        |         |
| T |           |                        |         |
| V |           |          Code          |  Code   |
| I | File Tree |         Editor         | Outline |
| T |           |                        |         |
| Y |           |                        |         |
|   |           |----------------------------------|
| B |           | Problems / Terminal / [Coverage] |
| A |           |                                  |
| R |           |     [ Custom Coverage View ]     |
|   |           |                                  |
----------------------------------------------------

in this example, I could have an extension that contributes some type of "code outline" TreeView on the right, and another extension that contributes a WebView with coverage reports in the bottom bar.

Now I know some core contributors are dead set against this type of thing, but this is where the UI is heading with the introduction of custom views, now you're talking about custom view positioning...

As far as I see it, the vscode team can follow one of two paths:

Custom Views ▶️ Custom View Group ▶️ Custom Activities ▶️ 🕥 API stabilizes ▶️ Extension Authors implement custom views ▶️ users love them but are frustrated because they have to jam all of their tools into one part of the screen ▶️ 📢 users complain, alot ▶️ vscode team eventually relents ▶️ a bunch of code goes into the 🗑 and is rewritten ▶️ 🕥 API stabilizes ▶️ community is happy

OR

Custom Views ▶️ new view contribution/docking API ▶️ 🕥 API stabilizes ▶️ community is happy

@DanTup
Copy link
Contributor

DanTup commented Mar 26, 2018

I'd love to see this - it feels wonky that we're putting some trees in the File Explorer pane. I'd also love for the user to be able to dock it to the other side too (this goes for existing panels too; a generic solution that lets my undock Git or search results for example).

@eamodio
Copy link
Contributor

eamodio commented Apr 3, 2018

It would be great to have the ability for badges on the custom activities as well. Just like the change count on the SCM activity.

@sandy081 sandy081 changed the title Ability to promote custom views to activity bar Ability to contribute activity bar groups Apr 16, 2018
sandy081 added a commit that referenced this issue Apr 16, 2018
sandy081 added a commit that referenced this issue Apr 16, 2018
@sandy081
Copy link
Member Author

sandy081 commented Apr 17, 2018

Following is the contribution point I am planning to expose

"contributes": {
	"viewsContainers": {
		"activitybar": [
                        {
			    "id": "azure",
			    "title": "Azure",
			     "icon": "resources/azure.png"
		        }
                  ]
	},
        "views": {
		"azure": [
			{
				"id": "cosmosdb",
				"name": "Azure Cosmos DB"
			},
                         {
				"id": "docker",
				"name": "Docker"
			}
		]
	}
}

image

  • Register an activity group
  • Contribute views to the registered activity group location
  • An extension can also contribute to an activity group registered by a different extension by adding it as a dependency
  • If the location is not found, view is added to explorer as a fallback.

@jrieken for API discussion

  • Want to have the new contribution behind the flag (like proposed).

@chrisdias FYI

@eamodio
Copy link
Contributor

eamodio commented Apr 25, 2018

@sandy081 it seems that today's insiders has broken this -- The activity shows up, but the view never renders. Its getTreeItem and getChildren never get called.

@d-akara
Copy link

d-akara commented Apr 25, 2018

@sandy081 Ahh ok awesome! sorry, I didn't quite get what meant initially.

@sandy081
Copy link
Member Author

@eamodio Yeah, I fixed it today. Sorry for that.

@sandy081
Copy link
Member Author

sandy081 commented Apr 25, 2018

Pushed a change to provide out of the box Test view container. All extensions contributing test views can contribute to this container using the id test.

image 4

image

@eamodio
Copy link
Contributor

eamodio commented Apr 25, 2018

@sandy081 ah, great that its fixed -- thanks! (I'm assuming there won't be a new release issued until tomorrow right?)

@sandy081
Copy link
Member Author

@eamodio Unfortunately yes. Please let me know if you are blocked, I can request a new build for you.

@eamodio
Copy link
Contributor

eamodio commented Apr 25, 2018

If it isn't too much trouble that would be very helpful and greatly appreciated.

@sandy081
Copy link
Member Author

sandy081 commented Apr 25, 2018

How about sharing a latest build to you instead of releasing it? Does it works?

@eamodio
Copy link
Contributor

eamodio commented Apr 25, 2018

Sure, works for me, thanks!

@DanTup
Copy link
Contributor

DanTup commented Apr 26, 2018

Pushed a change to provide out of the box Test view container. All extensions contributing test views can contribute to this container using the id test.

Neat! :)

@sandy081

You can also consider removing Flutter from your view name as you are putting your view into Flutter container. Then it looks like Flutter: Outline which is pretty good.

Good idea! I think ultimately this might just become an "outline", since we'll have a standard non-flutter outline, but for now I think this works fine 👍

sandy081 added a commit that referenced this issue Apr 26, 2018
@sandy081
Copy link
Member Author

Removed the proposed api flag and this will be available in next stable release.

@DanTup
Copy link
Contributor

DanTup commented Apr 26, 2018

@sandy081 Two minor things I noticed while working on my outline:

  1. If I call reveal, the sidebar switches to my view. This could be annoying to the user - I want to keep the item in the tree that corresponds to where the cursor is selected, but I don't want to force the tree to be visible it it's not already. Is there a way I can set the selection (so that if they switch to this bar, it's selected) without forcing the view to become visible?

  2. (This is kinda tree-reveal-related rather than this one, but...) if I call reveal(null) it doesn't remove the current selection. So if the user moves the cursor to a position that is not represented by a node (eg. the space between two classes) the previous node remains selected. Any way to remove a selection?

@sandy081
Copy link
Member Author

Here is the request for 1) - #48198

Please file a separate request for 2).

Thanks.

@DanTup
Copy link
Contributor

DanTup commented Apr 26, 2018

Thanks; opened #48754 :)

@patrys
Copy link

patrys commented Apr 26, 2018

@DanTup Are you also working on a code outline extension? Maybe we could get a standard view container for our extensions like there is one for tests? (I am the author of Code Outline.)

@DanTup
Copy link
Contributor

DanTup commented Apr 26, 2018

@patrys I'm not working on an Outline extension, I author the Dart/Flutter extensions. I'm currently working on a special type of outline for Flutter (which will need to be rendered by us, it's very specific), though we do have a standard outline in our backlog.

For the Flutter one, I think a Flutter icon on the side bar makes sense (there are other tools we may add to it in future), but the standard outline may make sense to share a view. However, it raises some questions:

  1. If two extensions contribute view containers with the same ID and different titles, which gets displayed?

  2. If an extension provides its own outline and an "Outline extension" also provides an outline, is there user going to end up with two outlines?

@sandy081
Copy link
Member Author

sandy081 commented Apr 26, 2018

If two extensions contribute view containers with the same ID and different titles, which gets displayed?

Edit: The first one wins

If an extension provides its own outline and an "Outline extension" also provides an outline, is there user going to end up with two outlines?

Yes

sandy081 added a commit that referenced this issue Apr 26, 2018
@sandy081
Copy link
Member Author

Closing this issue.. Please file separate issues for new feature requests or bugs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality on-testplan tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

9 participants