Repository navigation
fix: [AI Agent] The prompt configuration for external parameters mentions support for "tree-style tabs," but no such option actually exists in the dropdown menu. - #7861
Conversation
…ions support for "tree-style tabs," but no such option actually exists in the dropdown menu.
| @@ -1 +1 @@ | |||
| export const exposedInputTypes = ['TextInput', 'TextareaInput', 'PasswordInput', 'SingleSelect', 'MultiSelect', 'DatePicker', 'SwitchInput','Model',"Knowledge"] | |||
| export const exposedInputTypes = ['TextInput', 'TextareaInput', 'PasswordInput', 'SingleSelect', 'MultiSelect', 'DatePicker', 'SwitchInput','Model',"Knowledge","TreeSelect"] | |||
There was a problem hiding this comment.
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 with singleQuote is in the project, this should fail lint or be auto-fixed. Keep it consistent:
export const exposedInputTypes = ['TextInput', 'TextareaInput', 'PasswordInput', 'SingleSelect', 'MultiSelect', 'DatePicker', 'SwitchInput', 'Model', 'Knowledge', 'TreeSelect'];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:
export const exposedInputTypes = [
'TextInput', /* ... */, 'TreeSelect',
] as const satisfies readonly string[];
export type ExposedInputType = typeof exposedInputTypes[number];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 shared enum/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 const doesn't prevent push()/mutation by consumers. If it's meant to be a static allowlist, use as const, Object.freeze([...]), or readonly string[].
5. Line length
The single line is now ~170+ chars; will trip max-len rules. Split across lines for readability.
Functional Checklist Before Merging
-
TreeSelectcomponent is actually exported/registered in whatever component map consumesexposedInputTypes(otherwise it renders nothing / throws). - Backend / API allowlist, validation schema (Zod/Yup), and serializers accept
"TreeSelect". - If this array gates rendering or permissions, confirm exposing
TreeSelectis intended for all roles that read this list. - i18n keys, form-builder UI catalog, and docs updated.
- Tests/snapshots that assert the exact length or contents of
exposedInputTypesupdated. - Case-sensitivity: consumers match on exact string — verify no legacy
"treeselect"usage exists.
Performance (minor)
- If
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. - Array size growth is irrelevant here.
Bottom line
Ship-blocking: none. Recommended: fix quoting, add as const/typed union, and verify TreeSelect is wired up end-to-end (component + backend allowlist + tests).
fix: [AI Agent] The prompt configuration for external parameters mentions support for "tree-style tabs," but no such option actually exists in the dropdown menu.