ts-type-explorer
ts-type-explorer copied to clipboard
Better UX for no type selected
Currently, the extension window is empty when no type is selected. As was pointed out by a user, this can be pretty confusing.
One solution is to have placeholder text that simply indicates that the user needs to select a variable in order for anything to show up.
It seems this is implemented now.
Would it be possible to make this welcome view optional? Users who are familiar with the extension might prefer an empty view when nothing is selected. This can be achieved e.g. by introducing a corresponding config entry and when-clause:
// In package.json, config section
"typescriptExplorer.typeTree.view.show.welcomeMessage": {
"description": "Show welcome message if no type is selected",
"type": "boolean",
"default": true
}
// In package.json, viewsWelcome section
{
"view": "type-tree",
"when": "config.typescriptExplorer.typeTree.view.show.welcomeMessage", // <- added this line
"contents": "To display type information here, open a TypeScript project and click on any variable or type.\n\nTo learn more, [read the docs](https://github.com/mxsdev/ts-type-explorer/blob/main/packages/typescript-explorer-vscode/README.md)!\n\nIf you have just installed TypeScript Explorer and it is not working, try reloading the window/restarting VSCode. If the issue persists, please [file an issue](https://github.com/mxsdev/ts-type-explorer/issues)."
}
If you agree, I can prepare a PR. Thanks for considering!