Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): add support for presets to the create workspace page#16567

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SasSwart merged 8 commits intomainfromjjs/presets-fe
Feb 18, 2025

Conversation

SasSwart
Copy link
Contributor

@SasSwartSasSwart commentedFeb 14, 2025
edited
Loading

This pull request adds support for presets to the create workspace page. This behaviour can be seen in the storybook. This will not be visible in dogfood until we merge support for presets in the provisioners.

There is more frontend work to be done before this is ready for a general release, but this should be sufficient for dogfood testing

@SasSwartSasSwart marked this pull request as ready for reviewFebruary 14, 2025 08:43
@SasSwartSasSwart changed the titlefeat(site): add support for presets to the coder frontendfeat(site): add support for presets to the create workspace pageFeb 14, 2025
Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Just left a few comments.

value: preset.ID,
})),
];
}, [presets]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We only useuseMemo when really necessary. In this case, it would be ok to compute this on every render.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Cool. I will remove the useMemo. For my own learning: Can you help me understand why not to use useMemo in this case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It’s just a matter of adding complexity—caching—in a place where it’s not really needed.

presets,
parameters,
form.setFieldValue,
]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm assuming this effect is to set in the form the default values right? If yes, I think the best place to set them is in the form initialValues prop here

.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This effect is not only for default values, but also for if the user chooses a new preset. If they choose a new preset then this effect will autofill the form for them using the new preset values.

BrunoQuaresma reacted with thumbs up emoji
@@ -189,6 +245,31 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
</Alert>
)}

{presets.length > 0 && (
<FormSection
Copy link
Collaborator

Choose a reason for hiding this comment

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

A form section should be used to group similar fields. I'm usually don't like to have sections with a single field 🤔 but I will leave this up to you. I was wondering if this could not be in the General section.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Understood. There is another issue open to consider the UX and design of this entire page. I have made this change as requested, but I would like to request that we defer further design discussions for the mockups.

BrunoQuaresma reacted with thumbs up emoji
@dannykoppingdannykopping removed their request for reviewFebruary 18, 2025 08:00
@dannykopping
Copy link
Contributor

Removed myself as a reviewer; this is not my area of expertise. All I'd be able to contribute is vibes or a stamp, neither of which are valuable.

SasSwart reacted with heart emoji

Copy link
Collaborator

@BrunoQuaresmaBrunoQuaresma left a comment

Choose a reason for hiding this comment

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

@SasSwart Just check the Chromatic checks pls 🙏

@SasSwartSasSwart merged commita17cf03 intomainFeb 18, 2025
30 checks passed
@SasSwartSasSwart deleted the jjs/presets-fe branchFebruary 18, 2025 13:26
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 18, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

Assignees

@SasSwartSasSwart

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@SasSwart@dannykopping@BrunoQuaresma

[8]ページ先頭

©2009-2025 Movatter.jp