-
Notifications
You must be signed in to change notification settings - Fork 61
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
INN-3033: make code editor support tailwind/system color schema and overrides #1357
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There are a couple visual quirks to the editor that light mode exposed (see lower border corners). I'll clean those up. |
Do we want to make the editor toolbar light as well? I've left it dark for now as it more or less matches the rest of the current design. |
It's a great question. Yes! In light mode, the border of the entire block should be |
I believe I've addressed all the items we talked about in review with the exception of the transparent scrollbars. I couldn't find any easy way to do that via monaco options so I just let that be for now. Updates are:
|
@@ -133,15 +196,6 @@ export function CodeBlock({ header, tabs, actions = [] }: CodeBlockProps) { | |||
setActiveTab(index); | |||
}; | |||
|
|||
function handleEditorDidMount(editor: MonacoEditorType) { |
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.
This was the cause of the broken borders as it was not adding this class when there were more than one editor on the page. So instead I just removed it and applied this globally via css, see above.
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.
Looking good @jacobheric ! Left a few small comments 🙂
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Thanks @anafilipadealmeida for the careful review, I think I've addressed all your comments! Let me know if you see anything else. Also, I see I'm getting an invalid dom nesting error now that I've switched to the new buttons. I'll give that a look and fix before we merge. |
@@ -134,7 +134,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps<string>>(functio | |||
if (tooltip) { | |||
return ( | |||
<Tooltip> | |||
<TooltipTrigger>{Element}</TooltipTrigger> | |||
<TooltipTrigger asChild>{Element}</TooltipTrigger> |
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.
@anafilipadealmeida, the dom nesting error I was getting was because I added tooltips to our buttons. Rendering the tooltip trigger button as a child element prevents this nesting. I clicked around after making this change and all the tooltips seem to be working as expected.
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.
Thank you for all the hard work, looking great! Left a final small comment, but approving this already!
Co-authored-by: Ana Filipa de Almeida <anafilipadealmeida@gmail.com>
Description
Code editor was previously hard coded to use a dark theme. Now it will use the tailwind/system color scheme by default and also support the ability to override the color scheme per use. This is useful for things like the current function view in the dashboard that we still want dark despite the fact that the dashboard itself use a light color scheme.
Here the webhooks editor gets the default light:
And the function editor is overriden to dark
Motivation
Type of change (choose one)
Checklist
https://linear.app/inngest/issue/INN-3033/add-light-theme-to-code-block
Check our Pull Request Guidelines