Skip to content

Conversation

@bramburn
Copy link
Contributor

@bramburn bramburn commented Apr 11, 2025

  • 【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.

Context

decouple the webview HTML to a separate file to reduce clineProvider.ts size

image

Implementation

just removed the

Screenshots

no change visually

before after

How to Test

  • click roo code app
  • should load the taskpane window

Get in Touch


Important

Refactor moves webview HTML generation from ClineProvider to new WebviewHTMLManager class for better code organization.

  • Refactor:
    • Move HTML generation logic from ClineProvider to WebviewHTMLManager.
    • ClineProvider now uses WebviewHTMLManager for HTML content generation.
  • Classes:
    • New WebviewHTMLManager class in WebviewHTMLManager.ts.
    • WebviewHTMLManager handles both standard and HMR HTML content generation.
  • Functions:
    • getHMRHtmlContent() and getHtmlContent() moved to WebviewHTMLManager.
    • ClineProvider uses webviewHTMLManager.getHMRHtmlContent() and webviewHTMLManager.getHtmlContent() for webview HTML.

This description was created by Ellipsis for 020207e. It will automatically update as commits are pushed.

- 【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.
@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2025

⚠️ No Changeset found

Latest commit: 020207e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 11, 2025
* @returns A template string literal containing the HTML that should be
* rendered within the webview panel
*/
public getHtmlContent(webview: vscode.Webview): string {
Copy link
Contributor

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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 11, 2025
@mrubens mrubens merged commit e70954f into RooCodeInc:main Apr 11, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 11, 2025
@mrubens
Copy link
Collaborator

mrubens commented Apr 11, 2025

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

@bramburn
Copy link
Contributor Author

bramburn commented Apr 11, 2025 via email

@bramburn
Copy link
Contributor Author

Recording.2025-04-14.161043.mp4

video of the test, it seems to show the Icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants