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

Update Assistant Markdown styles #208

Merged
merged 2 commits into from
Jun 6, 2024
Merged

Update Assistant Markdown styles #208

merged 2 commits into from
Jun 6, 2024

Conversation

derekblank
Copy link
Contributor

@derekblank derekblank commented Jun 5, 2024

Updates Markdown styles used by Assistant

Proposed Changes

  • Updates Assistant messages and styles to use className instead of id (per discussion on #200)
  • Updates Markdown CSS styles to differentiate between inline code blocks and fenced code blocks. (Previously, inline code blocks were difficult to read against a light background.)
code-highlighting-2

Testing Instructions

  • Start app with AI Assistant flag enabled: STUDIO_AI=true npm start
  • Create a site and navigate to Assistant tab
  • Ask Assistant to show examples of both inline code blocks and fenced code blocks
  • Observe that inline code blocks are readable

Note

I was not able to find an actual example of an inline code block in the designs to reference the colors, but I could have missed it. However, it is technically possible for the Assistant API endpoint to return inline code blocks in Markdown, so we should account for inline code block styles. Open to modifying the color patterns proposed here.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@derekblank derekblank added the [Type] Bug Something isn't working label Jun 5, 2024
@derekblank derekblank requested a review from sejas June 5, 2024 07:13
@derekblank derekblank self-assigned this Jun 5, 2024
@derekblank derekblank added [Type] Enhancement Improvement upon an existing feature and removed [Type] Bug Something isn't working labels Jun 5, 2024
@derekblank derekblank requested a review from a team June 5, 2024 07:17
@derekblank
Copy link
Contributor Author

@sejas Opening this PR as a follow-up to #200 to make any further updates to Markdown styles. If any further updates are noted, feel free to suggest or make them directly to this PR. 👍

@derekblank derekblank marked this pull request as ready for review June 5, 2024 07:23
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

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

The changes look good.
It's hard to tell the difference when the LLM returns code blocks inside code blocks.

Render from Studio:
Screenshot 2024-06-06 at 19 14 45

Render from Obsidian. I grabbed it from localStorage and replaced \n with real enters.
Screenshot 2024-06-06 at 19 13 23

@derekblank
Copy link
Contributor Author

derekblank commented Jun 6, 2024

The changes look good. It's hard to tell the difference when the LLM returns code blocks inside code blocks.

Thanks for the review. 🚀 I've updated some further enhancements specifically for the dynamic code blocks as part of #214.

@derekblank derekblank merged commit 8a2aa6a into trunk Jun 6, 2024
10 checks passed
@derekblank derekblank deleted the fix/markdown-updates branch June 6, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improvement upon an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants