fix(ui): fix model name editing on the model config form#1979
Open
Valyrian-Code wants to merge 4 commits into
Open
fix(ui): fix model name editing on the model config form#1979Valyrian-Code wants to merge 4 commits into
Valyrian-Code wants to merge 4 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>
Contributor
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 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
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.