fix: support adding multiline secrets via the UI - #27253
Merged
Merged
Conversation
jakehwll
self-requested a review
July 21, 2026 05:56
jakehwll
marked this pull request as ready for review
July 21, 2026 05:58
Member
|
@jakehwll @dylanhuff-at-coder, can we get this reviewed? I think we should have this in the GA release. |
| </Label> | ||
| <div className="flex flex-col gap-2 sm:flex-row sm:items-start"> | ||
| <Input | ||
| <Textarea |
Contributor
There was a problem hiding this comment.
Can we add a story test that submits a multiline value and asserts it reaches onCreateSecret unchanged?
dylanhuff-at-coder
approved these changes
Aug 3, 2026
dylanhuff-at-coder
left a comment
Contributor
There was a problem hiding this comment.
Overall lgtm, I would like to see a regression test added as noted, but wouldn't find that blocking
jakehwll
reviewed
Aug 3, 2026
| </Label> | ||
| <div className="flex flex-col gap-2 sm:flex-row sm:items-start"> | ||
| <Input | ||
| <Textarea |
Contributor
Contributor
|
Cherry-pick PR created: #27808 |
mtojek
pushed a commit
that referenced
this pull request
Aug 4, 2026
Cherry-pick of #27253 Original PR: #27253 — fix: support adding multiline secrets via the UI Merge commit: f44e8c1 Requested by: @dylanhuff-at-coder Co-authored-by: Rowan Smith <[email protected]> Co-authored-by: Atif Ali <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Root cause (confirmed by reading SecretDialog.tsx): the Value field on the User Secrets "Add secret"/"Edit secret" dialog was rendered as , a single-line HTML control, so pasting a multiline kubeconfig/PEM/YAML got visually collapsed and the newlines were lost before the value ever reached the form state or the API request.
Fix applied in site/src/pages/UserSettingsPage/SecretsPage/SecretDialog.tsx:
Test fix in site/src/pages/UserSettingsPage/SecretsPage/SecretsPageView.stories.tsx: the EditSecretClearValue story's toBeVisible() assertion on the helper text was racing the render/layout commit (this test already used a waitFor for an analogous transient-visibility check on the neighboring Clear button). The taller textarea shifted that timing enough to expose the race consistently when run as part of the full suite. Wrapped the assertion in waitFor(...) to match the existing pattern.
Created with the help of Mux and Sonnet, tested by a human
Working with a secret file like this:
Created via the UI in 2.35.1:
Post change:
And displayed correct in the Coder workspace:

Add secret UI is now a multiline input box:
