Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude review |
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. It's a user-facing UX change (a new user data component, with pasted text as the new default), so a maintainer should still look at the design and accessibility choices.
What was reviewed:
- The submit path in
app/forms/instance-create.tsx: only the selected source gets encoded. Whitespace-only text and a missing file both leaveuserDataundefined, and text goes through a Blob, so it is UTF-8 encoded before base64. UserDataFieldwiring:FileInputgets the RHF field minusvalue, the same wayFileFielddoes. Itsname/idprops override the input's defaults. The uncontrolledRadioGroupdefault matches the'text'form default, and nothing callsreset/setValueon these fields.- The leftover
userDatafield has no other references, and the e2e test covers switching sources without losing the typed text.
Extended reasoning...
The change touches only the instance create form and its e2e test. It replaces the FileField for user data with a new UserDataField (radio, textarea and file input) and splits the form value into source, text and file fields. It has no auth, crypto or injection surface; user data is base64-encoded on the client the same way as before. The logic is small and looks correct. I deferred because it changes the default UX and adds a custom labelled control whose design and accessibility a maintainer may want to weigh. No CODEOWNERS file covers these paths, and the timeline shows no open reviewer objections.
|
The basic idea looks pretty good to me. Only things I might want to tweak are:
|
Closes #3118 Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a16419-1240-731a-a211-813ca08a66c2
74f3288 to
533ebaf
Compare
Closes #3118
Adds a textarea for cloud-init user data on the instance create form, so users can paste user data instead of creating and uploading a file. A Paste text / Upload file radio above the input picks the source, and pasting is the default. File upload stays as an option because some user data (e.g., gzipped cloud-config) isn't plain text.
user_data.Before
After
Testing
npm run tscandnpm run lintpass.can create an instancee2e test to type user data, switch to file upload and back, and check the text is preserved.user_data, file mode sends the file bytes and ignores typed text, and switching back to text after choosing a file sends the text.