-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Views: Support contributable welcome view content #89080
Comments
Looks good to me. I prefer the I am personally not a big fan of the
Also note that debug would render something before this contributed section and something after this contributed section if possible. So the view should have the start, middle and end. With the middle being contributable. fyi @weinand |
I guess we also need an event for when that's changing... |
Also adding @mjbvz for the |
Could we put this on {
"contributes": {
"views": {
"explorer": [
{
"id": "nodeDependencies",
"name": "Node Dependencies",
"when": "workspaceHasPackageJSON",
"emptyContent": [{
"markdown": "My empty message",
"when": "CONDITION"
}]
}
]
}
}
} If we prefer the |
One goal is that another extension can contribute getting-started text, e.g. a GH extension can contribute to the SCM view, etc. Not sure how that would look with this integrated approach |
Also it does not make a lot of sense for debug. Since all our extensions are not contributing views, and all of them want to contribute to our start view. |
It turns out using markdown for this isn't feasible, since the library we currently use doesn't allow to prevent certain features (headers, tables, etc), not even using the renderer API. Since all we want are actually links, another option is to extract the work @bpasero did for notifications into something reusable. |
@joaomoreno We use
Could you configure it to only allow a very specific set of tags (try the |
We would only want to support links in this feature. No headers, no images, no styling, no lists, no tables. So, we'd need a markdown feature set filter. |
How would this behave if more than 1 extension registers an empty view content for the same view? This also strikes me as quite similar to Also, what would the signal for a TreeView to being empty -- no items at all? No items or |
They pile up one on top of another.
Yeah similar, though not the same, since we only want these messages appearing when a view is indeed empty, ie there's no other content to show.
That's up to @alexr00 to define. |
I would show the empty content when there are no items and no message. That way the extension that contributes the view still has a way to show a message without all the empty content. |
When you say "pile up one on top of another" -- you mean last one wins or that they will all show and sort of stack vertically? Honestly neither of which feels like a good user experience to me. |
But what you are showing is 2 separate views (Git & SVN) each with one empty contribution. My question is what happens when there is more than 1 empty contribution for the same view. |
Ahh I see... What's an example of that? |
Say both GitLens and the GitHub PRs extension add an empty view for the SCM view. |
One can't contribute an empty view. One can only contribute empty view contents. Specifically for SCM, the viewlet is empty whenever there are no repositories registered, in which case it will render all empty view contents stacked on top of each other, ordered by a comparator of our choosing. Other view domains will have to come up with their own concept of empty, such as custom views, which @alexr00 already addressed. |
Right -- I meant empty view contents. If this is for targeting "views", isn't the empty SCM viewlet a view container not a view itself? Also will newlines be supported in the content (IMO it should be)? If so, having this in the package.json feels harder to manage, and also limiting in that you can't have any dynamic text. |
SCM will behave in a special manner: when no repositories are registered, it will create an empty view. As soon as a repository comes along, that view gets removed. Yes, newlines need to be supported. We'll go with |
Converging on this proposal: "contributes": {
"viewsWelcome": [
{
"view": "view id",
"contents": "here go the contents",
"when": "when clause"
}
]
} |
Closing this for now, since the following has landed in |
Assigning to me, ropening and adding api-finalisation since we would like to finalise this API this milestone. |
Assigning to me too since this impacts custom views as well. |
Feedback from Jonathan Carter @jrieken so we got some positive feedback on API from extensions. Let me know if there is something else we need to do before we finalise it. |
go for it. add a test plan item and these things |
I have removed the proposed API check. Since this was already tested last milestone via #91269 I will simply reopen that test plan move it to this milestone and only let 1 person be assigned to it. |
Problem
The need to have meaningful and actionable content rendered on empty views has been arising across the workbench:
Proposal
Let's enable the following in the core:
isEmpty(): boolean
method toViewPane
which would let view panes dictate when they are empty, as well asonDidChangeEmpty
eventViewPane
whenisEmpty() === true
We can then update our API by exposing an extension contribution point for the same core contribution point created above. Here's a couple of proposals:
contributes.documentation.VIEWID
Alternatives for
documentation
:viewhelp
,emptyview
.Alternatives for
label
:text
,markdown
,description
.contributes.documentation.view
cc @sbatten for views
cc @isidorn for debug
cc @sandy081, @alexr00 for custom views
cc @bowdenk7 for scm
cc @jrieken for input on API conventions
The text was updated successfully, but these errors were encountered: