Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 17 commits into from
Dec 8, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma commented Dec 7, 2022

Demo:

Screen.Recording.2022-12-06.at.18.49.24.mov

@BrunoQuaresma BrunoQuaresma requested a review from a team December 7, 2022 16:49
@BrunoQuaresma BrunoQuaresma self-assigned this Dec 7, 2022
@BrunoQuaresma BrunoQuaresma marked this pull request as ready for review December 7, 2022 16:49
@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner December 7, 2022 16:49
@BrunoQuaresma BrunoQuaresma requested review from Kira-Pilot and removed request for a team December 7, 2022 16:49
@BrunoQuaresma BrunoQuaresma enabled auto-merge (squash) December 7, 2022 18:03
Copy link
Member

@mafredri mafredri left a 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. 😂

@BrunoQuaresma
Copy link
Collaborator Author

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. 😂

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
Copy link
Member

@Kira-Pilot Kira-Pilot Dec 8, 2022

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 codersdk/templateversions.go? Nvmd, I see what's happening

Copy link
Collaborator Author

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
}
Copy link
Member

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?

Copy link
Collaborator Author

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 } => {
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure thing!

Copy link
Member

@Kira-Pilot Kira-Pilot left a 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!

@BrunoQuaresma BrunoQuaresma merged commit ce76d9d into main Dec 8, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/add-diff branch December 8, 2022 15:24
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants