Comfy-Org / Comfy-Org/ComfyUI_frontend
Consolidate multi-select modifier detection
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Move the shared Ctrl/Cmd/Shift selection-modifier check to a neutral utility and use it across asset and Vue node selection paths.
## Why
PR #14765 exposed duplicate `event.shiftKey || event.metaKey || event.ctrlKey` checks in `MediaAssetCard` and `MediaVideoTop`. Those checks need to remain exact complements; if they drift, the same click could both play a video and select the asset.
An existing `isMultiSelectKey()` helper lives under `renderer/extensions/vueNodes`, which is not an appropriate dependency for asset components.
## Scope
- Choose a neutral shared location for `isMultiSelectKey()`.
- Migrate Vue node selection consumers.
- Migrate `MediaAssetCard` and `MediaVideoTop`.
- Migrate the equivalent check in `useAssetGridSelection`.
- Add focused tests that keep modifier behavior aligned.
## References
- PR #14765
- [Review comment](https://github.com/Comfy-Org/ComfyUI_frontend/pull/14765#discussion_r3726456497)
Contributor guide
Research direction
Start by locating the existing isMultiSelectKey() helper under renderer/extensions/vueNodes and tracing its Vue node consumers, then inspect MediaAssetCard, MediaVideoTop, and useAssetGridSelection for duplicate modifier checks. Move the helper to a neutral shared location, migrate all named consumers, and add focused tests confirming Ctrl, Cmd, and Shift behavior remains aligned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100