Skip to content

Conversation

@DonDawsy
Copy link

@DonDawsy DonDawsy commented Apr 14, 2025

Context

I made a PR earlier to add a Font aliasing toggle in VScode settings, but it turns out the problem was Roo Code was not respecting the workbench.fontAliasing setting from VS Code. This resulted in inconsistent font rendering within the webview compared to the rest of the editor, especially noticeable on macOS. The webview's font anti-aliasing should now match the user's preference set in VS Code.

This fix should be more effective.

Implementation

To handle font aliasing properly, I did the following:

  • When the webview initializes, it reads the ⁠workbench.fontAliasing setting using vscode.workspace.getConfiguration().get('fontAliasing').
  • It then sends this value to the webview using ⁠postMessageToWebview.

  • The webview listens for any changes to this setting and updates itself if ⁠workbench.fontAliasing changes.
  • In ⁠ExtensionMessage.ts: I added a new message type called ⁠fontAliasing with an optional ⁠value: string.
  • In ⁠App.tsx (Webview): I updated the ⁠onMessage handler to listen for ⁠fontAliasing messages. It maps the received values to the correct CSS for ⁠-webkit-font-smoothing and applies them dynamically.

This allows the webview to use the font aliasing setting from VS Code.


Important

The PR updates Roo Code to respect the workbench.fontAliasing setting from VS Code, ensuring consistent font rendering in the webview.

  • Behavior:
    • Webview now respects workbench.fontAliasing setting from VS Code for consistent font rendering.
    • On initialization, ClineProvider.ts reads fontAliasing setting and sends it to the webview.
    • Webview updates dynamically if fontAliasing changes.
  • Code Changes:
    • In ClineProvider.ts, added logic to read and send fontAliasing setting to webview.
    • In ExtensionMessage.ts, added fontAliasing message type with optional value.
    • In App.tsx, updated onMessage handler to apply fontAliasing to -webkit-font-smoothing.
  • CSS:
    • Changed -webkit-font-smoothing to inherit in index.css.

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 14, 2025

⚠️ No Changeset found

Latest commit: dd2c01b

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:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Apr 14, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 14, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 14, 2025
@adamhill
Copy link
Contributor

Hey, I was right about the "arcane interaction" bit! :-)

@DonDawsy
Copy link
Author

Hey, I was right about the "arcane interaction" bit! :-)

Absolutely, thanks for that! 👍

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 16, 2025
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to PR [Greenlit] in Roo Code Roadmap May 5, 2025
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* Add remote server form

* changeset

* naming
@sachasayan
Copy link
Contributor

Just skimming through the code here: Is -webkit-font-smoothing: inherit; alone not enough due to extension sandboxing? I'm wondering why this needs to be a 'loaded' setting at all.

@DonDawsy
Copy link
Author

DonDawsy commented May 6, 2025

Just skimming through the code here: Is -webkit-font-smoothing: inherit; alone not enough due to extension sandboxing? I'm wondering why this needs to be a 'loaded' setting at all.

I thought it would too, I tried that first but it does not change the webview aliasing when changing the vscode setting.

@hannesrudolph hannesrudolph moved this from New to PR [Greenlit] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from TEMP to Needs Preliminary Review in Roo Code Roadmap May 27, 2025
@daniel-lxs
Copy link
Member

Thanks for your contribution. We genuinely apologize for the delay in reviewing your PR.

We've now shifted to a clearer issue-first workflow. Please create an issue if you wish to revisit this PR.

We appreciate your patience and would be happy to have you continue contributing.

@daniel-lxs daniel-lxs closed this May 27, 2025
@github-project-automation github-project-automation bot moved this from PR [Greenlit] to Done in Roo Code Roadmap May 27, 2025
@github-project-automation github-project-automation bot moved this from Needs Preliminary Review to Done in Roo Code Roadmap May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Needs Preliminary Review size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants