Skip to content

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

Merged
shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_form
Nov 12, 2026

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

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.

…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"]

Copy link
Copy Markdown
Contributor Author

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 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

  • TreeSelect component is actually exported/registered in whatever component map consumes exposedInputTypes (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 TreeSelect is 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 exposedInputTypes updated.
  • 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 a Set for 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).

@shaohuzhang1
shaohuzhang1 merged commit 701213c into v3 Nov 12, 2026
3 of 4 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v3@fix_form branch November 12, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant