-
Notifications
You must be signed in to change notification settings - Fork 904
feat: Add diff and Dockerfile support for template version page #5339
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
Conversation
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.
Had a few comments but other than that, BE looks good. 👍🏻
And wrt frontend, I think this solution is a great start. It'd be pretty cool if we opened up an instance of code-server or something that showed the files/diff, but IDK if that'd make our bundle size way too huge. 😂
Co-authored-by: Mathias Fredriksson <[email protected]>
Yeah, but we are basically using the editor that is used by VS Code. https://microsoft.github.io/monaco-editor/ |
@@ -231,6 +231,34 @@ export const getTemplateVersionByName = async ( | |||
return response.data | |||
} | |||
|
|||
export type GetPreviousTemplateVersionByNameResponse = | |||
| TypesGen.TemplateVersion | |||
| undefined |
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.
Can we make a type for this on the BE? Maybe in Nvmd, I see what's happeningcodersdk/templateversions.go
?
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.
Great!
|
||
if (coderTheme.isLoading) { | ||
return null | ||
} |
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.
Do we need a loading state?
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.
Not really, it is VERY fast. It is only a few milliseconds to monaco
be loaded. From what I was able to inspect there is no networking involved so the "loading time" is "static"
}, | ||
}) | ||
|
||
export const useCoderTheme = (): { isLoading: boolean; name: string } => { |
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.
Adding a comment here explaining what this hook/what its scope is might be helpful.
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.
Sure thing!
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.
Nicely done; very clean!
Demo:
Screen.Recording.2022-12-06.at.18.49.24.mov