Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Built-in VS Code Simple Browser Limitations and other Load/Close App Page and webview UI customization options #49

Open
RandomFractals opened this issue Jun 1, 2023 · 2 comments
Labels
UI UI related issue, enhancement, or task UX User experience feature or improvement

Comments

@RandomFractals
Copy link
Contributor

We researched this yesterday and shared preliminary info in slack:

looking at the built-in simple browser implementation I don't see a quick and easy way for us to open it on the side, or change that webview title and icon. So, if we want to see more stylized Evidence built-in browser and have more open/close/reload page options, we'd need to invest time into implementing our own. ... https://github.com/microsoft/vscode/blob/main/extensions/simple-browser/src/extension.ts

Also, that Simple Browser webview API doesn't provide close view option, and VS Code itself still doesn't have an API to iterate over all open webviews, only visibleTextEditors list is available. Therefore, it is not possible for us to close Simple Browser, without implementing our own or using another extension like the popular, but not maintained Browser Lite.

The only other quick workaround without investing 2-3 days on implementing your own custom Evidence App webview, is:

  • Have your app dev team add Start Dev Server "greeting" page to your app ./static folder and standard app template
  • We can set global state for when we open one of the Evidence pages in a Simple Browser extension, and what page it was on
  • On VS Code reload and Evidence extension activation, we can show new Start Dev Server "greeting" page in a Simple Browser, so that it doesn't show up blank.
  • When a user starts a server, we can take them to the last viewed page saved in the global state from the previous Preview session.
  • and lastly, your app still needs proper Loading ... home page while the server starts and generates pages. I've requested this multiple times in slack and tickets here to address long blank app page view in a browser.

That's a few hours, most likely a day of setup, dev, testing and coordination with the app dev team, if you'd like us to open a UX enhancement ticket to address it this or next week.

On the related note, we can also open new active editor group on the side, and maybe add Preview on the Side for the Simple Browser to show up there. However, changing that built-in browser title and icon is not possible per my read of that built-in vscode extension API referenced above.

Originally posted by @RandomFractals in #24 (comment)

@RandomFractals RandomFractals changed the title Simpler Browser Limitations and Load/Close webview options Built-in VS Code Simple Browser Limitations and other Load/Close App Page and webview UI customization options Jun 1, 2023
@RandomFractals RandomFractals added the UI UI related issue, enhancement, or task label Jun 1, 2023
@hughess
Copy link
Member

hughess commented Jun 1, 2023

@RandomFractals FYI added an issue in our main project about the page loading: evidence-dev/evidence#922

@RandomFractals
Copy link
Contributor Author

@hughess thank you! even a starting static app page with some fancy animation could make it much better while we SSR those pages and modules, and get data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
UI UI related issue, enhancement, or task UX User experience feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants