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

Make webview cache render templates and track multiple panels per id #440

Merged
merged 5 commits into from
Oct 23, 2024

Conversation

alexeyraspopov
Copy link
Contributor

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.

@alexeyraspopov alexeyraspopov requested a review from a team as a code owner October 23, 2024 16:59
Copy link
Contributor

@jlrobins jlrobins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Copy link
Member

@noeldevelops noeldevelops left a 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 () => {
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY!

@alexeyraspopov alexeyraspopov merged commit 3c745a7 into main Oct 23, 2024
1 check passed
@alexeyraspopov alexeyraspopov deleted the oleksii/WebviewCacheUpdate branch October 23, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants