-
Notifications
You must be signed in to change notification settings - Fork 2.6k
♻️ refactor(webview): move webview HTML generation to WebviewHTMLManager #2494
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
♻️ refactor(webview): move webview HTML generation to WebviewHTMLManager #2494
Conversation
- 【What】Move the logic for generating webview HTML content from ClineProvider to a new WebviewHTMLManager class. - 【Why】This improves code organization and maintainability by separating concerns related to webview HTML generation. - 【Why】This allows for easier testing and modification of the HTML generation logic without affecting the ClineProvider class.
|
| * @returns A template string literal containing the HTML that should be | ||
| * rendered within the webview panel | ||
| */ | ||
| public getHtmlContent(webview: vscode.Webview): string { |
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.
Both getHMRHtmlContent and getHtmlContent share common code (e.g. generating URIs and nonce) for setting up the HTML template. Consider extracting shared code into helper functions to reduce duplication and improve maintainability.
|
Weird I didn't get that on mine. Maybe it's a relative path. Will check
…On Fri, 11 Apr 2025, 22:30 Matt Rubens, ***@***.***> wrote:
Hmm this seems to break the icons when I run in the debugger for some
reason. Is it happening for you? Going to revert to be safe.
Screenshot.2025-04-11.at.5.28.09.PM.png (view on web)
<https://github.com/user-attachments/assets/0fd89fe8-081d-4469-8d1e-befe68e7e1ef>
—
Reply to this email directly, view it on GitHub
<#2494 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUTT3LMXYAMGTPALLIC7WL2ZAX57AVCNFSM6AAAAAB26M2EZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJYGA2DGMJZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
*mrubens* left a comment (RooCodeInc/Roo-Code#2494)
<#2494 (comment)>
Hmm this seems to break the icons when I run in the debugger for some
reason. Is it happening for you? Going to revert to be safe.
Screenshot.2025-04-11.at.5.28.09.PM.png (view on web)
<https://github.com/user-attachments/assets/0fd89fe8-081d-4469-8d1e-befe68e7e1ef>
—
Reply to this email directly, view it on GitHub
<#2494 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUTT3LMXYAMGTPALLIC7WL2ZAX57AVCNFSM6AAAAAB26M2EZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOOJYGA2DGMJZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Recording.2025-04-14.161043.mp4video of the test, it seems to show the Icon. |

Context
decouple the webview HTML to a separate file to reduce clineProvider.ts size
Implementation
just removed the
Screenshots
no change visually
How to Test
Get in Touch
Important
Refactor moves webview HTML generation from
ClineProviderto newWebviewHTMLManagerclass for better code organization.ClineProvidertoWebviewHTMLManager.ClineProvidernow usesWebviewHTMLManagerfor HTML content generation.WebviewHTMLManagerclass inWebviewHTMLManager.ts.WebviewHTMLManagerhandles both standard and HMR HTML content generation.getHMRHtmlContent()andgetHtmlContent()moved toWebviewHTMLManager.ClineProvideruseswebviewHTMLManager.getHMRHtmlContent()andwebviewHTMLManager.getHtmlContent()for webview HTML.This description was created by
for 020207e. It will automatically update as commits are pushed.