Comfy-Org / Comfy-Org/ComfyUI_frontend

refactor: unify isColorPicker and isShapePicker in MenuOption into a single mode field

Open
#12,336 1 comment 1 reaction 1 assignee Claimed by @dante01yoon View on GitHub
area:context-menus developer experience
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.