Comfy-Org / Comfy-Org/ComfyUI_frontend
refactor: unify isColorPicker and isShapePicker in MenuOption into a single mode field
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
In `src/composables/graph/useMoreOptionsMenu.ts`, the `MenuOption` interface currently has two separate boolean flags:
```ts
isColorPicker?: boolean
isShapePicker?: boolean
```
These should be unified into a single discriminated field to prevent invalid states (e.g. both being `true` simultaneously):
```ts
mode?: 'color' | 'shape'
```
All consumers of these flags (e.g. `NodeContextMenu.vue`) should be updated accordingly.
## Context
Suggested by @pythongosssss in PR #12035 (comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/12035#discussion_r3265598014).
Requested by @dante01yoon.
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-12336-refactor-unify-isColorPicker-and-isShapePicker-in-MenuOption-into-a-single-mode-fiel-3656d73d36508149bc4efc5fccc2b0d4) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.