fix(ui): fix model name editing on the model config form#1979
fix(ui): fix model name editing on the model config form#1979Valyrian-Code wants to merge 6 commits into
Conversation
The "Edit Auto-Generated Name" pencil button had no explicit type, so as a child of the form it defaulted to type="submit" and fired the updateModelConfig action on click. Set type="button" so it only toggles name editing, matching the sibling fetch-models button. Fixes kagent-dev#1947 Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an explicit button type to prevent unintended form submission when clicking the “edit model name” icon button.
Changes:
- Set
type="button"on the edit-model-name button to avoid default submit behavior inside a form.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A ModelConfig's metadata.name is immutable in Kubernetes, so editing it on update silently has no effect. Disable the name-edit pencil in edit mode (matching the namespace, provider, and model fields, which are already disabled when editing) and show a hint that the name can't be changed after creation. Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
|
This pull request has been marked as stale because of no activity in the last 15 days. It will be closed in the next 5 days unless it is tagged "no stalebot" or other activity occurs. |
|
The failing This PR only adds |
Summary
Two related problems with the model name field and its "Edit Auto-Generated Name" pencil button on the model form (
/models/new, including?edit=true):Pencil submitted the form. The button had no explicit
type, so as a child of the<form>it defaulted totype="submit"and fired theupdateModelConfigaction on click — the form saved and navigated away instead of just toggling name editing. Fixed by settingtype="button", matching the sibling "fetch models" button.Renaming in edit mode silently did nothing. A
ModelConfig'smetadata.nameis immutable in Kubernetes, so an update can never rename the resource. The pencil is now disabled in edit mode — consistent with the namespace, provider, and model fields, which are already disabled when editing — and a hint clarifies that the name can't be changed after creation.Fixes #1947
Changes
ui/src/components/models/new/BasicInfoSection.tsx:type="button"to the edit-name pencil so it no longer submits the formTesting
/models/new?edit=true, clicking the pencil no longer triggers a network call or form submission.