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

vscode: Add a simple Welcome page #3124

Merged
merged 1 commit into from Jul 21, 2023
Merged

Conversation

hunger
Copy link
Member

@hunger hunger commented Jul 20, 2023

This implements a custom web view as the VSCode welcome view is put over an empty TreeView (we have none of those) and the walkthroughs (a list of things you need to step through one after the other) do not fit our needs.

The plugin gets activated on any folder that contains a CMakeLists.txt, a Cargo.toml or a .slint file and checks whether to bring up the Welcome page. So that should work nicely :-)

There is a command in the palate to bring up the Welcome page, too, plus settings to configure whether the Welcome page comes up always whenever a new project is opened or never (with an option to change that on page as well).

The page itself is minimal.

I'll extend esbuild next so that we can actually package extra files along with our plugin. Then I can copy some logos and css from the website and try to prettify things a bit.

Addresses parts of #3083

@hunger hunger added a:documentation Improvements or additions to documentation (infrastructure and text itself) (mS,bT) a:editor integration VSCode extension, treesitter, and other editor integration (mT,bO) labels Jul 20, 2023
@hunger
Copy link
Member Author

hunger commented Jul 20, 2023

This is what it looks like (dark mode):

image

It of course follows the light/dark mode as set in VSCode :-)

@ogoffart
Copy link
Member

Do I understand correctly that the Welcome page will be shown on every time vscode is open on a rust or C++ workspace until the user opt out with the combobox. It feels like a bit much to me. IMHO we should just open it the first time after installation or so.

Regarding the assets in the repository i think we need them because we can't rely on our website. But we might not need to bring all the big fonts maybe. But it's true that the page indeed looks good.

This is not the first time we have this problem of assets (demos index.html, docs html and so) and we should find a solution for it.

@tronical
Copy link
Member

Do I understand correctly that the Welcome page will be shown on every time vscode is open on a rust or C++ workspace until the user opt out with the combobox. It feels like a bit much to me. IMHO we should just open it the first time after installation or so.

I agree. I think we should implement the same behavior as in the espressif-idf extension: Show on first install, otherwise on demand per command palette.

I think this should just be a welcome page, not a replacement for documentation browsing. That is functionality that is not typical for vs code. While I hope it will one day become a first class "citizen" of vs code, at the moment docs integration is not really a thing (beyond tooltips).

Regarding the assets in the repository i think we need them because we can't rely on our website. But we might not need to bring all the big fonts maybe. But it's true that the page indeed looks good.
This is not the first time we have this problem of assets (demos index.html, docs html and so) and we should find a solution for it.

What about including the assets from the website repo at GitHub build time? So local builds may not use the correct images/fonts/stylesheets, but GH builds will include them in the bundle. And it's still easy to test as any of us can trigger a GH extension build (one that doesn't upload to the market place) and install the .vsix locally.

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

@ogoffart: The asset handling is not as easy as I hoped: You really have to convert any URL in the HTML to for use in the webview. I had hoped relative URLs would just work, but they did no.

That's why I needed to embed the CSS into the HTML as I needed to replace the links in the CSS as well :-/

So much for the idea to embed the documentation into the extension.

@tronical
Copy link
Member

So much for the idea to embed the documentation into the extension.

I think that's not a direction we should go to anyway (and I don't see any precedence).

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

@tronical: When the page will show should be easy to change. I went for "always" as "add slint dependency into project" and "docs" and "create a .slint file" all seem like things I would want to do for many projects and not just the first.

This is no "set up Slint once" kind of thing that downloads extra tools or something.

@ogoffart
Copy link
Member

We are talking about a "Welcome" page, which shows when we first install the extension so that would help people who install the extension with "what do i do next?".

"add slint dependency into project" and "docs" and "create a .slint file" all seem like things I would want to do for many projects and not just the first.

But you don't want ti do it for all project or project that already have a dependency. Don't overdo it.
People can run commands directly from the palette, or load the welcome page from the command palette.

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

How about this then: No more fonts and generally closer to VSCode.

This time using a light theme for VSCode:
image

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

The dark version:

image

@ogoffart
Copy link
Member

Great. Please rebase so that the font are not in the git history.

Also we really should make it so that it only shows up automatically after installation.

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

@ogoffart: I did change it to default to "never" (after the first run).

@hunger
Copy link
Member Author

hunger commented Jul 21, 2023

I squashed the commits to remove the (now unused) assets.

@hunger hunger merged commit 53355a6 into slint-ui:master Jul 21, 2023
26 checks passed
@hunger hunger deleted the vscode_welcome_mvp branch July 21, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:documentation Improvements or additions to documentation (infrastructure and text itself) (mS,bT) a:editor integration VSCode extension, treesitter, and other editor integration (mT,bO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants