Repository navigation
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.
Verdict
The change is functionally harmless — it just appends a string to an array. No syntax errors. The concerns are stylistic and about type-safety/maintainability rather than bugs.
Issues & Suggestions
1. Inconsistent quoting
"Model"and"Knowledge"use double quotes while everything else uses single quotes (and"TreeSelect"follows the same wrong pattern). If Prettier/ESLint withsingleQuoteis in the project, this should fail lint or be auto-fixed. Keep it consistent:2. No literal typing (
as const/satisfies)As written, this infers
string[], so a typo like'TreeSelct'compiles fine and consumers can't narrow on it. Prefer:This gives autocomplete and compile-time safety at every
includes(...)/ switch site.3. Single source of truth
The list mixes naming conventions (
TextInput,DatePicker,Model,Knowledge,TreeSelect). Consider a sharedenum/const object in one module (ideally shared with the backend allowlist), so the frontend list, backend validation, and component registry can't drift apart.4. Mutable export
export constdoesn't preventpush()/mutation by consumers. If it's meant to be a static allowlist, useas const,Object.freeze([...]), orreadonly string[].5. Line length
The single line is now ~170+ chars; will trip
max-lenrules. Split across lines for readability.Functional Checklist Before Merging
TreeSelectcomponent is actually exported/registered in whatever component map consumesexposedInputTypes(otherwise it renders nothing / throws)."TreeSelect".TreeSelectis intended for all roles that read this list.exposedInputTypesupdated."treeselect"usage exists.Performance (minor)
exposedInputTypes.includes(type)is called in a hot render path, convert to aSetfor O(1) lookup. For a 10-item list it's negligible, but it's a cheap win.Bottom line
Ship-blocking: none. Recommended: fix quoting, add
as const/typed union, and verifyTreeSelectis wired up end-to-end (component + backend allowlist + tests).