Skip to content

Conversation

@elianiva
Copy link
Contributor

@elianiva elianiva commented Apr 18, 2025

Context

I've been wanting to change this for a while. The current inline code feels a bit 'out of place', every time the LLM outputs them I find it hard to read and just clutters the chat.

Implementation

  • Adjusted the monospace font to be slightly smaller than the rest because they tend to appear larger just a tiny bit.
  • Adjusted the border colour so they are more subtle, the old one makes it as if these blocks are clickable and a separate element instead of just plain text with different styling

Screenshots

Epilepsy warning, I'm switching between multiple different themes (dark and light) to test it.

Before

Screencast.From.2025-04-18.13-45-17.mp4

After

Screencast.From.2025-04-18.13-45-53.mp4

How to Test

Try having a chat with the LLM and ask it to output some inline code

Get in Touch

@elianiva on Roocode discord server


Important

Refactor inline code styling in MarkdownBlock.tsx to be more subtle by adjusting font size and border color.

  • Styling Changes:
    • In MarkdownBlock.tsx, adjusted code:not(pre > code) to have font-size: 0.9em for a slightly smaller appearance.
    • Changed border color of code:not(pre > code) to var(--vscode-tab-border, #424242) for a more subtle look.

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

@changeset-bot
Copy link

changeset-bot bot commented Apr 18, 2025

⚠️ No Changeset found

Latest commit: 78f26bf

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:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Apr 18, 2025
@cte
Copy link
Collaborator

cte commented Apr 18, 2025

This bugs me too! Let's figure out the font size thing though.

@adamhill
Copy link
Contributor

I like the font change!

One thing that helps me see the code (inline) with normal text is a much more vibrant / saturated color, especially in darker modes. (I have been trained by GH Copilot choices)

Are the chat blocks picking up the colors from the theme the user has selected? And would actual large code blocks pick up the theme proper from whatever component we use?

@elianiva
Copy link
Contributor Author

I like the font change!

One thing that helps me see the code (inline) with normal text is a much more vibrant / saturated color, especially in darker modes. (I have been trained by GH Copilot choices)

Are the chat blocks picking up the colors from the theme the user has selected? And would actual large code blocks pick up the theme proper from whatever component we use?

i guess we need to figure out which token that consistently has bright/stand out colour across colourschemes

as for the codeblock, there is some work at #1328
i believe it will take the current theme since it uses shiki (which is using the same textmate grammar that vscode uses, so it will be compatible)

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Apr 22, 2025
@elianiva
Copy link
Contributor Author

elianiva commented May 1, 2025

i played with this a bit more, a few changes:

  • reverted the font size change, apparently the bigger font size only happens on low resolution? not sure, but it doesn't happen now after I changed my monitor
  • removed the border since it makes the inline code looks like its own entity, we can utilise borders for actually clickable items
  • adjusted the foreground and background colour, now it's similar with Github copilot which IMO is better because it handles multiple themes better especially with the high contrast ones

I think this PR is ready for review.

updated preview:

Before

Screen.Recording.2025-05-02.at.00.31.55.mov

After

Screen.Recording.2025-05-02.at.00.30.01.mov

}
code:not(pre > code) {
font-size: 0.9em;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this might be problematic if your VSCode user settings specify a much larger font size.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 1, 2025
@cte
Copy link
Collaborator

cte commented May 1, 2025

Thanks!

@cte cte merged commit f39dcf4 into RooCodeInc:main May 1, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 1, 2025
@elianiva elianiva deleted the refactor/inline-code branch May 1, 2025 18:13
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* new task tool added

* small fix

* fixed numbering

* system prompt
mehmetsunkur pushed a commit to mehmetsunkur/Roo-Code that referenced this pull request May 16, 2025
* refactor(chat): show inline code more subtle

* refactor: make inline code more readable
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:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants