Comfy-Org / Comfy-Org/ComfyUI_frontend
Define behavior for duplicate-label, type-distinct select options
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Define and implement the behavior for select widget options that have the same
display value but different types, such as `[1, '1']` or `[true, 'true']`.
## Rationale
`WidgetSelectDefault.vue` currently derives option matching and Combobox values
from string representations. Type-distinct options can therefore have the same
display value. The UI renders indistinguishable entries, and model-to-option
matching cannot determine which typed option the model represents.
PR #14460 fixes numeric COMBO value preservation. This duplicate-label behavior
is pre-existing and is intentionally out of scope for that focused fix.
## Affected area
- `src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue`
- Select widget option normalization, Combobox identity, labels, and
model-to-option matching
## Required changes
1. Define the user-visible behavior for duplicate-label, type-distinct options.
2. Define the model-matching behavior when more than one option has the same
string display value.
3. Implement collision-free option identities if the selected option must be
preserved.
4. Preserve existing numeric and string `WidgetValue` behavior.
5. Add regression coverage for the selected behavior.
## Acceptance criteria
- The intended behavior for options such as `[1, '1']` is documented.
- The component does not silently select an unintended typed option.
- The UI makes options distinguishable if both can be selected.
- Tests cover selection and initial model matching for the defined behavior.
- Existing numeric COMBO behavior remains correct.
## Backlinks
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/14460
- Review discussion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/14460#discussion_r3688124550
Requested by @jaeone94.
Contributor guide
Assessment
This issue has not been assessed yet.