-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make webview cache render templates and track multiple panels per id #440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement 🧼
(went over details in team sync)
); | ||
context.subscriptions.push(scaffoldProjectCommand); | ||
}; | ||
|
||
export const scaffoldProjectRequest = async (context: ExtensionContext) => { | ||
export const scaffoldProjectRequest = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -139,7 +139,7 @@ | |||
color: var(--vscode-input-foreground); | |||
background: var(--vscode-input-background); | |||
border-radius: 3px; | |||
border: 2px solid var(--vscode-input-border); | |||
border: 1px solid var(--vscode-dropdown-border); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY!
Follow up for #427. In the original implementation I tracked duplicate tabs with unique IDs, so if the original tab was closed, clicking on Play button in the sidebar would not be able to switch to other existing tabs of the same topic. Fixing it here by moving this responsibility to webview cache. The cache now tracks lists of panels per ID, and if
multiple
flag is enabled, it can create a new panel for the id that already has other panels. This resolves the mentioned issue and makes it possible to follow similar pattern in the future for other type of webviews.Another thing I'm addressing here is the bootstrap code we need to deal with when instantiating a webview. Primarily the part about rendering the template and link static assets to the webview. This now happens inside the webview cache. When instantiating a webview, you need to provide the template function (which is generated in build time) and the template itself should use
${path('file.css')}
expressions in places where the static link is needed. Just like before, you need to make sure this file is prebuilt.@noeldevelops while testing, I found a style issue in default light theme where text inputs in scaffold forms didn't have any border. Updated in
uikit.css
the missing color.