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: allow for default presets#18445

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

Open
dannykopping wants to merge7 commits intomain
base:main
Choose a base branch
Loading
fromdk/default-preset
Open

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedJun 19, 2025
edited
Loading

Disclaimer: mostly implemented by Claude Code.

Depends on:coder/terraform-provider-coder#414
Closes:#18110

I've tested this against both the classic and new (dynamic parameters) approaches.

...data"coder_workspace_preset""goland" {default=true# <-----------------name="I Like GoLand"parameters={"jetbrains_ide"="GO""cpu"="2"  }}data"coder_workspace_preset""python" {name="Some Like PyCharm"parameters={"jetbrains_ide"="PY"  }}...

Default preset is autoselected on load:

image

image

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykopping changed the titlefeat: default presetsfeat: allow for default presetsJun 19, 2025
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@@ -103,5 +103,4 @@ Read [cursor rules](.cursorrules).

The frontend is contained in the site folder.

For building Frontend refer to[this document](docs/contributing/frontend.md)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Drive-by: link is dead.

@@ -72,6 +72,9 @@ replace github.com/aquasecurity/trivy => github.com/coder/trivy v0.0.0-202505271
// https://github.com/spf13/afero/pull/487
replacegithub.com/spf13/afero =>github.com/aslilac/aferov0.0.0-20250403163713-f06e86036696

// TODO: replace once we cut release.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Might make sense to wait until that is merged + tagged first?

dannykopping reacted with thumbs up emoji
@dannykoppingdannykopping marked this pull request as ready for reviewJune 19, 2025 08:27
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

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

Changes look OK to me, with the provisio that we should merge + pre-release the provider change first

}

forname,tc:=rangecases {
tc:=tc
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tc := tc

t.Parallel()

// nolint:dogsled
_,filename,_,_:=runtime.Caller(0)
Copy link
Member

Choose a reason for hiding this comment

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

nit, non-blocking: I understand that this is copied from other tests, but I wonder if we could uset.Name() instead?

@@ -72,6 +72,9 @@ replace github.com/aquasecurity/trivy => github.com/coder/trivy v0.0.0-202505271
// https://github.com/spf13/afero/pull/487
replacegithub.com/spf13/afero =>github.com/aslilac/aferov0.0.0-20250403163713-f06e86036696

// TODO: replace once we cut release.
Copy link
Member

Choose a reason for hiding this comment

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

Might make sense to wait until that is merged + tagged first?

dannykopping reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Obligatory reminder to check migration number before merge

dannykopping reacted with thumbs up emoji
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
if(defaultPreset){
// +1 because "None" is at index 0
constdefaultIndex=
presets.findIndex((preset)=>preset.ID===defaultPreset.ID)+1;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this fine, but I've been caught byfindIndex before while working on presets. Is there any way thatfindIndex might return -1 here?

@@ -125,6 +125,7 @@ export const PresetsButNoneSelected: Story = {
{
ID:"preset-1",
Name:"Preset 1",
Default:false,
Copy link
Contributor

Choose a reason for hiding this comment

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

https://www.chromatic.com/test?appId=624de63c6aacee003aa84340&id=685406cf992466e39d7877ba
Label still shows preset 1 but the value in the form is that of preset 2.
Is this expected?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@SasSwartSasSwartSasSwart left review comments

@johnstcnjohnstcnjohnstcn approved these changes

@BrunoQuaresmaBrunoQuaresmaAwaiting requested review from BrunoQuaresma

@spikecurtisspikecurtisAwaiting requested review from spikecurtisspikecurtis is a code owner

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Presets: Support a default preset
3 participants
@dannykopping@johnstcn@SasSwart

[8]ページ先頭

©2009-2025 Movatter.jp