Skip to content

fix(site): fix disappearing preset selector when switching template - #20514

Merged
DanielleMaywood merged 4 commits into
mainfrom
danielle/fix/preset-selector
Oct 29, 2025
Merged

DanielleMaywood merged 4 commits into
mainfrom
danielle/fix/preset-selector

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Oct 28, 2025 •

Copy link
Copy Markdown
Contributor

Closes #20465

Ensure we set selectedPresetId to undefined when we change selectedTemplateId to ensure we don't end up breaking the <Select> component by giving it an invalid preset id.

@DanielleMaywood
DanielleMaywood marked this pull request as ready for review October 28, 2025 14:31

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but will happily defer to other reviewers' feedback.

@aslilac

aslilac commented Oct 28, 2025

Copy link
Copy Markdown
Member

the key was added to intentionally unmount the state of the old selector, so that it would be recomputed with a default from the new set of values.

@DanielleMaywood

Copy link
Copy Markdown
Contributor Author

@aslilac I've re-added the key but added a check on the onValueChange. Let me know if you want a different approach

@aslilac aslilac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm fine with this fix, but left some food for thought and would like to see a comment or something describing the pitfalls that the fix is supposed to smooth over

@johnstcn johnstcn added the cherry-pick/v2.28 Needs to be cherry-picked to the 2.28 release branch label Oct 29, 2025
@DanielleMaywood
DanielleMaywood merged commit 9629d87 into main Oct 29, 2025
3 checks passed
@DanielleMaywood
DanielleMaywood deleted the danielle/fix/preset-selector branch October 29, 2025 21:11
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cherry-pick/v2.28 Needs to be cherry-picked to the 2.28 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coder Tasks presets not set correctly when switching between templates

3 participants