Repository navigation
fix: [Agent] The "File Upload" toggle in the basic information settings is disabled, yet the file upload button remains visible in the debugging dialog window. #7748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the diff looks syntactically valid and the refactor is reasonable. The main risk is ensuring the new
canUploadcomputed has exactly the same semantics as the old inline condition, plus any upload-feature gating.Potential issues
canUploadmust includeuploadEnableduploadEnabledis false.useInputEventsnow relies only oncanUpload.value.canUploaddoes not includeuploadEnabled, then paste/drag-drop handlers may still add files even though the upload UI is hidden.canUploadalready incorporatesuploadEnabled.Guard
allowedExtensionsbefore calling.join()allowedExtensions.join('、')will throw ifallowedExtensionsisundefined,null, or not an array.{{ allowedExtensionsText }}in the template.Ensure
canUploadpreserves the old conditionscanUploadcomputed includes all of these. If it omits any condition, the upload button and paste/drop behavior may regress.v-ifon the file input andfileInputRefv-if="uploadEnabled"meansfileInputRefisnullwhile uploads are disabled.fileInputRef.value?.click()without checkinguploadEnabled/canUpload.allowedExtensionsvsacceptListconsistencyallowedExtensions, while the file input still usesacceptList.Optimization / readability suggestions
Wrap both upload-related elements in one
<template v-if="uploadEnabled">instead of repeatingv-if:Consider renaming or documenting the distinction between:
uploadEnabled— feature-level availabilitycanUpload— current-state eligibilityThis helps avoid future confusion.
If
allowedExtensionsis empty, decide whether to show “无限制” or fall back toacceptList; an empty string in the tooltip is not user-friendly.No obvious syntax problems in the diff, but the
canUpload/uploadEnabledrelationship is the most important correctness point to verify.